作者 tangxuhui

数据结构调整

{"D:\\workspaceGo\\src\\allied-creation-basic\\pkg\\port\\beego":1629096718570970200}
\ No newline at end of file
{"D:\\workspaceGo\\src\\allied-creation-basic\\pkg\\port\\beego":1629512512589801900}
\ No newline at end of file
... ...
... ... @@ -20,8 +20,6 @@ type AddNoticeSettingCommand struct {
ModuleAction string `json:"moduleAction"`
// 组织id
OrgId int64 `json:"orgId"`
// 消息对应的编码
SysCode string `json:"sysCode"`
}
func (addNoticeSettingCommand *AddNoticeSettingCommand) Valid(v *validation.Validation) {
... ...
... ... @@ -8,7 +8,7 @@ import (
type ListNoticeSettingQuery struct {
// 查询偏离量
PageIndex int `json:"pageIndex" valid:"Required"`
PageIndex int `json:"pageIndex"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
CompanyId int64 `json:"companyId" valid:"Required"`
... ...
... ... @@ -26,8 +26,6 @@ type NoticePersonal struct {
NoticePersonalId int64 `pg:",pk"`
// 组织id
OrgId int64
// 消息对应的编码
SysCode string
// 接收方用户id
UserId int64
... ...
... ... @@ -18,6 +18,7 @@ func TransformToNoticePersonalDomainModelFromPgModels(noticePersonalModel *model
ModuleAction: noticePersonalModel.ModuleAction,
NoticePersonalId: noticePersonalModel.NoticePersonalId,
OrgId: noticePersonalModel.OrgId,
UserBaseId: noticePersonalModel.UserBaseId,
UserId: noticePersonalModel.UserId,
}, nil
}
... ...
package controllers
import (
"log"
"strconv"
"github.com/linmadan/egglib-go/web/beego"
... ... @@ -20,6 +21,7 @@ func (controller *baseController) GetUserId() int64 {
func (controller *baseController) GetCompanyId() int64 {
str := controller.Ctx.Input.Header("companyId")
companyId, _ := strconv.Atoi(str)
log.Println("============>companyId", str)
return int64(companyId)
}
... ...
... ... @@ -45,7 +45,7 @@ func (controller *NoticeSettingController) ListNoticeSetting() {
listNoticeSettingQuery.CompanyId = controller.GetCompanyId()
count, listdata, err := noticeSettingService.ListNoticeSetting(listNoticeSettingQuery)
data := map[string]interface{}{
"noticeSettings": listdata,
"list": listdata,
"count": count,
}
controller.Response(data, err)
... ...
... ... @@ -9,6 +9,6 @@ func init() {
web.Router("/notice-setting/:settingId", &controllers.NoticeSettingController{}, "Put:UpdateNoticeSetting")
web.Router("/notice-setting/:settingId", &controllers.NoticeSettingController{}, "Get:GetNoticeSetting")
web.Router("/notice-setting/search", &controllers.NoticeSettingController{}, "POST:ListNoticeSetting")
web.Router("/notice-setting", &controllers.NoticeSettingController{}, "Post:UpdateNoticeSetting")
web.Router("/notice-setting", &controllers.NoticeSettingController{}, "Post:AddNoticeSetting")
web.Router("/notice-setting/profile/get", &controllers.NoticeSettingController{}, "Get:NoticeSettingProfile")
}
... ...