...
|
...
|
@@ -5,21 +5,13 @@ import ( |
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/noticeSetting/command"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/noticeSetting/query"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/noticeSetting/service"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/domain"
|
|
|
)
|
|
|
|
|
|
type NoticeSettingController struct {
|
|
|
beego.BaseController
|
|
|
}
|
|
|
|
|
|
func (controller *NoticeSettingController) returnPageListData(count int64, data interface{}, err error, pageNumber int) {
|
|
|
dataMap := map[string]interface{}{
|
|
|
"totalRow": count,
|
|
|
"pageNumber": pageNumber,
|
|
|
"list": data,
|
|
|
}
|
|
|
controller.Response(dataMap, err)
|
|
|
}
|
|
|
|
|
|
func (controller *NoticeSettingController) UpdateNoticeSetting() {
|
|
|
noticeSettingService := service.NewNoticeSettingService(nil)
|
|
|
updateNoticeSettingCommand := &command.UpdateNoticeSettingCommand{}
|
...
|
...
|
@@ -44,7 +36,11 @@ func (controller *NoticeSettingController) ListNoticeSetting() { |
|
|
listNoticeSettingQuery := &query.ListNoticeSettingQuery{}
|
|
|
controller.Unmarshal(listNoticeSettingQuery)
|
|
|
count, listdata, err := noticeSettingService.ListNoticeSetting(listNoticeSettingQuery)
|
|
|
controller.returnPageListData(count, listdata, err, listNoticeSettingQuery.PageIndex)
|
|
|
data := map[string]interface{}{
|
|
|
"noticeSettings": listdata,
|
|
|
"count": count,
|
|
|
}
|
|
|
controller.Response(data, err)
|
|
|
}
|
|
|
|
|
|
func (controller *NoticeSettingController) AddNoticeSetting() {
|
...
|
...
|
@@ -54,3 +50,12 @@ func (controller *NoticeSettingController) AddNoticeSetting() { |
|
|
data, err := noticeSettingService.AddNoticeSetting(addNoticeSettingCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
|
|
|
|
|
func (controller *NoticeSettingController) NoticeSettingProfile() {
|
|
|
data := map[string]interface{}{
|
|
|
"module": domain.GetNoticeModuleList(),
|
|
|
"moduleAction": domain.GetNoticeModuleActionList(),
|
|
|
"paramList": domain.GetNoticeSettingParamList(""),
|
|
|
}
|
|
|
controller.Response(data, nil)
|
|
|
} |
...
|
...
|
|