张晓波
2023-09-19 164694c47c35d6654df69b533e8dbf8b5423efc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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<String,Object> 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<String,Object> values){
        return noticeService.noticeUpdate(values);
    }
    //公告列表
    @PostMapping("/noticeList")
    public BasicResult noticeList(@RequestBody Map<String,Object> 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<String,Object> values){
        return noticeService.noticeOff(values);
    }
 
 
}