notice_setting_controller.go
2.7 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package web_client
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/service"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
)
type NoticeSettingController struct {
baseController
}
func (controller *NoticeSettingController) NoticeSettingList() {
noticeSettingService := service.NewNoticeSettingService(nil)
noticeSettingListQuery := &query.NoticeSettingListQuery{}
err := controller.Unmarshal(noticeSettingListQuery)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
noticeSettingListQuery.Operator = controller.GetOperator()
cnt, data, err := noticeSettingService.NoticeSettingList(noticeSettingListQuery)
controller.returnPageListData(cnt, data, err, noticeSettingListQuery.PageNumber)
}
func (controller *NoticeSettingController) NoticeSettingUpdate() {
noticeSettingService := service.NewNoticeSettingService(nil)
noticeSettingUpdateCommand := &command.NoticeSettingUpdateCommand{}
settingId := controller.GetString(":settingId")
err := controller.Unmarshal(noticeSettingUpdateCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
noticeSettingUpdateCommand.Operator = controller.GetOperator()
noticeSettingUpdateCommand.NoticeSettingId = settingId
data, err := noticeSettingService.NoticeSettingUpdate(noticeSettingUpdateCommand)
controller.Response(data, err)
}
func (controller *NoticeSettingController) NoticeSettingAdd() {
noticeSettingService := service.NewNoticeSettingService(nil)
noticeSettingAddCommand := &command.NoticeSettingAddCommand{}
err := controller.Unmarshal(noticeSettingAddCommand)
if err != nil {
log.Logger.Debug("json err:" + err.Error())
}
noticeSettingAddCommand.Operator = controller.GetOperator()
data, err := noticeSettingService.NoticeSettingAdd(noticeSettingAddCommand)
controller.Response(data, err)
}
func (controller *NoticeSettingController) NoticeSettingProfile() {
noticeSettingService := service.NewNoticeSettingService(nil)
p := &query.NoticeSettingProfileQuery{
Operator: controller.GetOperator(),
}
data, err := noticeSettingService.NoticeSettingProfile(p)
controller.Response(data, err)
}
func (controller *NoticeSettingController) NoticeSettingGet() {
noticeSettingService := service.NewNoticeSettingService(nil)
queryParm := &query.NoticeSettingGetQuery{
Operator: controller.GetOperator(),
}
settingId := controller.GetString(":settingId")
queryParm.NoticeSettingId = settingId
data, err := noticeSettingService.NoticeSettingGet(queryParm)
controller.Response(data, err)
}