|
@@ -4,13 +4,19 @@ import com.jiayue.ipfcst.aop.SaveValidate;
|
|
|
import com.jiayue.ipfcst.common.core.web.vo.RequestVO;
|
|
|
import com.jiayue.ipfcst.common.core.web.vo.ResponseVO;
|
|
|
import com.jiayue.ipfcst.common.data.entity.SysParameter;
|
|
|
+import com.jiayue.ipfcst.common.data.strategy.ApiMyResponse;
|
|
|
import com.jiayue.ipfcst.console.service.SysParameterService;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.SneakyThrows;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
+import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -24,6 +30,7 @@ import java.util.List;
|
|
|
@RestController
|
|
|
@RequestMapping(value = "sysParameter")
|
|
|
@Slf4j
|
|
|
+@Api(value = "SysParameterController", tags = "系统参数controller")
|
|
|
public class SysParameterController {
|
|
|
|
|
|
private final SysParameterService sysParameterService;
|
|
@@ -42,6 +49,13 @@ public class SysParameterController {
|
|
|
@SneakyThrows
|
|
|
@PostMapping()
|
|
|
@SaveValidate
|
|
|
+ @ApiOperation(value = "新增系统参数", httpMethod = "POST",
|
|
|
+ notes = "<p>返回ResponseVO对象</p>"
|
|
|
+ )
|
|
|
+ @ApiImplicitParams(value={
|
|
|
+ @ApiImplicitParam(name= "sysParameter",value = "SysParameter实体",dataType="SysParameter")
|
|
|
+ })
|
|
|
+ @ApiMyResponse
|
|
|
public ResponseVO add(@RequestBody SysParameter sysParameter) {
|
|
|
try {
|
|
|
this.sysParameterService.add(sysParameter);
|
|
@@ -62,6 +76,13 @@ public class SysParameterController {
|
|
|
@SneakyThrows
|
|
|
@SaveValidate
|
|
|
@PutMapping()
|
|
|
+ @ApiOperation(value = "修改系统参数", httpMethod = "PUT",
|
|
|
+ notes = "<p>返回ResponseVO对象</p>"
|
|
|
+ )
|
|
|
+ @ApiImplicitParams(value={
|
|
|
+ @ApiImplicitParam(name= "sysParameter",value = "SysParameter实体",dataType="SysParameter")
|
|
|
+ })
|
|
|
+ @ApiMyResponse
|
|
|
public ResponseVO update(@RequestBody SysParameter sysParameter) {
|
|
|
this.sysParameterService.update(sysParameter);
|
|
|
return ResponseVO.success(1);
|
|
@@ -76,6 +97,13 @@ public class SysParameterController {
|
|
|
@SneakyThrows
|
|
|
@SaveValidate
|
|
|
@DeleteMapping()
|
|
|
+ @ApiOperation(value = "删除系统参数", httpMethod = "DELETE",
|
|
|
+ notes = "<p>返回ResponseVO对象</p>"
|
|
|
+ )
|
|
|
+ @ApiImplicitParams(value={
|
|
|
+ @ApiImplicitParam(name= "sysParameter",value = "SysParameter实体",dataType="SysParameter")
|
|
|
+ })
|
|
|
+ @ApiMyResponse
|
|
|
public ResponseVO delete(@RequestBody SysParameter sysParameter) {
|
|
|
this.sysParameterService.delete(sysParameter.getId());
|
|
|
return ResponseVO.success(1);
|
|
@@ -89,6 +117,10 @@ public class SysParameterController {
|
|
|
*/
|
|
|
@SneakyThrows
|
|
|
@GetMapping()
|
|
|
+ @ApiOperation(value = "获取所有系统参数", httpMethod = "GET",
|
|
|
+ notes = "<p>返回ResponseVO对象,data属性存入List<SysParameter></p>"
|
|
|
+ )
|
|
|
+ @ApiMyResponse
|
|
|
public ResponseVO getAll() {
|
|
|
List<SysParameter> list = this.sysParameterService.getAll();
|
|
|
return ResponseVO.success(list);
|
|
@@ -104,6 +136,14 @@ public class SysParameterController {
|
|
|
*/
|
|
|
@SneakyThrows
|
|
|
@GetMapping(value = "/{page}/{size}")
|
|
|
+ @ApiOperation(value = "分页获取系统参数", httpMethod = "GET",
|
|
|
+ notes = "<p>返回ResponseVO对象,data属性存入Page<SysParameter></p>"
|
|
|
+ )
|
|
|
+ @ApiImplicitParams(value={
|
|
|
+ @ApiImplicitParam(name= "page",value = "页码",dataType="Integer"),
|
|
|
+ @ApiImplicitParam(name= "size",value = "条数",dataType="Integer"),
|
|
|
+ })
|
|
|
+ @ApiMyResponse
|
|
|
public ResponseVO getAll(@PathVariable("page") Integer page, @PathVariable("size") Integer size) {
|
|
|
SysParameter sysParameter = new SysParameter();
|
|
|
Page<SysParameter> sysParameterPage = this.sysParameterService.get(sysParameter, page, size);
|
|
@@ -120,6 +160,15 @@ public class SysParameterController {
|
|
|
*/
|
|
|
@SneakyThrows
|
|
|
@GetMapping(value = "/{page}/{size}/{keywords}")
|
|
|
+ @ApiOperation(value = "分页获取系统参数", httpMethod = "GET",
|
|
|
+ notes = "<p>返回ResponseVO对象,data属性存入Page<SysParameter></p>"
|
|
|
+ )
|
|
|
+ @ApiImplicitParams(value={
|
|
|
+ @ApiImplicitParam(name= "page",value = "页码",dataType="Integer"),
|
|
|
+ @ApiImplicitParam(name= "size",value = "条数",dataType="Integer"),
|
|
|
+ @ApiImplicitParam(name= "keywords",value = "关键字",dataType="String"),
|
|
|
+ })
|
|
|
+ @ApiMyResponse
|
|
|
public ResponseVO getAForKeywords(@PathVariable("page") Integer page, @PathVariable("size") Integer size,@PathVariable("keywords") String keywords) {
|
|
|
SysParameter sysParameter = new SysParameter();
|
|
|
Page<SysParameter> sysParameterPage = this.sysParameterService.getForKeywords(sysParameter, page, size,keywords);
|
|
@@ -134,6 +183,13 @@ public class SysParameterController {
|
|
|
*/
|
|
|
@SneakyThrows
|
|
|
@GetMapping(value = "/sysParameter/{id}/")
|
|
|
+ @ApiOperation(value = "根据ID获取系统参数值", httpMethod = "GET",
|
|
|
+ notes = "<p>返回ResponseVO对象,data属性存入参数值</p>"
|
|
|
+ )
|
|
|
+ @ApiImplicitParams(value={
|
|
|
+ @ApiImplicitParam(name= "id",value = "主键ID",dataType="Integer")
|
|
|
+ })
|
|
|
+ @ApiMyResponse
|
|
|
public ResponseVO getById(@PathVariable("id") Integer id) {
|
|
|
return ResponseVO.success(sysParameterService.getParameter(id));
|
|
|
}
|
|
@@ -146,6 +202,13 @@ public class SysParameterController {
|
|
|
*/
|
|
|
@SneakyThrows
|
|
|
@GetMapping(value = "/sysParameterKey/{sysKey}")
|
|
|
+ @ApiOperation(value = "根据key获取系统参数值", httpMethod = "GET",
|
|
|
+ notes = "<p>返回ResponseVO对象,data属性存入参数值</p>"
|
|
|
+ )
|
|
|
+ @ApiImplicitParams(value={
|
|
|
+ @ApiImplicitParam(name= "sysKey",value = "参数key",dataType="String")
|
|
|
+ })
|
|
|
+ @ApiMyResponse
|
|
|
public ResponseVO getById(@PathVariable("sysKey") String sysKey) {
|
|
|
return ResponseVO.success(sysParameterService.getParameterBySysKey(sysKey));
|
|
|
}
|
|
@@ -159,6 +222,7 @@ public class SysParameterController {
|
|
|
*/
|
|
|
@SneakyThrows
|
|
|
@PostMapping("/noSaveValidate")
|
|
|
+ @ApiIgnore
|
|
|
public ResponseVO save(@RequestBody SysParameter sysParameter) {
|
|
|
try {
|
|
|
this.sysParameterService.update(sysParameter);
|