rev:所有成功状态码都改为200
This commit is contained in:
@@ -3,12 +3,12 @@ package org.nl.system.controller.param;
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
|
||||
import org.nl.common.utils.api.RestBusinessTemplate;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.dao.Param;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -32,53 +32,50 @@ import java.util.Map;
|
||||
@RequestMapping("/api/param")
|
||||
@RequiredArgsConstructor
|
||||
@SaIgnore
|
||||
class SysParamController {
|
||||
private final ISysParamService paramService;
|
||||
class SysParamController{
|
||||
private final ISysParamService paramService;
|
||||
|
||||
@PostMapping("/query")
|
||||
@Log(value = "查询系统参数", isAddLogTable = true, isInterfaceLog = true)
|
||||
@ApiOperation("查询系统参数")
|
||||
//@SaCheckPermission("param:list")
|
||||
public ResponseEntity<List<Param>> query(@RequestBody PageQuery page) {
|
||||
return new ResponseEntity<>(paramService.queryPage(page), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/query")
|
||||
@Log(value = "查询系统参数", isAddLogTable = true, isInterfaceLog = true)
|
||||
@ApiOperation("查询系统参数")
|
||||
//@SaCheckPermission("param:list")
|
||||
public ResponseEntity<List<Param>> query(@RequestBody PageQuery page) {
|
||||
return new ResponseEntity<>(paramService.queryPage(page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@Log("新增系统参数")
|
||||
@ApiOperation("新增系统参数")
|
||||
//@SaCheckPermission("param:add")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody Param param) {
|
||||
paramService.create(param);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
@PostMapping("/add")
|
||||
@Log("新增系统参数")
|
||||
@ApiOperation("新增系统参数")
|
||||
//@SaCheckPermission("param:add")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody Param param) {
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> paramService.create(param)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/edit")
|
||||
@Log("修改系统参数")
|
||||
@ApiOperation("修改系统参数")
|
||||
//@SaCheckPermission("param:edit")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody Param param) {
|
||||
paramService.update(param);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
@PostMapping("/edit")
|
||||
@Log("修改系统参数")
|
||||
@ApiOperation("修改系统参数")
|
||||
//@SaCheckPermission("param:edit")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody Param param) {
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> paramService.update(param)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("删除系统参数")
|
||||
@ApiOperation("删除系统参数")
|
||||
//@SaCheckPermission("param:del")
|
||||
@PostMapping("/delete")
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
List<String> Ids = Arrays.asList(ids);
|
||||
paramService.deleteByIds(Ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getValueByCode")
|
||||
@Log("根据编码获取值")
|
||||
@ApiOperation("根据编码获取值")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getValueByCode(@RequestBody String code) {
|
||||
return new ResponseEntity<>(paramService.findByCode(code), HttpStatus.CREATED);
|
||||
}
|
||||
@Log("删除系统参数")
|
||||
@ApiOperation("删除系统参数")
|
||||
//@SaCheckPermission("param:del")
|
||||
@PostMapping("/delete")
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
List<String> Ids = Arrays.asList(ids);
|
||||
paramService.deleteByIds(Ids);
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> paramService.deleteByIds(Ids)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getValueByCode")
|
||||
@Log("根据编码获取值")
|
||||
@ApiOperation("根据编码获取值")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> getValueByCode(@RequestBody String code) {
|
||||
return new ResponseEntity<>(paramService.findByCode(code), HttpStatus.CREATED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* 角色表 前端控制器
|
||||
*
|
||||
* @author generator
|
||||
* @since 2022-12-15
|
||||
*/
|
||||
@@ -52,7 +53,7 @@ public class SysRoleController{
|
||||
@PostMapping("/add")
|
||||
//@SaCheckPermission("roles:add")
|
||||
public ResponseEntity<Object> create(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> roleService.create(param)), HttpStatus.OK);
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> roleService.create(param)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("修改角色")
|
||||
@@ -60,14 +61,7 @@ public class SysRoleController{
|
||||
@PostMapping("/edit")
|
||||
//@SaCheckPermission("roles:edit")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject param) {
|
||||
//roleService.update(param);
|
||||
JSONObject returnjo = new JSONObject();
|
||||
JSONObject result = new JSONObject();
|
||||
returnjo.put("result", result);
|
||||
returnjo.put("code", "1");
|
||||
returnjo.put("desc", "操作成功");
|
||||
return new ResponseEntity<>(returnjo, HttpStatus.OK);
|
||||
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> roleService.update(param)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("删除角色")
|
||||
@@ -75,8 +69,7 @@ public class SysRoleController{
|
||||
@PostMapping("/delete")
|
||||
//@SaCheckPermission("roles:del")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
roleService.deleteBatchByIds(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> roleService.deleteBatchByIds(ids)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("查询菜单树")
|
||||
@@ -91,8 +84,7 @@ public class SysRoleController{
|
||||
@PostMapping("/menu")
|
||||
//@SaCheckPermission("roles:edit")
|
||||
public ResponseEntity<Object> updateMenu(@RequestBody JSONObject form) {
|
||||
roleService.updateMenu(form);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> roleService.updateMenu(form)), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.api.RestBusinessTemplate;
|
||||
import org.nl.modules.common.config.RsaProperties;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.RsaUtils;
|
||||
@@ -60,7 +61,7 @@ public class UserController{
|
||||
@ApiOperation("查询用户")
|
||||
@PostMapping("/query")
|
||||
public ResponseEntity<List<SysUserDetail>> query(@RequestBody PageQuery page) {
|
||||
UserQuery userQuery =new UserQuery();
|
||||
UserQuery userQuery = new UserQuery();
|
||||
return new ResponseEntity(userService.getUserDetail(userQuery, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -69,8 +70,7 @@ public class UserController{
|
||||
@PostMapping("/add")
|
||||
// @SaCheckPermission("user:add")
|
||||
public ResponseEntity<Object> create(@RequestBody Map user) {
|
||||
userService.create(user);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> userService.create(user)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("修改用户")
|
||||
@@ -79,8 +79,7 @@ public class UserController{
|
||||
// @SaCheckPermission("user:edit")
|
||||
public ResponseEntity<Object> update(@RequestBody Map resources)
|
||||
throws Exception {
|
||||
userService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> userService.update(resources)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("修改用户:个人中心")
|
||||
@@ -91,7 +90,7 @@ public class UserController{
|
||||
throw new BadRequestException("不能修改他人资料");
|
||||
}
|
||||
userService.saveOrUpdate(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> userService.saveOrUpdate(resources)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("删除用户")
|
||||
@@ -99,16 +98,14 @@ public class UserController{
|
||||
@PostMapping("/delete")
|
||||
// @SaCheckPermission("user:del")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
userService.removeByIds(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> userService.removeByIds(ids)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("修改密码")
|
||||
@PostMapping(value = "/updatePass")
|
||||
public ResponseEntity<Object> updatePass(@RequestBody JSONObject passVo)
|
||||
throws Exception {
|
||||
userService.updatePass(passVo);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
return new ResponseEntity<>(RestBusinessTemplate.execute(() -> userService.updatePass(passVo)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("修改头像")
|
||||
|
||||
Reference in New Issue
Block a user