【fix bug】修改请求类型 并效验有效参数

This commit is contained in:
tianwenbo
2023-03-16 16:30:00 +08:00
parent 0bb2f0a9c6
commit 97cd09e420
33 changed files with 288 additions and 85 deletions
@@ -18,6 +18,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -108,6 +109,9 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
@ApiOperation(value = "通过ID删除DEMO", notes = "通过ID删除DEMO")
public Result<T> delete(@RequestBody Map<String, String> map) {
String id = map.get("id");
if(StringUtils.isBlank(id)){
return Result.error("参数不识别!");
}
JeroDemoService.removeById(id);
return Result.OK("删除成功!");
}
@@ -122,6 +126,9 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
@ApiOperation(value = "批量删除DEMO", notes = "批量删除DEMO")
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
String ids = map.get("ids");
if(StringUtils.isBlank(ids)){
return Result.error("参数不识别!");
}
this.JeroDemoService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@@ -15,6 +15,7 @@ import com.jero.modules.demo.test.service.IJeroOrderMainService;
import com.jero.modules.demo.test.service.IJeroOrderTicketService;
import com.jero.modules.demo.test.vo.JeroOrderMainPage;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.SecurityUtils;
import org.jeecgframework.poi.excel.ExcelImportUtil;
@@ -108,6 +109,9 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
@PostMapping(value = "/delete")
public Result<T> delete(@RequestBody Map<String, String> map) {
String id = map.get("id");
if(StringUtils.isBlank(id)){
return Result.error("参数不识别!");
}
jeroOrderMainService.delMain(id);
return Result.OK("删除成功!");
}
@@ -121,6 +125,9 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
@PostMapping(value = "/deleteBatch")
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
String ids = map.get("ids");
if(StringUtils.isBlank(ids)){
return Result.error("参数不识别!");
}
this.jeroOrderMainService.delBatchMain(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
@@ -15,6 +15,7 @@ import com.jero.modules.demo.test.service.IJeroOrderCustomerService;
import com.jero.modules.demo.test.service.IJeroOrderMainService;
import com.jero.modules.demo.test.service.IJeroOrderTicketService;
import com.jero.modules.demo.test.vo.JeroOrderMainPage;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -108,6 +109,9 @@ public class JeroOrderTabMainController {
@PostMapping(value = "/delete")
public Result<T> delete(@RequestBody Map<String, String> map) {
String id = map.get("id");
if(StringUtils.isBlank(id)){
return Result.error("参数不识别!");
}
jeroOrderMainService.delMain(id);
return Result.OK(ResultConstant.DEL_OK);
}
@@ -121,6 +125,9 @@ public class JeroOrderTabMainController {
@PostMapping(value = "/deleteBatch")
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
String ids = map.get("ids");
if(StringUtils.isBlank(ids)){
return Result.error("参数不识别!");
}
this.jeroOrderMainService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK(ResultConstant.BATCH_DEL_OK);
}
@@ -205,6 +212,9 @@ public class JeroOrderTabMainController {
@PostMapping(value = "/deleteCustomer")
public Result<T> deleteCustomer(@RequestBody Map<String, String> map) {
String id = map.get("id");
if(StringUtils.isBlank(id)){
return Result.error("参数不识别!");
}
jeroOrderCustomerService.removeById(id);
return Result.OK(ResultConstant.DEL_OK);
}
@@ -218,6 +228,9 @@ public class JeroOrderTabMainController {
@PostMapping(value = "/deleteBatchCustomer")
public Result<T> deleteBatchCustomer(@RequestBody Map<String, String> map) {
String ids = map.get("ids");
if(StringUtils.isBlank(ids)){
return Result.error("参数不识别!");
}
this.jeroOrderCustomerService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK(ResultConstant.BATCH_DEL_OK);
}
@@ -255,6 +268,9 @@ public class JeroOrderTabMainController {
@PostMapping(value = "/deleteTicket")
public Result<T> deleteTicket(@RequestBody Map<String, String> map) {
String id = map.get("id");
if(StringUtils.isBlank(id)){
return Result.error("参数不识别!");
}
jeroOrderTicketService.removeById(id);
return Result.OK(ResultConstant.DEL_OK);
}
@@ -268,6 +284,9 @@ public class JeroOrderTabMainController {
@PostMapping(value = "/deleteBatchTicket")
public Result<T> deleteBatchTicket(@RequestBody Map<String, String> map) {
String ids = map.get("ids");
if(StringUtils.isBlank(ids)){
return Result.error("参数不识别!");
}
this.jeroOrderTicketService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK(ResultConstant.BATCH_DEL_OK);
}
@@ -11,6 +11,7 @@ import com.jero.common.system.query.QueryGenerator;
import com.jero.common.util.oConvertUtils;
import com.jero.modules.demo.test.entity.JoaDemo;
import com.jero.modules.demo.test.service.IJoaDemoService;
import org.apache.commons.lang.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.jeecgframework.poi.excel.ExcelImportUtil;
@@ -112,6 +113,9 @@ public class JoaDemoController {
@PostMapping(value = "/delete")
public Result<Object> delete(@RequestBody Map<String, String> map) {
String id = map.get("id");
if(StringUtils.isBlank(id)){
return Result.error("参数不识别!");
}
JoaDemo joaDemo = joaDemoService.getById(id);
if(joaDemo==null) {
return Result.error(ResultConstant.EN_WAS_NOT_FOUND);