service.go
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package service
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/systemsetting/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/systemsetting/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
)
// 用户信息
type SystemSettingService struct {
}
func NewSystemSettingService(options map[string]interface{}) *SystemSettingService {
newUsersService := &SystemSettingService{}
return newUsersService
}
func (srv SystemSettingService) GetSystemSettingList(systemSettingListQuery *query.SettingListQuery) (interface{}, error) {
creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
systemSettingListQuery.Operator,
)
result, err := creationBasicGateway.SystemSettingSearch(allied_creation_basic.ReqSystemSettingSearch{
SettingName: systemSettingListQuery.Key,
})
return result, err
}
func (srv SystemSettingService) GetSystemSetting(systemSettingGetQuery *query.SettingGetQuery) (interface{}, error) {
creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
systemSettingGetQuery.Operator,
)
result, err := creationBasicGateway.SystemSettingGet(allied_creation_basic.ReqSystemSettingGet{
SettingCode: systemSettingGetQuery.SettingCode,
})
return result, err
}
func (srv SystemSettingService) SystemSettingUpdate(systemSettingUpdate *command.SettingUpdateCommand) (interface{}, error) {
creationBasicGateway := allied_creation_basic.NewHttplibAlliedCreationBasic(
systemSettingUpdate.Operator,
)
result, err := creationBasicGateway.SystemSettingUpdate(allied_creation_basic.ReqSystemSettingUpdate{
SettingCode: systemSettingUpdate.SettingCode,
Value: systemSettingUpdate.Value,
CompanyId: systemSettingUpdate.Operator.CompanyId,
})
return result, err
}