|
@@ -128,6 +128,7 @@ func (noticeSettingService *NoticeSettingService) UpdateNoticeSetting(updateNoti |
|
@@ -128,6 +128,7 @@ func (noticeSettingService *NoticeSettingService) UpdateNoticeSetting(updateNoti |
128
|
} else {
|
128
|
} else {
|
129
|
noticeSettingRepository = value
|
129
|
noticeSettingRepository = value
|
130
|
}
|
130
|
}
|
|
|
131
|
+
|
131
|
var (
|
132
|
var (
|
132
|
noticeSettings []*domain.NoticeSetting
|
133
|
noticeSettings []*domain.NoticeSetting
|
133
|
noticeSetting *domain.NoticeSetting
|
134
|
noticeSetting *domain.NoticeSetting
|
|
@@ -158,10 +159,22 @@ func (noticeSettingService *NoticeSettingService) UpdateNoticeSetting(updateNoti |
|
@@ -158,10 +159,22 @@ func (noticeSettingService *NoticeSettingService) UpdateNoticeSetting(updateNoti |
158
|
if err != nil {
|
159
|
if err != nil {
|
159
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
160
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
160
|
}
|
161
|
}
|
|
|
162
|
+ moduleAction, err := domain.GetNoticeModuleAction(updateNoticeSettingCommand.Module, updateNoticeSettingCommand.ModuleAction)
|
|
|
163
|
+ if err != nil {
|
|
|
164
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
165
|
+ }
|
|
|
166
|
+ module, err := domain.GetNoticeModule(updateNoticeSettingCommand.Module)
|
|
|
167
|
+ if err != nil {
|
|
|
168
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
169
|
+ }
|
161
|
err = noticeSetting.Update(map[string]interface{}{
|
170
|
err = noticeSetting.Update(map[string]interface{}{
|
162
|
- "content": updateNoticeSettingCommand.Content,
|
|
|
163
|
- "isPush": updateNoticeSettingCommand.IsPush,
|
|
|
164
|
- "updatedAt": time.Now(),
|
171
|
+ "module": module.ModuleCode,
|
|
|
172
|
+ "moduleName": module.ModuleName,
|
|
|
173
|
+ "moduleAction": moduleAction.ActionCode,
|
|
|
174
|
+ "moduleActionName": moduleAction.ActionName,
|
|
|
175
|
+ "content": updateNoticeSettingCommand.Content,
|
|
|
176
|
+ "isPush": updateNoticeSettingCommand.IsPush,
|
|
|
177
|
+ "updatedAt": time.Now(),
|
165
|
})
|
178
|
})
|
166
|
if err != nil {
|
179
|
if err != nil {
|
167
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|
180
|
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
|