|
@@ -1,18 +1,16 @@
|
|
|
package com.chuanghai.repair.controller;
|
|
package com.chuanghai.repair.controller;
|
|
|
|
|
|
|
|
|
|
+import com.chuanghai.repair.entity.RepairsNotice;
|
|
|
import com.chuanghai.repair.service.RepairsNoticeService;
|
|
import com.chuanghai.repair.service.RepairsNoticeService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
+import java.util.Date;
|
|
|
|
|
|
|
|
-/**
|
|
|
|
|
- * @Author: bingo
|
|
|
|
|
- * @Date: 2022/2/26 星期六 16:09
|
|
|
|
|
- * @Description: com.chuanghai.repair.controller
|
|
|
|
|
- * @version: 1.0
|
|
|
|
|
- */
|
|
|
|
|
@Api(tags = "公告管理")
|
|
@Api(tags = "公告管理")
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/notice")
|
|
@RequestMapping("/notice")
|
|
@@ -20,4 +18,56 @@ public class NoticeController {
|
|
|
|
|
|
|
|
@Resource(name = "repairsNoticeService")
|
|
@Resource(name = "repairsNoticeService")
|
|
|
private RepairsNoticeService repairsNoticeService;
|
|
private RepairsNoticeService repairsNoticeService;
|
|
|
|
|
+
|
|
|
|
|
+// @ApiOperation("添加公告")
|
|
|
|
|
+// @PostMapping(value = "/addNotice")
|
|
|
|
|
+// public Boolean addNotice(String noticeContent, Date noticeTime, Integer adminId){
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("发布公告")
|
|
|
|
|
+ @PostMapping(value = "/releaseNotice")
|
|
|
|
|
+ public RepairsNotice releaseNotice(){
|
|
|
|
|
+ RepairsNotice repairsNotice = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ repairsNotice = repairsNoticeService.releaseNotice();
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ return repairsNotice;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("删除公告")
|
|
|
|
|
+ @PostMapping(value = "/updateNotice")
|
|
|
|
|
+ public Boolean updateNotice(String noticeId){
|
|
|
|
|
+ Boolean flag = Boolean.FALSE;
|
|
|
|
|
+ try {
|
|
|
|
|
+ if(repairsNoticeService.updateNotice(noticeId) == null){
|
|
|
|
|
+ flag = Boolean.TRUE;
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ return flag;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+// @ApiOperation("修改公告")
|
|
|
|
|
+// @PostMapping(value = "/alterNotice")
|
|
|
|
|
+// public Boolean alterNotice(String noticeContent, Date noticeTime, Integer noticeId){
|
|
|
|
|
+//
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("查询全部公告")
|
|
|
|
|
+ @PostMapping(value = "/queryAllNotice")
|
|
|
|
|
+ public RepairsNotice queryAllNotice(String noticeStatus){
|
|
|
|
|
+ RepairsNotice repairsNotice = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ if(noticeStatus!="" && noticeStatus!=null){
|
|
|
|
|
+ repairsNotice = repairsNoticeService.queryAllNotice(noticeStatus);
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ return repairsNotice;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|