自定义表头参数接收
This commit is contained in:
+14
-2
@@ -1,9 +1,13 @@
|
|||||||
package com.jero.modules.head.controller;
|
package com.jero.modules.head.controller;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
import com.jero.common.system.query.QueryGenerator;
|
||||||
import com.jero.modules.head.entity.HeadCustomEO;
|
import com.jero.modules.head.entity.HeadCustomEO;
|
||||||
@@ -76,13 +80,21 @@ public class HeadCustomEOController extends JeroController<HeadCustomEO, IHeadCu
|
|||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*
|
*
|
||||||
* @param headCustomEOList
|
* @param jsonObject
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "自定义表头-添加")
|
@AutoLog(value = "自定义表头-添加")
|
||||||
@ApiOperation(value="自定义表头-添加", notes="自定义表头-添加")
|
@ApiOperation(value="自定义表头-添加", notes="自定义表头-添加")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<?> add(@Validated @RequestBody List<HeadCustomEO> headCustomEOList) {
|
public Result<?> add(@RequestBody JSONObject jsonObject) {
|
||||||
|
JSONArray headCustomEOArr = jsonObject.getJSONArray("headCustomEOList");
|
||||||
|
List<HeadCustomEO> headCustomEOList = new ArrayList<>();
|
||||||
|
HeadCustomEO headCustomEO = null;
|
||||||
|
for (Object headCustom : headCustomEOArr) {
|
||||||
|
headCustomEO = JSONObject.parseObject(JSONObject.toJSONString(headCustom),HeadCustomEO.class);
|
||||||
|
headCustomEOList.add(headCustomEO);
|
||||||
|
}
|
||||||
|
|
||||||
headCustomEOService.add(headCustomEOList);
|
headCustomEOService.add(headCustomEOList);
|
||||||
return Result.OK("添加成功!");
|
return Result.OK("添加成功!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user