修改delete请求的接收参数方法
This commit is contained in:
+8
-8
@@ -18,16 +18,14 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Description: 单表示例
|
||||
@@ -102,13 +100,14 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "删除测试DEMO")
|
||||
@PostMapping(value = "/delete")
|
||||
@ApiOperation(value = "通过ID删除DEMO", notes = "通过ID删除DEMO")
|
||||
public Result delete(@RequestParam(name = "id", required = true) String id) {
|
||||
public Result delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
JeroDemoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -116,12 +115,13 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
@ApiOperation(value = "批量删除DEMO", notes = "批量删除DEMO")
|
||||
public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
this.JeroDemoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
+7
-4
@@ -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.poi.ss.formula.functions.T;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
@@ -101,11 +102,12 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/delete")
|
||||
public Result delete(@RequestParam(name = "id", required = true) String id) {
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
jeroOrderMainService.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
@@ -113,11 +115,12 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
this.jeroOrderMainService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
+19
-11
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.demo.test.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -14,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.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@@ -100,11 +102,12 @@ public class JeroOrderTabMainController {
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/delete")
|
||||
public Result delete(@RequestParam(name = "id", required = true) String id) {
|
||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
jeroOrderMainService.delMain(id);
|
||||
return Result.OK(ResultConstant.DEL_OK);
|
||||
}
|
||||
@@ -112,11 +115,12 @@ public class JeroOrderTabMainController {
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
this.jeroOrderMainService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK(ResultConstant.BATCH_DEL_OK);
|
||||
}
|
||||
@@ -199,7 +203,8 @@ public class JeroOrderTabMainController {
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteCustomer")
|
||||
public Result deleteCustomer(@RequestParam(name = "id", required = true) String id) {
|
||||
public Result deleteCustomer(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
jeroOrderCustomerService.removeById(id);
|
||||
return Result.OK(ResultConstant.DEL_OK);
|
||||
}
|
||||
@@ -207,11 +212,12 @@ public class JeroOrderTabMainController {
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatchCustomer")
|
||||
public Result deleteBatchCustomer(@RequestParam(name = "ids", required = true) String ids) {
|
||||
public Result deleteBatchCustomer(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
this.jeroOrderCustomerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK(ResultConstant.BATCH_DEL_OK);
|
||||
}
|
||||
@@ -243,11 +249,12 @@ public class JeroOrderTabMainController {
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteTicket")
|
||||
public Result deleteTicket(@RequestParam(name = "id", required = true) String id) {
|
||||
public Result deleteTicket(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
jeroOrderTicketService.removeById(id);
|
||||
return Result.OK(ResultConstant.DEL_OK);
|
||||
}
|
||||
@@ -255,11 +262,12 @@ public class JeroOrderTabMainController {
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatchTicket")
|
||||
public Result deleteBatchTicket(@RequestParam(name = "ids", required = true) String ids) {
|
||||
public Result deleteBatchTicket(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
this.jeroOrderTicketService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK(ResultConstant.BATCH_DEL_OK);
|
||||
}
|
||||
|
||||
+6
-4
@@ -116,11 +116,12 @@ public class JoaDemoController {
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param id
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<Object> delete(@RequestParam(name="id",required=true) String id) {
|
||||
public Result<Object> delete(@RequestBody Map<String, String> map) {
|
||||
String id = map.get("id");
|
||||
JoaDemo joaDemo = joaDemoService.getById(id);
|
||||
if(joaDemo==null) {
|
||||
return Result.error(ResultConstant.EN_WAS_NOT_FOUND);
|
||||
@@ -135,11 +136,12 @@ public class JoaDemoController {
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<Object> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
public Result<Object> deleteBatch(@RequestBody Map<String, String> map) {
|
||||
String ids = map.get("ids");
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
return Result.error("参数不识别!");
|
||||
}else {
|
||||
|
||||
Reference in New Issue
Block a user