设置业务字典post请求方式为对应实体类。

This commit is contained in:
little-cat-sweet 2021-08-02 11:05:08 +08:00
parent 3544ae61fa
commit 659583526e
5 changed files with 44 additions and 21 deletions

View File

@ -16,10 +16,10 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 118.24.137.203:8848 server-addr: 127.0.0.1:8848
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 118.24.137.203:8848 server-addr: 127.0.0.1:8848
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置
@ -35,7 +35,7 @@ spring:
datasource: datasource:
ds1: ds1:
nacos: nacos:
server-addr: 118.24.137.203:8848 server-addr: 127.0.0.1:8848
dataId: sentinel-ruoyi-gateway dataId: sentinel-ruoyi-gateway
groupId: DEFAULT_GROUP groupId: DEFAULT_GROUP
data-type: json data-type: json

View File

@ -14,10 +14,10 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 118.24.137.203:8848 server-addr: 127.0.0.1:8848
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 118.24.137.203:8848 server-addr: 127.0.0.1:8848
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -4,6 +4,7 @@ import com.xhpc.common.core.web.controller.BaseController;
import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.domain.AjaxResult;
import com.xhpc.common.core.web.page.TableDataInfo; import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.general.domain.XhpcDictionary; import com.xhpc.general.domain.XhpcDictionary;
import com.xhpc.general.domain.XhpcDictionaryChild;
import com.xhpc.general.service.IXhpcDictBizService; import com.xhpc.general.service.IXhpcDictBizService;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -42,8 +43,9 @@ public class XhpcDictBizController extends BaseController {
* @return * @return
*/ */
@PostMapping("/addMainItem") @PostMapping("/addMainItem")
public AjaxResult addMainDictionaryItem(String name, String code, Integer sort){ public AjaxResult addMainDictionaryItem(@RequestBody XhpcDictionary xhpcDictionary){
return xhpcDictBizService.addADictionaryItem(name,code,sort);
return xhpcDictBizService.addADictionaryItem(xhpcDictionary.getDictValue(),xhpcDictionary.getCode(),xhpcDictionary.getSort());
} }
@ -69,9 +71,9 @@ public class XhpcDictBizController extends BaseController {
* @return * @return
*/ */
@PostMapping("/addDetailItem") @PostMapping("/addDetailItem")
public AjaxResult addDetailDictionaryItem(@RequestParam("parentId") Long parentId, String code, String dictKey, String dictValue,Integer sort){ public AjaxResult addDetailDictionaryItem(@RequestBody XhpcDictionary xhpcDictionary){
return xhpcDictBizService.addAChildDictionaryItem(parentId, code, dictKey, dictValue, sort); return xhpcDictBizService.addAChildDictionaryItem(xhpcDictionary.getParentId(), xhpcDictionary.getCode(), xhpcDictionary.getDictKey(), xhpcDictionary.getDictValue(), xhpcDictionary.getSort());
} }
@ -81,14 +83,15 @@ public class XhpcDictBizController extends BaseController {
* @return * @return
*/ */
@PostMapping("/deleteChildDictionaryItem") @PostMapping("/deleteChildDictionaryItem")
public AjaxResult deleteChildDictionaryItem(@RequestParam Long id){ public AjaxResult deleteChildDictionaryItem(@RequestBody XhpcDictionary xhpcDictionary){
return xhpcDictBizService.deleteChildDictionaryItem(id); return xhpcDictBizService.deleteChildDictionaryItem(xhpcDictionary.getDictBizId());
} }
@PostMapping("/deleteFather") @PostMapping("/deleteFather")
public AjaxResult deleteParentItem(@RequestParam Long id){ public AjaxResult deleteParentItem(@RequestBody XhpcDictionary xhpcDictionary){
return xhpcDictBizService.deleteParentItem(id);
return xhpcDictBizService.deleteParentItem(xhpcDictionary.getDictBizId());
} }
@ -133,9 +136,9 @@ public class XhpcDictBizController extends BaseController {
* @return * @return
*/ */
@PostMapping("/updateFatherItem") @PostMapping("/updateFatherItem")
public AjaxResult updateFatherItem(@RequestParam Long dictBizId,String code,String keyValue,Integer sort){ public AjaxResult updateFatherItem(@RequestBody XhpcDictionary xhpcDictionary){
return xhpcDictBizService.updateMainItem(dictBizId, code, keyValue, sort); return xhpcDictBizService.updateMainItem(xhpcDictionary.getDictBizId(), xhpcDictionary.getCode(), xhpcDictionary.getDictValue(), xhpcDictionary.getSort());
} }
@ -149,9 +152,9 @@ public class XhpcDictBizController extends BaseController {
* @return * @return
*/ */
@PostMapping("/updateChildItem") @PostMapping("/updateChildItem")
public AjaxResult updateChildItem(@RequestParam Long parentId,@RequestParam Long id, String value, String key,Integer sort ){ public AjaxResult updateChildItem(@RequestBody XhpcDictionary xhpcDictionary){
return xhpcDictBizService.updateChildItem(parentId, id, value, key, sort); return xhpcDictBizService.updateChildItem(xhpcDictionary.getParentId(), xhpcDictionary.getDictBizId(), xhpcDictionary.getDictValue(), xhpcDictionary.getDictKey(), xhpcDictionary.getSort());
} }
@ -161,13 +164,14 @@ public class XhpcDictBizController extends BaseController {
* @return * @return
*/ */
@PostMapping("/deleteChildItems") @PostMapping("/deleteChildItems")
public AjaxResult deletChildItems(@RequestParam String ids){ public AjaxResult deletChildItems(@RequestBody XhpcDictionaryChild xhpcDictionaryChild){
return xhpcDictBizService.deleteChildItems(ids); return xhpcDictBizService.deleteChildItems(xhpcDictionaryChild.getIds());
} }
@PostMapping("/deleteParentItems") @PostMapping("/deleteParentItems")
public AjaxResult deleteParentItems(@RequestParam String ids){ public AjaxResult deleteParentItems(@RequestBody XhpcDictionaryChild xhpcDictionaryChild){
return xhpcDictBizService.deleteParentItems(ids);
return xhpcDictBizService.deleteParentItems(xhpcDictionaryChild.getIds());
} }
} }

View File

@ -8,6 +8,7 @@ import com.xhpc.common.core.web.domain.BaseEntity;
* Date:2021-07-27 11 * Date:2021-07-27 11
*/ */
public class XhpcDictionary extends BaseEntity { public class XhpcDictionary extends BaseEntity {
private Long dictBizId; private Long dictBizId;
private Long parentId; private Long parentId;
private String code; private String code;

View File

@ -0,0 +1,18 @@
package com.xhpc.general.domain;
/**
* program: ruoyi
* User: HongYun
* Date:2021-08-02 10
*/
public class XhpcDictionaryChild extends XhpcDictionary {
private String ids;
public String getIds() {
return ids;
}
public void setIds(String ids) {
this.ids = ids;
}
}