|
@@ -1,14 +1,12 @@
|
|
|
package com.persagy.proxy.adm.controller;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
-import com.alibaba.fastjson.JSONArray;
|
|
|
import com.persagy.proxy.adm.constant.AdmCommonConstant;
|
|
|
-import com.persagy.proxy.adm.model.AdmEquipment;
|
|
|
+import com.persagy.proxy.adm.model.AdmComponent;
|
|
|
import com.persagy.proxy.adm.request.AdmCreateRequest;
|
|
|
import com.persagy.proxy.adm.request.AdmQueryCriteria;
|
|
|
import com.persagy.proxy.adm.request.AdmResponse;
|
|
|
-import com.persagy.proxy.adm.service.IAdmEquipmentService;
|
|
|
-import com.persagy.proxy.common.entity.DmpResult;
|
|
|
+import com.persagy.proxy.adm.service.IAdmComponentService;
|
|
|
import com.persagy.proxy.common.entity.InstanceUrlParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -30,7 +28,7 @@ import java.util.List;
|
|
|
@RequestMapping("/object/component")
|
|
|
public class AdmComponentController {
|
|
|
@Autowired
|
|
|
- private IAdmEquipmentService service;
|
|
|
+ private IAdmComponentService service;
|
|
|
@Value("${middleware.group.code}")
|
|
|
private String groupCode;
|
|
|
|
|
@@ -48,7 +46,7 @@ public class AdmComponentController {
|
|
|
InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
|
|
|
request.setName("component");
|
|
|
request.setOnlyCount(true);
|
|
|
- return service.doQuery(context, request, AdmEquipment.class);
|
|
|
+ return service.doQuery(context, request, AdmComponent.class);
|
|
|
}
|
|
|
/**
|
|
|
* 创建
|
|
@@ -57,11 +55,11 @@ public class AdmComponentController {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@PostMapping("/create")
|
|
|
- public AdmResponse create(@RequestBody AdmCreateRequest<AdmEquipment> createRequest, @QueryParam("projectId") String projectId) throws Exception {
|
|
|
+ public AdmResponse create(@RequestBody AdmCreateRequest<AdmComponent> createRequest, @QueryParam("projectId") String projectId) throws Exception {
|
|
|
// 组装上下文条件
|
|
|
InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
|
|
|
- List<AdmEquipment> vos = CollUtil.newArrayList(createRequest.getContent());
|
|
|
- vos = service.doInsert(context, AdmEquipment.class, vos);
|
|
|
+ List<AdmComponent> vos = CollUtil.newArrayList(createRequest.getContent());
|
|
|
+ vos = service.doInsertExt(context, AdmComponent.class, vos);
|
|
|
return AdmResponse.success(vos);
|
|
|
}
|
|
|
|
|
@@ -72,7 +70,7 @@ public class AdmComponentController {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@PostMapping("/delete")
|
|
|
- public AdmResponse delete(@QueryParam("projectId") String projectId, @RequestBody List<AdmEquipment> vos) throws Exception {
|
|
|
+ public AdmResponse delete(@QueryParam("projectId") String projectId, @RequestBody List<AdmComponent> vos) throws Exception {
|
|
|
// 组装上下文条件
|
|
|
InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
|
|
|
service.doDelete(context, vos);
|
|
@@ -86,11 +84,11 @@ public class AdmComponentController {
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
@PostMapping("/update")
|
|
|
- public AdmResponse update(@RequestBody AdmCreateRequest<AdmEquipment> createRequest, @QueryParam("projectId") String projectId) throws Exception {
|
|
|
+ public AdmResponse update(@RequestBody AdmCreateRequest<AdmComponent> createRequest, @QueryParam("projectId") String projectId) throws Exception {
|
|
|
// 组装上下文条件
|
|
|
InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
|
|
|
- List<AdmEquipment> vos = CollUtil.newArrayList(createRequest.getContent());
|
|
|
- vos = service.doUpdate(context, AdmEquipment.class, vos);
|
|
|
+ List<AdmComponent> vos = CollUtil.newArrayList(createRequest.getContent());
|
|
|
+ vos = service.doUpdate(context, AdmComponent.class, vos);
|
|
|
return AdmResponse.success(vos);
|
|
|
}
|
|
|
|
|
@@ -107,6 +105,6 @@ public class AdmComponentController {
|
|
|
// 组装上下文条件
|
|
|
InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
|
|
|
request.setName("component");
|
|
|
- return service.doQuery(context, request, AdmEquipment.class);
|
|
|
+ return service.doQuery(context, request, AdmComponent.class);
|
|
|
}
|
|
|
}
|