将put delete 请求改为 post
This commit is contained in:
+13
-15
@@ -1,5 +1,16 @@
|
||||
package com.jero.modules.demo.mock;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.swing.filechooser.FileSystemView;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -9,20 +20,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.swing.filechooser.FileSystemView;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mock/api")
|
||||
@Slf4j
|
||||
@@ -38,7 +35,8 @@ public class MockController {
|
||||
* @param filename
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/json/{filename}", method = RequestMethod.GET)
|
||||
// @RequestMapping(value = "/json/{filename}", method = RequestMethod.GET)
|
||||
@GetMapping("/json/{filename}")
|
||||
public String getJsonData(@PathVariable String filename) {
|
||||
String jsonpath = "classpath:com/jero/modules/demo/mock/json/"+filename+".json";
|
||||
return readJson(jsonpath);
|
||||
|
||||
+1
-1
@@ -142,7 +142,7 @@ public class VxeMockController {
|
||||
*
|
||||
* @param rowData 行数据,实际使用时可以替换成一个实体类
|
||||
*/
|
||||
@PutMapping("/immediateSaveRow")
|
||||
@PostMapping ("/immediateSaveRow")
|
||||
public Result mockImmediateSaveRow(@RequestBody JSONObject rowData) throws Exception {
|
||||
log.info("即时保存.rowData:" + rowData.toJSONString());
|
||||
// 延时1.5秒,模拟网慢堵塞真实感
|
||||
|
||||
+9
-9
@@ -4,20 +4,20 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.demo.test.entity.JeroDemo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.aspect.annotation.PermissionData;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.DateUtils;
|
||||
import com.jero.common.util.RedisUtil;
|
||||
import com.jero.modules.demo.test.entity.JeroDemo;
|
||||
import com.jero.modules.demo.test.service.IJeroDemoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
@@ -91,7 +91,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
* @param jeroDemo
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/edit")
|
||||
@PostMapping(value = "/edit")
|
||||
@ApiOperation(value = "编辑DEMO", notes = "编辑DEMO")
|
||||
@AutoLog(value = "编辑DEMO", operateType = CommonConstant.OPERATE_TYPE_3)
|
||||
public Result edit(@RequestBody JeroDemo jeroDemo) {
|
||||
@@ -106,7 +106,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "删除测试DEMO")
|
||||
@DeleteMapping(value = "/delete")
|
||||
@PostMapping(value = "/delete")
|
||||
@ApiOperation(value = "通过ID删除DEMO", notes = "通过ID删除DEMO")
|
||||
public Result delete(@RequestParam(name = "id", required = true) String id) {
|
||||
JeroDemoService.removeById(id);
|
||||
@@ -119,7 +119,7 @@ public class JeroDemoController extends JeroController<JeroDemo, IJeroDemoServic
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
@ApiOperation(value = "批量删除DEMO", notes = "批量删除DEMO")
|
||||
public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.JeroDemoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
|
||||
+18
-28
@@ -1,16 +1,10 @@
|
||||
package com.jero.modules.demo.test.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.demo.test.entity.JeroOrderCustomer;
|
||||
@@ -20,6 +14,8 @@ 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 lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
@@ -27,24 +23,17 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 一对多示例(JEditableTable行编辑)
|
||||
@@ -101,7 +90,7 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
* @param jeroOrderMainPage
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/edit")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result eidt(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
JeroOrderMain jeroOrderMain = new JeroOrderMain();
|
||||
BeanUtils.copyProperties(jeroOrderMainPage, jeroOrderMain);
|
||||
@@ -115,7 +104,7 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/delete")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result delete(@RequestParam(name = "id", required = true) String id) {
|
||||
jeroOrderMainService.delMain(id);
|
||||
return Result.OK("删除成功!");
|
||||
@@ -127,7 +116,7 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.jeroOrderMainService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
@@ -216,7 +205,8 @@ public class JeroOrderMainController extends JeroController<JeroOrderMain, IJero
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
@PostMapping("/importExcel")
|
||||
public Result importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
|
||||
+9
-9
@@ -89,7 +89,7 @@ public class JeroOrderTabMainController {
|
||||
* @param jeroOrderMainPage
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/edit")
|
||||
@PostMapping("/edit")
|
||||
public Result edit(@RequestBody JeroOrderMainPage jeroOrderMainPage) {
|
||||
JeroOrderMain jeroOrderMain = new JeroOrderMain();
|
||||
BeanUtils.copyProperties(jeroOrderMainPage, jeroOrderMain);
|
||||
@@ -103,7 +103,7 @@ public class JeroOrderTabMainController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/delete")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result delete(@RequestParam(name = "id", required = true) String id) {
|
||||
jeroOrderMainService.delMain(id);
|
||||
return Result.OK(ResultConstant.DEL_OK);
|
||||
@@ -115,7 +115,7 @@ public class JeroOrderTabMainController {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.jeroOrderMainService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK(ResultConstant.BATCH_DEL_OK);
|
||||
@@ -186,7 +186,7 @@ public class JeroOrderTabMainController {
|
||||
* @param jeroOrderCustomer
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/editCustomer")
|
||||
@PostMapping("/editCustomer")
|
||||
public Result editCustomer(@RequestBody JeroOrderCustomer jeroOrderCustomer) {
|
||||
jeroOrderCustomerService.updateById(jeroOrderCustomer);
|
||||
return Result.OK(ResultConstant.OP_OK);
|
||||
@@ -198,7 +198,7 @@ public class JeroOrderTabMainController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteCustomer")
|
||||
@PostMapping(value = "/deleteCustomer")
|
||||
public Result deleteCustomer(@RequestParam(name = "id", required = true) String id) {
|
||||
jeroOrderCustomerService.removeById(id);
|
||||
return Result.OK(ResultConstant.DEL_OK);
|
||||
@@ -210,7 +210,7 @@ public class JeroOrderTabMainController {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatchCustomer")
|
||||
@PostMapping(value = "/deleteBatchCustomer")
|
||||
public Result deleteBatchCustomer(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.jeroOrderCustomerService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK(ResultConstant.BATCH_DEL_OK);
|
||||
@@ -234,7 +234,7 @@ public class JeroOrderTabMainController {
|
||||
* @param jeroOrderTicket
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/editTicket")
|
||||
@PostMapping("/editTicket")
|
||||
public Result editTicket(@RequestBody JeroOrderTicket jeroOrderTicket) {
|
||||
jeroOrderTicketService.updateById(jeroOrderTicket);
|
||||
return Result.OK(ResultConstant.OP_OK);
|
||||
@@ -246,7 +246,7 @@ public class JeroOrderTabMainController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteTicket")
|
||||
@PostMapping(value = "/deleteTicket")
|
||||
public Result deleteTicket(@RequestParam(name = "id", required = true) String id) {
|
||||
jeroOrderTicketService.removeById(id);
|
||||
return Result.OK(ResultConstant.DEL_OK);
|
||||
@@ -258,7 +258,7 @@ public class JeroOrderTabMainController {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatchTicket")
|
||||
@PostMapping(value = "/deleteBatchTicket")
|
||||
public Result deleteBatchTicket(@RequestParam(name = "ids", required = true) String ids) {
|
||||
this.jeroOrderTicketService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK(ResultConstant.BATCH_DEL_OK);
|
||||
|
||||
+5
-4
@@ -99,7 +99,7 @@ public class JoaDemoController {
|
||||
* @param joaDemo
|
||||
* @return
|
||||
*/
|
||||
@PutMapping(value = "/edit")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<Object> edit(@RequestBody JoaDemo joaDemo) {
|
||||
JoaDemo joaDemoEntity = joaDemoService.getById(joaDemo.getId());
|
||||
if(joaDemoEntity==null) {
|
||||
@@ -119,7 +119,7 @@ public class JoaDemoController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/delete")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<Object> delete(@RequestParam(name="id",required=true) String id) {
|
||||
JoaDemo joaDemo = joaDemoService.getById(id);
|
||||
if(joaDemo==null) {
|
||||
@@ -138,7 +138,7 @@ public class JoaDemoController {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<Object> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
if(ids==null || "".equals(ids.trim())) {
|
||||
return Result.error("参数不识别!");
|
||||
@@ -202,7 +202,8 @@ public class JoaDemoController {
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
@PostMapping("/importExcel")
|
||||
public Result importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ public class DlMockController {
|
||||
*
|
||||
* @param rowData 行数据,实际使用时可以替换成一个实体类
|
||||
*/
|
||||
@PutMapping("/immediateSaveRow")
|
||||
@PostMapping("/immediateSaveRow")
|
||||
public Result mockImmediateSaveRow(@RequestBody JSONObject rowData) throws Exception {
|
||||
log.info("即时保存.rowData:" + rowData.toJSONString());
|
||||
// 延时1.5秒,模拟网慢堵塞真实感
|
||||
|
||||
Reference in New Issue
Block a user