diff --git a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java index 8385289..9f7894e 100644 --- a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java +++ b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java @@ -41,6 +41,7 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers(HttpMethod.POST, "/insertFirePointChannelPrecise").permitAll() .antMatchers(HttpMethod.GET, "/queryFirePointBroadcast").permitAll() .antMatchers(HttpMethod.POST, "/api/user/updateSysUser").permitAll() + .antMatchers(HttpMethod.GET, "/queryNotice").permitAll()//查询通知 .antMatchers(HttpMethod.GET, "/selectGlobalConfigDict").permitAll() .antMatchers(HttpMethod.GET, "/selectGlobalConfigValue").permitAll() .antMatchers(HttpMethod.GET, "/selectGlobalConfig").permitAll() diff --git a/src/main/java/com/xkrs/straw/controller/NoticeController.java b/src/main/java/com/xkrs/straw/controller/NoticeController.java index 733618e..8d11d81 100644 --- a/src/main/java/com/xkrs/straw/controller/NoticeController.java +++ b/src/main/java/com/xkrs/straw/controller/NoticeController.java @@ -36,12 +36,20 @@ public class NoticeController { return noticeService.updateNotice(token, updateQo); } +// /** +// * 查询通知 +// */ +// @GetMapping("/queryNotice") +// public String queryNotice(@RequestHeader(value = "Authorization") String token) { +// return noticeService.queryNotice(token); +// } + /** * 查询通知 */ @GetMapping("/queryNotice") - public String queryNotice(@RequestHeader(value = "Authorization") String token) { - return noticeService.queryNotice(token); + public String queryNotice() { + return noticeService.queryNotice(); } /** diff --git a/src/main/java/com/xkrs/straw/service/NoticeService.java b/src/main/java/com/xkrs/straw/service/NoticeService.java index 762a34e..bb94667 100644 --- a/src/main/java/com/xkrs/straw/service/NoticeService.java +++ b/src/main/java/com/xkrs/straw/service/NoticeService.java @@ -27,6 +27,11 @@ public interface NoticeService { */ String queryNotice(String token); + /** + * 查询通知 + */ + String queryNotice(); + /** * 已读通知 */ diff --git a/src/main/java/com/xkrs/straw/service/impl/NoticeServiceImpl.java b/src/main/java/com/xkrs/straw/service/impl/NoticeServiceImpl.java index fa5b690..fa0cfd7 100644 --- a/src/main/java/com/xkrs/straw/service/impl/NoticeServiceImpl.java +++ b/src/main/java/com/xkrs/straw/service/impl/NoticeServiceImpl.java @@ -169,6 +169,18 @@ public class NoticeServiceImpl implements NoticeService { return outputEncapsulationObject(PromptMessageEnum.SUCCESS, resultList, locale); } + /** + * 查询通知 + */ + @Override + public String queryNotice() { + List noticeList = noticeDao.findAll(Sort.by(Sort.Direction.DESC, "id")); + if (noticeList.size() > 0) { + return outputEncapsulationObject(PromptMessageEnum.SUCCESS, noticeList.get(0), locale); + } + return outputEncapsulationObject(PromptMessageEnum.SUCCESS, null, locale); + } + /** * 已读通知 */