This commit is contained in:
2026-08-17 02:12:17 +08:00
parent 560ae46b82
commit 6a05803e08
96 changed files with 2888 additions and 685 deletions
+11 -4
View File
@@ -15,7 +15,7 @@ func NewParameterService(uc *biz.ParameterUsecase) *ParameterService {
}
func parameterDomain(value *dto.SystemParameterRequest) *biz.SystemParameter {
return &biz.SystemParameter{ID: value.ID, Name: value.Name, Key: value.Key, Value: value.Value, Desc: value.Description}
return &biz.SystemParameter{ID: value.ID, CreatedAt: value.CreatedAt, UpdatedAt: value.UpdatedAt, Name: value.Name, Key: value.Key, Value: value.Value, Desc: value.Description}
}
func (s *ParameterService) CreateParameterRequest(ctx context.Context, req *dto.SystemParameterRequest) error {
return s.CreateParameter(ctx, parameterDomain(req))
@@ -40,8 +40,15 @@ func (s *ParameterService) Parameters(ctx context.Context, page, size int, q *bi
}
return out, total, nil
}
func (s *ParameterService) Parameter(ctx context.Context, id uint, key string) (*dto.SystemParameterResponse, error) {
v, err := s.uc.FindParameter(ctx, id, key)
func (s *ParameterService) ParameterByID(ctx context.Context, id string) (*dto.SystemParameterResponse, error) {
v, err := s.uc.FindParameterByID(ctx, id)
if err != nil {
return nil, err
}
return parameterDTO(v), nil
}
func (s *ParameterService) ParameterByKey(ctx context.Context, key string) (*dto.SystemParameterResponse, error) {
v, err := s.uc.FindParameterByKey(ctx, key)
if err != nil {
return nil, err
}
@@ -53,6 +60,6 @@ func (s *ParameterService) CreateParameter(ctx context.Context, v *biz.SystemPar
func (s *ParameterService) UpdateParameter(ctx context.Context, v *biz.SystemParameter) error {
return s.uc.UpdateParameter(ctx, v)
}
func (s *ParameterService) DeleteParameters(ctx context.Context, ids []uint) error {
func (s *ParameterService) DeleteParameters(ctx context.Context, ids []string) error {
return s.uc.DeleteParameters(ctx, ids)
}