system_setting_controller.go
1.8 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 controllers
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/systemSetting/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/systemSetting/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/systemSetting/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/log"
)
type SystemSettingController struct {
baseController
}
func (controller *SystemSettingController) UpdateSystemSetting() {
systemSettingService := service.NewSystemSettingService(nil)
updateSystemSettingCommand := &command.UpdateSystemSettingCommand{}
err := controller.Unmarshal(updateSystemSettingCommand)
if err != nil {
log.Logger.Debug(err.Error())
}
updateSystemSettingCommand.CompanyId = controller.GetCompanyId()
data, err := systemSettingService.UpdateSystemSetting(updateSystemSettingCommand)
controller.Response(data, err)
}
func (controller *SystemSettingController) GetSystemSetting() {
systemSettingService := service.NewSystemSettingService(nil)
getSystemSettingQuery := &query.GetSystemSettingQuery{}
err := controller.Unmarshal(getSystemSettingQuery)
if err != nil {
log.Logger.Debug(err.Error())
}
getSystemSettingQuery.CompanyId = controller.GetCompanyId()
data, err := systemSettingService.GetSystemSetting(getSystemSettingQuery)
controller.Response(data, err)
}
func (controller *SystemSettingController) ListSystemSetting() {
systemSettingService := service.NewSystemSettingService(nil)
listSystemSettingQuery := &query.ListSystemSettingQuery{}
err := controller.Unmarshal(listSystemSettingQuery)
if err != nil {
log.Logger.Debug(err.Error())
}
listSystemSettingQuery.CompanyId = controller.GetCompanyId()
data, err := systemSettingService.ListSystemSetting(listSystemSettingQuery)
controller.Response(data, err)
}