|
@@ -115,6 +115,28 @@ public class NoticeController extends ControllerSupport {
|
|
|
noticeService.updateNoticeReadStatus(noticeId, user.getUserType(), user.getUserId());
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "获取消息")
|
|
|
+ @GetMapping("{noticeId}")
|
|
|
+ public NoticeDomain getNotice(@PathVariable Long noticeId) {
|
|
|
+ NoticeEntity ni = GlobalHelper.getEntity(noticeRepo, noticeId,
|
|
|
+ NoticeEntity.class);
|
|
|
+ if (ni == null) {
|
|
|
+ throw new StatusException("600001", "该通知已不存在,请刷新后重试");
|
|
|
+ }
|
|
|
+ if (ni.getNoticeStatus() != NoticeStatus.DRAFT) {
|
|
|
+ throw new StatusException("600002", "该通知状态已变更,请刷新后重试");
|
|
|
+ }
|
|
|
+ NoticeDomain domain = new NoticeDomain();
|
|
|
+ domain.setId(ni.getId());
|
|
|
+ domain.setPublisher(ni.getPublisher());
|
|
|
+ domain.setPublishStatus(ni.getNoticeStatus());
|
|
|
+ domain.setPublishTime(ni.getPublishTime());
|
|
|
+ domain.setTitle(ni.getTitle());
|
|
|
+ domain.setContent(ni.getContent());
|
|
|
+ return domain;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private UserNoticeInfoQuery getNoticeInfoQueryFrom(UserNoticeDomainQuery query) {
|
|
|
User user = this.getAccessUser();
|
|
|
UserNoticeInfoQuery noticeQuery = new UserNoticeInfoQuery();
|