feat: 卡流量改为日快照计量并统一停复机规则
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
卡流量计量(按名单灰度,默认 off): - 新增卡日快照与切换水位表(000241),按通道上游流量重置日换算自然月、重置日防旧值 - 已切换的卡按月对账产生增量,无生效中套餐只结算不发事件;第一次切换写水位 - 已切换卡读数有效即判定通道阈值,卡表本月用量用快照覆盖,日流量读快照 - 配置 JUNHONG_TRAFFIC_CALC_MODE/CARDS、JUNHONG_TRAFFIC_FLOW_SNAPSHOT_ENABLED 停复机规则(总开关 JUNHONG_STOP_RESUME_UNIFIED_RULE_ENABLED,默认关闭): - 复机不看停机原因,持通道阈值锁仍拒绝;暂停轮询的卡不自动停复机 - 通道新增实名管控 realname_control_enabled(000242,默认 0),开启后不区分行业卡与实名策略 - 实名管控从 0 改 1 需确认,修改并入通道更新审计 OpenSpec Change: rebuild-card-traffic-metering-and-stop-resume
This commit is contained in:
@@ -2,6 +2,7 @@ package carrier
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
@@ -54,7 +55,7 @@ func (s *Service) Create(ctx context.Context, req *dto.CreateCarrierRequest) (*d
|
||||
|
||||
// 阈值字段只由超级管理员与平台账号配置:非平台账号提交即整体拒绝,不落任何配置。
|
||||
if req.HasTrafficThresholdFields() && !canManageThreshold(ctx) {
|
||||
s.recordDenied(ctx, constants.AuditOperationCarrierCreate, "拒绝非平台账号配置运营商通道流量阈值",
|
||||
s.recordDenied(ctx, constants.AuditOperationCarrierCreate, "拒绝非平台账号配置运营商通道流量阈值或实名管控",
|
||||
thresholdCreateProbe(req), errors.CodeForbidden)
|
||||
return nil, errors.New(errors.CodeForbidden, constants.PlatformManagementForbiddenMessage)
|
||||
}
|
||||
@@ -92,6 +93,9 @@ func (s *Service) Create(ctx context.Context, req *dto.CreateCarrierRequest) (*d
|
||||
TrafficThresholdValue: thresholdValue,
|
||||
TrafficThresholdUnit: thresholdUnit,
|
||||
}
|
||||
if req.RealnameControlEnabled != nil {
|
||||
carrier.RealnameControlEnabled = *req.RealnameControlEnabled
|
||||
}
|
||||
if req.DataResetDay != nil {
|
||||
carrier.DataResetDay = *req.DataResetDay
|
||||
}
|
||||
@@ -145,7 +149,7 @@ func (s *Service) Update(ctx context.Context, id uint, req *dto.UpdateCarrierReq
|
||||
|
||||
// 阈值字段只由超级管理员与平台账号修改:非平台账号提交即整体拒绝。
|
||||
if req.HasTrafficThresholdFields() && !canManageThreshold(ctx) {
|
||||
s.recordDenied(ctx, constants.AuditOperationCarrierUpdate, "拒绝非平台账号配置运营商通道流量阈值",
|
||||
s.recordDenied(ctx, constants.AuditOperationCarrierUpdate, "拒绝非平台账号配置运营商通道流量阈值或实名管控",
|
||||
&before, errors.CodeForbidden)
|
||||
return nil, errors.New(errors.CodeForbidden, constants.PlatformManagementForbiddenMessage)
|
||||
}
|
||||
@@ -168,6 +172,12 @@ func (s *Service) Update(ctx context.Context, id uint, req *dto.UpdateCarrierReq
|
||||
carrier.TrafficThresholdEnabled = thresholdEnabled
|
||||
carrier.TrafficThresholdValue = thresholdValue
|
||||
carrier.TrafficThresholdUnit = thresholdUnit
|
||||
if req.RealnameControlEnabled != nil {
|
||||
if err := s.confirmRealnameControl(ctx, &before, *req.RealnameControlEnabled, req.RealnameControlConfirm); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
carrier.RealnameControlEnabled = *req.RealnameControlEnabled
|
||||
}
|
||||
|
||||
if req.CarrierName != nil {
|
||||
carrier.CarrierName = *req.CarrierName
|
||||
@@ -375,9 +385,31 @@ func carrierAuditSnapshot(carrier *model.Carrier) map[string]any {
|
||||
"traffic_threshold_enabled": carrier.TrafficThresholdEnabled,
|
||||
"traffic_threshold_value": carrier.TrafficThresholdValue,
|
||||
"traffic_threshold_unit": carrier.TrafficThresholdUnit,
|
||||
// 通道实名管控的修改同样并入运营商更新审计。
|
||||
"realname_control_enabled": carrier.RealnameControlEnabled,
|
||||
}
|
||||
}
|
||||
|
||||
// confirmRealnameControl 在把通道实名管控从 0 改为 1 时要求显式确认:
|
||||
// 未确认时返回该通道未实名开机卡数,提示这些卡会在下一次评估时被停机,本次不保存。
|
||||
func (s *Service) confirmRealnameControl(ctx context.Context, before *model.Carrier, next int, confirm *bool) error {
|
||||
if before.RealnameControlEnabled == next || next != constants.StatusEnabled {
|
||||
return nil
|
||||
}
|
||||
if confirm != nil && *confirm {
|
||||
return nil
|
||||
}
|
||||
var count int64
|
||||
if err := s.carrierStore.DB().WithContext(ctx).Model(&model.IotCard{}).
|
||||
Where("carrier_id = ? AND real_name_status <> ? AND network_status = ?",
|
||||
before.ID, constants.RealNameStatusVerified, constants.NetworkStatusOnline).
|
||||
Count(&count).Error; err != nil {
|
||||
return errors.Wrap(errors.CodeDatabaseError, err, "统计通道未实名开机卡数失败")
|
||||
}
|
||||
return errors.New(errors.CodeInvalidParam, fmt.Sprintf(
|
||||
"开启实名管控后,该通道 %d 张未实名的开机卡会在下一次评估时被停机;确认后请携带 realname_control_confirm=true 重新提交", count))
|
||||
}
|
||||
|
||||
// canManageThreshold 判断当前账号是否具备通道流量阈值字段的读写权限。
|
||||
// 只有超级管理员与平台账号可见可写,与 requirePlatformManagement 的判定一致(引用同一用户类型枚举)。
|
||||
func canManageThreshold(ctx context.Context) bool {
|
||||
@@ -438,6 +470,8 @@ func (s *Service) toResponse(ctx context.Context, c *model.Carrier) *dto.Carrier
|
||||
}
|
||||
enabled := c.TrafficThresholdEnabled
|
||||
result.TrafficThresholdEnabled = &enabled
|
||||
realnameControl := c.RealnameControlEnabled
|
||||
result.RealnameControlEnabled = &realnameControl
|
||||
result.TrafficThresholdValue = c.TrafficThresholdValue
|
||||
if c.TrafficThresholdUnit != "" {
|
||||
unit := c.TrafficThresholdUnit
|
||||
|
||||
@@ -107,12 +107,23 @@ func (s *StopResumeService) ChannelThresholdResumeReady(ctx context.Context, car
|
||||
if err != nil {
|
||||
return false, "", errors.Wrap(errors.CodeDatabaseError, err, "读取通道阈值复机判定卡事实失败")
|
||||
}
|
||||
// 其他停机锁:风险网关扩展(风险停机/销户)或非通道阈值的停因。
|
||||
if isRiskGatewayExtend(card.GatewayExtend) {
|
||||
return false, "网关扩展状态为风险停机或已销户,不自动复机", nil
|
||||
}
|
||||
if card.StopReason != "" && card.StopReason != constants.StopReasonChannelThreshold {
|
||||
return false, "存在其他停机原因,不自动复机", nil
|
||||
if unifiedStopResumeEnabled() {
|
||||
// 总开关开启时不看其他停因与网关扩展状态,卡或所在设备暂停轮询时只解锁不复机。
|
||||
suspended, suspendErr := s.autoControlSuspended(ctx, card)
|
||||
if suspendErr != nil {
|
||||
return false, "", suspendErr
|
||||
}
|
||||
if suspended {
|
||||
return false, "卡或所在设备已暂停轮询,不自动复机", nil
|
||||
}
|
||||
} else {
|
||||
// 其他停机锁:风险网关扩展(风险停机/销户)或非通道阈值的停因。
|
||||
if isRiskGatewayExtend(card.GatewayExtend) {
|
||||
return false, "网关扩展状态为风险停机或已销户,不自动复机", nil
|
||||
}
|
||||
if card.StopReason != "" && card.StopReason != constants.StopReasonChannelThreshold {
|
||||
return false, "存在其他停机原因,不自动复机", nil
|
||||
}
|
||||
}
|
||||
hasPackage, err := s.hasValidPackage(ctx, card)
|
||||
if err != nil {
|
||||
|
||||
@@ -34,6 +34,8 @@ type StopResumeServiceInterface interface {
|
||||
ForceStopCard(ctx context.Context, card *model.IotCard, stopReason string) error
|
||||
// ForceStartCard 强制复机单张卡,不执行正常复机条件判断。
|
||||
ForceStartCard(ctx context.Context, card *model.IotCard) error
|
||||
// ProtectCheckSkipsForRealname 判定保护期一致性检查是否因实名跳过该卡。
|
||||
ProtectCheckSkipsForRealname(ctx context.Context, card *model.IotCard) (bool, error)
|
||||
}
|
||||
|
||||
// 编译时验证 StopResumeService 实现了 StopResumeServiceInterface
|
||||
@@ -109,6 +111,14 @@ func (s *StopResumeService) SetPollingCallback(callback PollingCallback) {
|
||||
// 根据卡的当前网络状态,自动判断并执行停机或复机操作
|
||||
// 设备/单卡维度通过 card.IsStandalone 推导(false 则为设备维度,停/复机覆盖设备下所有卡)
|
||||
func (s *StopResumeService) EvaluateAndAct(ctx context.Context, card *model.IotCard) error {
|
||||
// 总开关开启时,卡或所在设备暂停轮询的不自动停复机。
|
||||
suspended, err := s.autoControlSuspended(ctx, card)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if suspended {
|
||||
return nil
|
||||
}
|
||||
switch card.NetworkStatus {
|
||||
case constants.NetworkStatusOnline:
|
||||
// 卡在线,检查是否需要停机
|
||||
@@ -142,8 +152,8 @@ func (s *StopResumeService) EvaluateAndAct(ctx context.Context, card *model.IotC
|
||||
|
||||
case constants.NetworkStatusOffline:
|
||||
// 卡停机,检查是否可以复机
|
||||
// 只处理轮询系统引起的停机原因(手动停机等不自动复机)
|
||||
if !isPollingStopReason(card.StopReason) {
|
||||
// 总开关关闭时只处理轮询系统引起的停机原因(手动停机等不自动复机);开启时不看停机原因
|
||||
if !autoResumableStopReason(card.StopReason) {
|
||||
return nil
|
||||
}
|
||||
shouldResume, err := s.shouldResume(ctx, card)
|
||||
@@ -318,6 +328,10 @@ func (s *StopResumeService) isTrafficExhausted(ctx context.Context, card *model.
|
||||
// isRealnameOK 检查卡是否满足实名要求
|
||||
// 行业卡、已实名卡直接放行;其他卡按有效设备或自身的无需实名策略判断。
|
||||
func (s *StopResumeService) isRealnameOK(ctx context.Context, card *model.IotCard) (bool, error) {
|
||||
// 总开关开启时实名只按卡所属通道的实名管控判断,不区分行业卡、不看卡或设备实名策略。
|
||||
if unifiedStopResumeEnabled() {
|
||||
return s.unifiedRealnameOK(ctx, card)
|
||||
}
|
||||
if card.CardCategory == constants.CardCategoryIndustry || card.RealNameStatus == constants.RealNameStatusVerified {
|
||||
return true, nil
|
||||
}
|
||||
@@ -420,6 +434,13 @@ func (s *StopResumeService) stopDeviceCards(ctx context.Context, deviceID uint,
|
||||
|
||||
var cardErrors []error
|
||||
for _, card := range cards {
|
||||
// 总开关开启时,暂停轮询的卡不随设备自动停机。
|
||||
if suspended, suspendErr := s.autoControlSuspended(ctx, card); suspendErr != nil {
|
||||
cardErrors = append(cardErrors, suspendErr)
|
||||
continue
|
||||
} else if suspended {
|
||||
continue
|
||||
}
|
||||
if _, stopErr := s.stopCardWithRetry(ctx, card, stopReason); stopErr != nil {
|
||||
cardErrors = append(cardErrors, stopErr)
|
||||
s.logger.Warn("设备卡停机失败,继续处理其他卡",
|
||||
@@ -450,8 +471,14 @@ func (s *StopResumeService) resumeDeviceCards(ctx context.Context, deviceID uint
|
||||
}
|
||||
defer s.redis.Del(ctx, lockKey)
|
||||
|
||||
// 查询设备下因轮询原因停机的卡
|
||||
cards, err := s.iotCardStore.ListByDeviceIDAndPollingStopReasons(ctx, deviceID)
|
||||
// 查询设备下待复机的卡:总开关关闭时只取因轮询原因停机的卡,开启时取全部停机卡(不看停机原因)
|
||||
var cards []*model.IotCard
|
||||
var err error
|
||||
if unifiedStopResumeEnabled() {
|
||||
cards, err = s.iotCardStore.ListByDeviceIDAndNetworkStatus(ctx, deviceID, constants.NetworkStatusOffline)
|
||||
} else {
|
||||
cards, err = s.iotCardStore.ListByDeviceIDAndPollingStopReasons(ctx, deviceID)
|
||||
}
|
||||
if err != nil {
|
||||
s.logger.Error("查询设备停机卡失败",
|
||||
zap.Uint("device_id", deviceID), zap.Error(err))
|
||||
@@ -569,6 +596,15 @@ func (s *StopResumeService) resumeSingleCard(ctx context.Context, cardID uint) e
|
||||
|
||||
actionCode, summary := constants.AuditActionIotCardAutoStarted, "自动恢复 IoT 卡网络"
|
||||
|
||||
// 总开关开启时,卡或所在设备暂停轮询的不自动复机(含套餐激活、重置、充值等非轮询触发)。
|
||||
suspended, suspendErr := s.autoControlSuspended(ctx, card)
|
||||
if suspendErr != nil {
|
||||
return suspendErr
|
||||
}
|
||||
if suspended {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 持通道阈值锁:周期内拒绝一切复机,记录拒绝事实并保留锁。
|
||||
// 该入口被轮询评估、套餐激活/重置与设备维度复机复用,返回 nil 表示本次不动作,
|
||||
// 避免让自动链路按失败重试;用户可见入口由 ManualStartCard/ForceStartCard 返回拒绝错误。
|
||||
@@ -587,8 +623,8 @@ func (s *StopResumeService) resumeSingleCard(ctx context.Context, cardID uint) e
|
||||
return nil
|
||||
}
|
||||
|
||||
// 只处理轮询系统引起的停机
|
||||
if !isPollingStopReason(card.StopReason) {
|
||||
// 总开关关闭时只处理轮询系统引起的停机;开启时不看停机原因
|
||||
if !autoResumableStopReason(card.StopReason) {
|
||||
s.logger.Debug("卡非轮询停机原因,不自动复机",
|
||||
zap.Uint("card_id", cardID),
|
||||
zap.String("stop_reason", card.StopReason))
|
||||
|
||||
98
internal/service/iot_card/stop_resume_unified.go
Normal file
98
internal/service/iot_card/stop_resume_unified.go
Normal file
@@ -0,0 +1,98 @@
|
||||
package iot_card
|
||||
|
||||
import (
|
||||
"context"
|
||||
stderrors "errors"
|
||||
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/config"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/constants"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
)
|
||||
|
||||
// realnameControlEnabled 是通道实名管控开启时的取值。
|
||||
const realnameControlEnabled = 1
|
||||
|
||||
// unifiedStopResumeEnabled 判定停复机新规则总开关是否开启。
|
||||
//
|
||||
// 开启后:复机不看停机原因;实名按卡所属通道的实名管控判断(不区分行业卡、不看卡/设备实名策略);
|
||||
// 卡或所在设备暂停轮询时不自动停复机。关闭时全部停复机路径与原有行为一致。
|
||||
func unifiedStopResumeEnabled() bool {
|
||||
cfg := config.Get()
|
||||
return cfg != nil && cfg.StopResume.UnifiedRuleEnabled
|
||||
}
|
||||
|
||||
// autoResumableStopReason 判定该停因的停机卡能否进入自动复机判断:总开关开启时不看停因,
|
||||
// 关闭时只处理轮询系统引起的停机。
|
||||
func autoResumableStopReason(reason string) bool {
|
||||
return unifiedStopResumeEnabled() || isPollingStopReason(reason)
|
||||
}
|
||||
|
||||
// autoControlSuspended 判定总开关开启时该卡是否因暂停轮询而不自动停复机:卡自身或其有效绑定设备暂停轮询。
|
||||
// 总开关关闭时恒为 false。
|
||||
func (s *StopResumeService) autoControlSuspended(ctx context.Context, card *model.IotCard) (bool, error) {
|
||||
if !unifiedStopResumeEnabled() || card == nil {
|
||||
return false, nil
|
||||
}
|
||||
if !card.EnablePolling {
|
||||
return true, nil
|
||||
}
|
||||
deviceID, bound, err := s.getCardDeviceID(ctx, card)
|
||||
if err != nil {
|
||||
return false, errors.Wrap(errors.CodeDatabaseError, err, "查询卡绑定设备失败")
|
||||
}
|
||||
if !bound {
|
||||
return false, nil
|
||||
}
|
||||
var device model.Device
|
||||
if err := s.db.WithContext(ctx).Select("id", "enable_polling").First(&device, deviceID).Error; err != nil {
|
||||
if stderrors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return false, nil
|
||||
}
|
||||
return false, errors.Wrap(errors.CodeDatabaseError, err, "查询设备轮询状态失败")
|
||||
}
|
||||
return !device.EnablePolling, nil
|
||||
}
|
||||
|
||||
// channelRealnameControlled 查询卡所属通道是否开启实名管控。
|
||||
func (s *StopResumeService) channelRealnameControlled(ctx context.Context, card *model.IotCard) (bool, error) {
|
||||
var values []int
|
||||
if err := s.db.WithContext(ctx).Model(&model.Carrier{}).
|
||||
Where("id = ?", card.CarrierID).Limit(1).Pluck("realname_control_enabled", &values).Error; err != nil {
|
||||
return false, errors.Wrap(errors.CodeDatabaseError, err, "查询通道实名管控失败")
|
||||
}
|
||||
if len(values) == 0 {
|
||||
return false, errors.New(errors.CodeNotFound, "卡所属运营商通道不存在,无法判断实名管控")
|
||||
}
|
||||
return values[0] == realnameControlEnabled, nil
|
||||
}
|
||||
|
||||
// unifiedRealnameOK 是总开关开启后的实名门槛:通道未开启实名管控即满足;开启时只看卡是否已实名。
|
||||
func (s *StopResumeService) unifiedRealnameOK(ctx context.Context, card *model.IotCard) (bool, error) {
|
||||
controlled, err := s.channelRealnameControlled(ctx, card)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if !controlled {
|
||||
return true, nil
|
||||
}
|
||||
return card.RealNameStatus == constants.RealNameStatusVerified, nil
|
||||
}
|
||||
|
||||
// ProtectCheckSkipsForRealname 判定保护期一致性检查是否因实名跳过该卡。
|
||||
// 总开关关闭时与原有行为一致(未实名即跳过);开启时只在通道开启实名管控且卡未实名时跳过。
|
||||
func (s *StopResumeService) ProtectCheckSkipsForRealname(ctx context.Context, card *model.IotCard) (bool, error) {
|
||||
if card.RealNameStatus == constants.RealNameStatusVerified {
|
||||
return false, nil
|
||||
}
|
||||
if !unifiedStopResumeEnabled() {
|
||||
return true, nil
|
||||
}
|
||||
controlled, err := s.channelRealnameControlled(ctx, card)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
return controlled, nil
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
cardflow "github.com/break/junhong_cmp_fiber/internal/domain/cardflow"
|
||||
"github.com/break/junhong_cmp_fiber/internal/store/postgres"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/constants"
|
||||
"github.com/redis/go-redis/v9"
|
||||
@@ -20,10 +21,46 @@ type DailyUsageItem struct {
|
||||
}
|
||||
|
||||
// QueryService 流量查询服务
|
||||
// 合并 Redis(当天实时)和 DB(历史落盘)两段数据源
|
||||
// 未切换日快照算法的卡合并 Redis(当天实时)和 DB(历史落盘)两段数据源;已切换的卡读日流量快照。
|
||||
type QueryService struct {
|
||||
redis *redis.Client
|
||||
cardDailyUsageStore *postgres.CardDailyUsageStore
|
||||
switched func(cardID uint) bool
|
||||
flowDays *postgres.CardFlowDayStore
|
||||
}
|
||||
|
||||
// WithFlowSnapshots 注入日快照数据源:switched 判定卡是否已切换日快照算法,已切换的卡改读快照。
|
||||
func (s *QueryService) WithFlowSnapshots(switched func(cardID uint) bool, flowDays *postgres.CardFlowDayStore) *QueryService {
|
||||
s.switched = switched
|
||||
s.flowDays = flowDays
|
||||
return s
|
||||
}
|
||||
|
||||
// dailyUsageFromSnapshots 按快照计算每天用量:当天最大快照 − 本月此前最大快照,小于 0 按 0,跨月重新累计。
|
||||
func (s *QueryService) dailyUsageFromSnapshots(ctx context.Context, cardID uint, startDate, endDate time.Time) ([]*DailyUsageItem, error) {
|
||||
start := cardflow.ShanghaiDate(startDate)
|
||||
end := cardflow.ShanghaiDate(endDate)
|
||||
rows, err := s.flowDays.ListBetween(ctx, cardID, cardflow.MonthStart(start), end)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items := make([]*DailyUsageItem, 0, len(rows))
|
||||
var month string
|
||||
var priorMax float64
|
||||
for _, row := range rows {
|
||||
date := row.FlowDate.Format("2006-01-02")
|
||||
if rowMonth := date[:7]; rowMonth != month {
|
||||
month, priorMax = rowMonth, 0
|
||||
}
|
||||
usage := cardflow.DailyUsage(row.MonthUsedMB, priorMax)
|
||||
if row.MonthUsedMB > priorMax {
|
||||
priorMax = row.MonthUsedMB
|
||||
}
|
||||
if date >= start.Format("2006-01-02") {
|
||||
items = append(items, &DailyUsageItem{Date: date, UsageMB: usage})
|
||||
}
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
// NewQueryService 创建流量查询服务实例
|
||||
@@ -37,6 +74,9 @@ func NewQueryService(redisClient *redis.Client, cardDailyUsageStore *postgres.Ca
|
||||
// GetDailyUsage 查询卡在指定日期范围内的日粒度流量
|
||||
// 今天的数据从 Redis 缓冲读取(可能尚未落盘),历史数据从 DB 读取,合并后按日期 ASC 排序返回
|
||||
func (s *QueryService) GetDailyUsage(ctx context.Context, cardID uint, startDate, endDate time.Time) ([]*DailyUsageItem, error) {
|
||||
if s.switched != nil && s.flowDays != nil && s.switched(cardID) {
|
||||
return s.dailyUsageFromSnapshots(ctx, cardID, startDate, endDate)
|
||||
}
|
||||
now := time.Now()
|
||||
todayStr := now.Format("2006-01-02")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user