作者 tangxuhui

结构调整

package controllers
import (
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/dictionary/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/dictionary/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/dictionary/service"
)
type DictionaryController struct {
beego.BaseController
baseController
}
func (controller *DictionaryController) returnPageListData(count int64, data interface{}, err error, pageNumber int) {
... ...
package controllers
import (
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/noticePersonal/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/noticePersonal/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-basic/pkg/application/noticePersonal/service"
)
type NoticePersonalController struct {
beego.BaseController
baseController
}
func (controller *NoticePersonalController) GetNoticePersonalList() {
... ...
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)
}
... ...
package controllers
import (
"github.com/linmadan/egglib-go/web/beego"
"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"
... ... @@ -9,13 +8,17 @@ import (
)
type SystemSettingController struct {
beego.BaseController
baseController
}
func (controller *SystemSettingController) UpdateSystemSetting() {
systemSettingService := service.NewSystemSettingService(nil)
updateSystemSettingCommand := &command.UpdateSystemSettingCommand{}
controller.Unmarshal(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)
}
... ... @@ -27,6 +30,7 @@ func (controller *SystemSettingController) GetSystemSetting() {
if err != nil {
log.Logger.Debug(err.Error())
}
// getSystemSettingQuery.CompanyId = controller.GetCompanyId()
data, err := systemSettingService.GetSystemSetting(getSystemSettingQuery)
controller.Response(data, err)
}
... ... @@ -34,6 +38,7 @@ func (controller *SystemSettingController) GetSystemSetting() {
func (controller *SystemSettingController) ListSystemSetting() {
systemSettingService := service.NewSystemSettingService(nil)
listSystemSettingQuery := &query.ListSystemSettingQuery{}
// listSystemSettingQuery.CompanyId = controller.GetCompanyId()
data, err := systemSettingService.ListSystemSetting(listSystemSettingQuery)
controller.Response(data, err)
}
... ...