package com.thhy.engineering.modules.biz.notice.controller; import com.thhy.engineering.modules.biz.notice.service.SysNoticeService; import com.thhy.general.common.BasicResult; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.util.Map; @RestController @RequestMapping("/notice") public class SysNoticeController { @Resource private SysNoticeService noticeService; @Value("${file-upload.upload-folder}") private String paths; //公告添加 @PostMapping("/noticeInsert") public BasicResult noticeInsert(@RequestBody Map values){ return noticeService.noticeInsert(values); } //图片上传 @PostMapping @RequestMapping(value = "/upBusinessImage",method = RequestMethod.POST) public BasicResult uploadBusinessImage(@RequestParam(value = "file", required = false) MultipartFile file) { return noticeService.uploadImage(file,paths); } //修改 @PostMapping("/noticeUpdate") public BasicResult noticeUpdate(@RequestBody Map values){ return noticeService.noticeUpdate(values); } //公告列表 @PostMapping("/noticeList") public BasicResult noticeList(@RequestBody Map values){ return noticeService.noticeList(values); } //公告详情 @GetMapping("/noticeInfo") public BasicResult noticeInfo(@RequestParam String noticeId){ return noticeService.noticeInfo(noticeId); } //公告删除 @GetMapping("/noticeDel") public BasicResult noticeDel(@RequestParam String noticeId){ return noticeService.noticeDel(noticeId); } //公告上架下架 @PostMapping("/noticeOff") public BasicResult noticeOff(@RequestBody Map values){ return noticeService.noticeOff(values); } }