...
|
...
|
@@ -5,6 +5,7 @@ import ( |
|
|
|
|
|
"github.com/linmadan/egglib-go/core/application"
|
|
|
"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/dto"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/noticesetting/query"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_basic"
|
|
|
)
|
...
|
...
|
@@ -29,8 +30,20 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin |
|
|
if err != nil {
|
|
|
return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
return result.Count, result.NoticeSettings, nil
|
|
|
dataList := []dto.NoticeSettingItem{}
|
|
|
for _, v := range result.List {
|
|
|
item := dto.NoticeSettingItem{
|
|
|
CompanyID: v.CompanyID,
|
|
|
Content: v.Content,
|
|
|
IsPush: v.IsPush,
|
|
|
Module: v.Module,
|
|
|
ModuleAction: v.ModuleAction,
|
|
|
NoticeSettingID: v.NoticeSettingID,
|
|
|
OrgID: v.OrgID,
|
|
|
}
|
|
|
dataList = append(dataList, item)
|
|
|
}
|
|
|
return result.Count, dataList, nil
|
|
|
}
|
|
|
|
|
|
//NoticeSettingProfile 推送消息配置需求的参数候选项
|
...
|
...
|
@@ -62,7 +75,7 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingUpdate(noticeSett |
|
|
IsPush: noticeSettingUpdateCommand.IsPush,
|
|
|
Module: noticeSettingUpdateCommand.Module,
|
|
|
ModuleAction: noticeSettingUpdateCommand.ModuleAction,
|
|
|
OrganizationID: int(noticeSettingUpdateCommand.Operator.OrgId),
|
|
|
OrgId: int(noticeSettingUpdateCommand.Operator.OrgId),
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
...
|
...
|
@@ -84,13 +97,13 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingAdd(noticeSetting |
|
|
IsPush: noticeSettingAddCommand.IsPush,
|
|
|
Module: noticeSettingAddCommand.Module,
|
|
|
ModuleAction: noticeSettingAddCommand.ModuleAction,
|
|
|
OrganizationID: int(noticeSettingAddCommand.Operator.OrgId),
|
|
|
OrgId: int(noticeSettingAddCommand.Operator.OrgId),
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
data := struct {
|
|
|
NoticeSettingId int `json:"noticeSettingId"`
|
|
|
NoticeSettingId int `json:"noticeSettingId,string"`
|
|
|
command.NoticeSettingAddCommand
|
|
|
}{
|
|
|
NoticeSettingId: result.NoticeSettingID,
|
...
|
...
|
@@ -115,7 +128,16 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingGet(noticeSetting |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
|
|
}
|
|
|
return result, nil
|
|
|
data := dto.NoticeSettingItem{
|
|
|
CompanyID: result.CompanyID,
|
|
|
Content: result.Content,
|
|
|
IsPush: result.IsPush,
|
|
|
Module: result.Module,
|
|
|
ModuleAction: result.ModuleAction,
|
|
|
NoticeSettingID: result.NoticeSettingID,
|
|
|
OrgID: result.OrgID,
|
|
|
}
|
|
|
return data, nil
|
|
|
}
|
|
|
|
|
|
func NewNoticeSettingService(options map[string]interface{}) *NoticeSettingService {
|
...
|
...
|
|