...
|
...
|
@@ -55,16 +55,16 @@ func (noticeSettingService *NoticeSettingService) GetNoticeSetting(getNoticeSett |
|
|
}
|
|
|
|
|
|
// 返回编排消息通知内容列表
|
|
|
func (noticeSettingService *NoticeSettingService) ListNoticeSetting(listNoticeSettingQuery *query.ListNoticeSettingQuery) (interface{}, error) {
|
|
|
func (noticeSettingService *NoticeSettingService) ListNoticeSetting(listNoticeSettingQuery *query.ListNoticeSettingQuery) (int64, interface{}, error) {
|
|
|
if err := listNoticeSettingQuery.ValidateQuery(); err != nil {
|
|
|
return nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
|
|
|
}
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
transactionContext.RollbackTransaction()
|
...
|
...
|
@@ -73,7 +73,7 @@ func (noticeSettingService *NoticeSettingService) ListNoticeSetting(listNoticeSe |
|
|
if value, err := factory.CreateNoticeSettingRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
}); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
return 0, nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
noticeSettingRepository = value
|
|
|
}
|
...
|
...
|
@@ -87,15 +87,14 @@ func (noticeSettingService *NoticeSettingService) ListNoticeSetting(listNoticeSe |
|
|
queryOption["orgId"] = listNoticeSettingQuery.OrgId
|
|
|
}
|
|
|
if count, noticeSettings, err := noticeSettingRepository.Find(queryOption); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
return 0, nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
} else {
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
return map[string]interface{}{
|
|
|
"count": count,
|
|
|
"noticeSettings": noticeSettings,
|
|
|
}, nil
|
|
|
return count,
|
|
|
noticeSettings,
|
|
|
nil
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|