完善租客等级免押与积分管理

This commit is contained in:
yml2213
2026-07-26 18:07:10 +08:00
parent 379536e5c5
commit c594b543d1
24 changed files with 1296 additions and 178 deletions
@@ -4,6 +4,8 @@ import (
"context"
"strconv"
"strings"
"hfb_sys/backend/internal/modules/rentergrowth"
)
func (s *Service) Update(ctx context.Context, actorID uint64, key string, req UpdateRequest, meta AuditMeta) (*ConfigDTO, error) {
@@ -19,5 +21,16 @@ func (s *Service) Update(ctx context.Context, actorID uint64, key string, req Up
return nil, ErrInvalidConfig
}
}
if key == rentergrowth.ConfigKey {
cfg, err := rentergrowth.ParseConfigValue(req.Value)
if err != nil {
return nil, ErrInvalidConfig
}
value, err := rentergrowth.MarshalConfig(cfg)
if err != nil {
return nil, ErrInvalidConfig
}
req.Value = value
}
return s.repo.Update(ctx, actorID, key, req, meta)
}