|
|
@@ -1,6 +1,7 @@
|
|
|
package com.zksy.web.controller.system;
|
|
|
|
|
|
import java.util.List;
|
|
|
+
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
@@ -22,13 +23,12 @@ import com.zksy.system.service.ISysNoticeService;
|
|
|
|
|
|
/**
|
|
|
* 公告 信息操作处理
|
|
|
- *
|
|
|
+ *
|
|
|
* @author zksy
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/system/notice")
|
|
|
-public class SysNoticeController extends BaseController
|
|
|
-{
|
|
|
+public class SysNoticeController extends BaseController {
|
|
|
@Autowired
|
|
|
private ISysNoticeService noticeService;
|
|
|
|
|
|
@@ -37,8 +37,7 @@ public class SysNoticeController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(SysNotice notice)
|
|
|
- {
|
|
|
+ public TableDataInfo list(SysNotice notice) {
|
|
|
startPage();
|
|
|
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
|
|
return getDataTable(list);
|
|
|
@@ -49,8 +48,7 @@ public class SysNoticeController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:query')")
|
|
|
@GetMapping(value = "/{noticeId}")
|
|
|
- public AjaxResult getInfo(@PathVariable Long noticeId)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable Long noticeId) {
|
|
|
return success(noticeService.selectNoticeById(noticeId));
|
|
|
}
|
|
|
|
|
|
@@ -60,8 +58,7 @@ public class SysNoticeController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:add')")
|
|
|
@Log(title = "通知公告", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@Validated @RequestBody SysNotice notice)
|
|
|
- {
|
|
|
+ public AjaxResult add(@Validated @RequestBody SysNotice notice) {
|
|
|
notice.setCreateBy(getUsername());
|
|
|
return toAjax(noticeService.insertNotice(notice));
|
|
|
}
|
|
|
@@ -72,8 +69,7 @@ public class SysNoticeController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
|
|
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@Validated @RequestBody SysNotice notice)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@Validated @RequestBody SysNotice notice) {
|
|
|
notice.setUpdateBy(getUsername());
|
|
|
return toAjax(noticeService.updateNotice(notice));
|
|
|
}
|
|
|
@@ -84,8 +80,31 @@ public class SysNoticeController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('system:notice:remove')")
|
|
|
@Log(title = "通知公告", businessType = BusinessType.DELETE)
|
|
|
@DeleteMapping("/{noticeIds}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] noticeIds)
|
|
|
- {
|
|
|
+ public AjaxResult remove(@PathVariable Long[] noticeIds) {
|
|
|
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取移动端通知公告列表(登录后即可访问)。
|
|
|
+ */
|
|
|
+ @GetMapping("/mobile/list")
|
|
|
+ public TableDataInfo mobileList(SysNotice notice) {
|
|
|
+ notice.setStatus("0");
|
|
|
+ startPage();
|
|
|
+ List<SysNotice> list = noticeService.selectNoticeList(notice);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取移动端通知公告详情(登录后即可访问)。
|
|
|
+ */
|
|
|
+ @GetMapping("/mobile/{noticeId}")
|
|
|
+ public AjaxResult mobileGetInfo(@PathVariable Long noticeId) {
|
|
|
+ SysNotice notice = noticeService.selectNoticeById(noticeId);
|
|
|
+ if (notice == null || !"0".equals(notice.getStatus())) {
|
|
|
+ return error("通知公告不存在或已关闭");
|
|
|
+ }
|
|
|
+ return success(notice);
|
|
|
+ }
|
|
|
}
|