fix: Rock Token 超时按满 2/3 天判定并统一显示口径
This commit is contained in:
@@ -572,8 +572,9 @@ func (s *RockService) ListTokens(ctx context.Context, page, pageSize int, status
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
warnDays, _, boundWarnDays := rockOverdueThresholds(cfg)
|
||||
db := applyRockTokenListFilters(s.db.WithContext(ctx).Model(&model.RockToken{}), status, search, time.Now(), warnDays, boundWarnDays)
|
||||
warnDays, dangerDays, boundWarnDays := rockOverdueThresholds(cfg)
|
||||
now := time.Now()
|
||||
db := applyRockTokenListFilters(s.db.WithContext(ctx).Model(&model.RockToken{}), status, search, now, warnDays, boundWarnDays)
|
||||
|
||||
var total int64
|
||||
if err := db.Count(&total).Error; err != nil {
|
||||
@@ -589,6 +590,7 @@ func (s *RockService) ListTokens(ctx context.Context, page, pageSize int, status
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
applyRockTokenOverdueFlags(tokens, now, warnDays, dangerDays, boundWarnDays)
|
||||
s.prepareRockTokenList(ctx, tokens)
|
||||
|
||||
return tokens, total, nil
|
||||
|
||||
Reference in New Issue
Block a user