|
|
package controllers
|
|
|
|
|
|
import (
|
|
|
"github.com/linmadan/egglib-go/web/beego"
|
|
|
"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"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/log"
|
|
|
)
|
|
|
|
|
|
type NoticeSettingController struct {
|
|
|
beego.BaseController
|
|
|
baseController
|
|
|
}
|
|
|
|
|
|
func (controller *NoticeSettingController) UpdateNoticeSetting() {
|
|
|
noticeSettingService := service.NewNoticeSettingService(nil)
|
|
|
updateNoticeSettingCommand := &command.UpdateNoticeSettingCommand{}
|
|
|
controller.Unmarshal(updateNoticeSettingCommand)
|
|
|
err := controller.Unmarshal(updateNoticeSettingCommand)
|
|
|
if err != nil {
|
|
|
log.Logger.Debug(err.Error())
|
|
|
}
|
|
|
Id, _ := controller.GetInt64(":settingId")
|
|
|
updateNoticeSettingCommand.NoticeSettingId = Id
|
|
|
// updateNoticeSettingCommand.CompanyId = controller.GetCompanyId()
|
|
|
data, err := noticeSettingService.UpdateNoticeSetting(updateNoticeSettingCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
@@ -34,7 +38,11 @@ func (controller *NoticeSettingController) GetNoticeSetting() { |
|
|
func (controller *NoticeSettingController) ListNoticeSetting() {
|
|
|
noticeSettingService := service.NewNoticeSettingService(nil)
|
|
|
listNoticeSettingQuery := &query.ListNoticeSettingQuery{}
|
|
|
controller.Unmarshal(listNoticeSettingQuery)
|
|
|
err := controller.Unmarshal(listNoticeSettingQuery)
|
|
|
if err != nil {
|
|
|
log.Logger.Debug(err.Error())
|
|
|
}
|
|
|
// listNoticeSettingQuery.CompanyId = controller.GetCompanyId()
|
|
|
count, listdata, err := noticeSettingService.ListNoticeSetting(listNoticeSettingQuery)
|
|
|
data := map[string]interface{}{
|
|
|
"noticeSettings": listdata,
|
...
|
...
|
@@ -46,7 +54,10 @@ func (controller *NoticeSettingController) ListNoticeSetting() { |
|
|
func (controller *NoticeSettingController) AddNoticeSetting() {
|
|
|
noticeSettingService := service.NewNoticeSettingService(nil)
|
|
|
addNoticeSettingCommand := &command.AddNoticeSettingCommand{}
|
|
|
controller.Unmarshal(addNoticeSettingCommand)
|
|
|
err := controller.Unmarshal(addNoticeSettingCommand)
|
|
|
if err != nil {
|
|
|
log.Logger.Debug(err.Error())
|
|
|
}
|
|
|
data, err := noticeSettingService.AddNoticeSetting(addNoticeSettingCommand)
|
|
|
controller.Response(data, err)
|
|
|
}
|
...
|
...
|
|