RotationImgDictController.java
2.17 KB
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
package com.subsidy.controller;
import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.common.interceptor.LoginRequired;
import com.subsidy.model.RotationImgDictDO;
import com.subsidy.service.RotationImgDictService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 轮播图 前端控制器
* </p>
*
* @author DengMin
* @since 2022-02-23
*/
@RestController
@Api(tags = "轮播图")
@RequestMapping("/rotationImgDict")
public class RotationImgDictController {
@Autowired
private RotationImgDictService rotationImgDictService;
@PostMapping("addRotation")
@ApiOperation("添加轮播图 {companyId 公司id rotationImg 轮播图地址}")
@LoginRequired
public ResponseVO addRotation(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.addRotation(rotationImgDictDO));
}
@PostMapping("deleteRotation")
@ApiOperation("删除轮播图 {id}")
@LoginRequired
public ResponseVO deleteRotation(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.deleteRotation(rotationImgDictDO));
}
@PostMapping("updateRotation")
@ApiOperation("编辑轮播图 id")
@LoginRequired
public ResponseVO updateRotation(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.updateRotation(rotationImgDictDO));
}
@PostMapping("getAllRotations")
@ApiOperation("获取某企业的轮播图 companyId")
@LoginRequired
public ResponseVO getAllRotations(@RequestBody RotationImgDictDO rotationImgDictDO){
return ResponseData.generateCreatedResponse(0,rotationImgDictService.getAllRotations(rotationImgDictDO));
}
}