5 分钟发布一次
This commit is contained in:
@@ -2,6 +2,8 @@ package systemconfig
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (s *Service) Update(ctx context.Context, actorID uint64, key string, req UpdateRequest, meta AuditMeta) (*ConfigDTO, error) {
|
||||
@@ -11,5 +13,11 @@ func (s *Service) Update(ctx context.Context, actorID uint64, key string, req Up
|
||||
if key == "" || (req.Value == "" && key != "integration.paddle_ocr_token") {
|
||||
return nil, ErrInvalidConfig
|
||||
}
|
||||
if key == "listing.publish_cooldown_minutes" {
|
||||
minutes, err := strconv.Atoi(strings.TrimSpace(req.Value))
|
||||
if err != nil || minutes < 0 {
|
||||
return nil, ErrInvalidConfig
|
||||
}
|
||||
}
|
||||
return s.repo.Update(ctx, actorID, key, req, meta)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user