Commit b2769f98 authored by pengxin's avatar pengxin

插件编排、应用接入查询接口,不进行分页操作。

parent f0765646
......@@ -54,6 +54,19 @@ public class ApiManageController {
apiManage = apiManageService.saveNew(apiManage);
return ResponseResult.success(apiManage.getApiId());
}
/**
* 列出符合过滤条件的应用接入列表。
*
* @return 应答结果对象,包含查询结果集。
*/
@PostMapping("/load")
public ResponseResult<List<ApiManageVo>> load(@MyRequestBody ApiManageDto apiManageDtoFilter) {
ApiManage apiManageFilter = MyModelUtil.copyTo(apiManageDtoFilter, ApiManage.class);
List<ApiManage> apiManageList = apiManageService.getApiManageList(apiManageFilter, "");
return ResponseResult.success(ApiManage.INSTANCE.fromModelList(apiManageList));
}
/**
* 更新应用接入数据。
*
......@@ -70,7 +83,6 @@ public class ApiManageController {
ApiManage apiManage = MyModelUtil.copyTo(apiManageDto, ApiManage.class);
ApiManage originalApiManage = apiManageService.getById(apiManage.getApiId());
if (originalApiManage == null) {
// NOTE: 修改下面方括号中的话述
errorMessage = "数据验证失败,当前 [数据] 并不存在,请刷新后重试!";
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
}
......
......@@ -63,7 +63,7 @@ public class ModelInstanceController {
private ModelServiceService modelServiceService;
/**
* 新增知识图谱管理数据。
* 新增模型实例管理数据。
*
* @param modelInstanceDto 新增对象。
* @return 应答结果对象,包含新增对象主键Id。
......@@ -119,14 +119,12 @@ public class ModelInstanceController {
ModelInstance modelInstance = modelInstanceService.getById(modelInstanceDto.getInstanceId());
modelInstance.setDeployStatus(ModelConstant.DEPLOY_STATUS_DEPLOYED);
modelInstanceService.updateById(modelInstance);
ResponseResult<String> responseResult = this.doReloadOrStart(modelInstance, type);
if (responseResult.isSuccess()) {
modelInstance.setDeployStatus(ModelConstant.DEPLOY_STATUS_COMPLETE);
modelInstanceService.updateById(modelInstance);
return ResponseResult.success(responseResult.getData());
}
modelInstance.setDeployStatus(ModelConstant.DEPLOY_STATUS_FAILURE);
modelInstanceService.updateById(modelInstance);
return responseResult;
......@@ -203,6 +201,18 @@ public class ModelInstanceController {
}
}
/**
* 列出符合过滤条件的应用接入列表。
*
* @return 应答结果对象,包含查询结果集。
*/
@PostMapping("/load")
public ResponseResult<List<ModelInstanceVo>> load(@MyRequestBody ModelInstanceDto modelInstanceDtoFilter) {
ModelInstance modelInstanceFilter = MyModelUtil.copyTo(modelInstanceDtoFilter, ModelInstance.class);
List<ModelInstance> modelInstanceList = modelInstanceService.getModelInstanceList(modelInstanceFilter, "");
return ResponseResult.success(ModelInstance.INSTANCE.fromModelList(modelInstanceList));
}
/**
* 获取GPU信息。
*
......@@ -228,7 +238,7 @@ public class ModelInstanceController {
}
/**
* 更新知识图谱管理数据。
* 更新模型实例管理数据。
*
* @param modelInstanceDto 更新对象。
* @return 应答结果对象。
......@@ -254,7 +264,7 @@ public class ModelInstanceController {
}
/**
* 删除知识图谱管理数据。
* 删除模型实例管理数据。
*
* @param instanceId 删除对象主键Id。
* @return 应答结果对象。
......@@ -269,19 +279,19 @@ public class ModelInstanceController {
}
/**
* 批量删除知识图谱管理数据。
* 批量删除模型实例管理数据。
*
* @param deployIdList 待删除对象的主键Id列表。
* @param instanceIdList 待删除对象的主键Id列表。
* @return 应答结果对象。
*/
@OperationLog(type = SysOperationLogType.DELETE_BATCH)
@PostMapping("/deleteBatch")
public ResponseResult<Void> deleteBatch(@MyRequestBody List<Long> deployIdList) {
if (MyCommonUtil.existBlankArgument(deployIdList)) {
public ResponseResult<Void> deleteBatch(@MyRequestBody List<Long> instanceIdList) {
if (MyCommonUtil.existBlankArgument(instanceIdList)) {
return ResponseResult.error(ErrorCodeEnum.ARGUMENT_NULL_EXIST);
}
for (Long deployId : deployIdList) {
ResponseResult<Void> responseResult = this.doDelete(deployId);
for (Long instanceId : instanceIdList) {
ResponseResult<Void> responseResult = this.doDelete(instanceId);
if (!responseResult.isSuccess()) {
return responseResult;
}
......@@ -290,7 +300,7 @@ public class ModelInstanceController {
}
/**
* 列出符合过滤条件的知识图谱管理列表。
* 列出符合过滤条件的模型实例管理列表。
*
* @param modelInstanceDtoFilter 过滤对象。
* @param orderParam 排序参数。
......@@ -313,14 +323,14 @@ public class ModelInstanceController {
}
/**
* 查看指定知识图谱管理对象详情。
* 查看指定模型实例管理对象详情。
*
* @param deployId 指定对象主键Id。
* @param instanceId 指定对象主键Id。
* @return 应答结果对象,包含对象详情。
*/
@GetMapping("/view")
public ResponseResult<ModelInstanceVo> view(@RequestParam Long deployId) {
ModelInstance modelInstance = modelInstanceService.getByIdWithRelation(deployId, MyRelationParam.full());
public ResponseResult<ModelInstanceVo> view(@RequestParam Long instanceId) {
ModelInstance modelInstance = modelInstanceService.getByIdWithRelation(instanceId, MyRelationParam.full());
if (modelInstance == null) {
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
}
......@@ -328,16 +338,20 @@ public class ModelInstanceController {
return ResponseResult.success(modelInstanceVo);
}
private ResponseResult<Void> doDelete(Long deployId) {
/**
* 模型实例标识
* @param instanceId 实例ID
* @return 响应消息
*/
private ResponseResult<Void> doDelete(Long instanceId) {
String errorMessage;
// 验证关联Id的数据合法性
ModelInstance originalModelInstance = modelInstanceService.getById(deployId);
ModelInstance originalModelInstance = modelInstanceService.getById(instanceId);
if (originalModelInstance == null) {
// NOTE: 修改下面方括号中的话述
errorMessage = "数据验证失败,当前 [对象] 并不存在,请刷新后重试!";
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
}
if (!modelInstanceService.remove(deployId)) {
if (!modelInstanceService.remove(instanceId)) {
errorMessage = "数据操作失败,删除的对象不存在,请刷新后重试!";
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
}
......
......@@ -156,6 +156,11 @@ public class ModelServiceController {
return ResponseResult.success(modelServiceVo);
}
/**
* 根据服务标识进行删除
* @param serviceId 模型服务标识
* @return 响应内容
*/
private ResponseResult<Void> doDelete(Long serviceId) {
String errorMessage;
// 验证关联Id的数据合法性
......
......@@ -141,6 +141,19 @@ public class PluginManageController {
return ResponseResult.success(MyPageUtil.makeResponseData(pluginManageList, PluginManage.INSTANCE));
}
/**
* 列出符合过滤条件的知识图谱管理列表。
*
* @param pluginManageDtoFilter 过滤对象。
* @return 应答结果对象,包含查询结果集。
*/
@PostMapping("/load")
public ResponseResult<List<PluginManageVo>> load(@MyRequestBody PluginManageDto pluginManageDtoFilter) {
PluginManage pluginManageFilter = MyModelUtil.copyTo(pluginManageDtoFilter, PluginManage.class);
List<PluginManage> pluginManageList = pluginManageService.getPluginManageList(pluginManageFilter, "");
return ResponseResult.success(PluginManage.INSTANCE.fromModelList(pluginManageList));
}
/**
* 查看指定知识图谱管理对象详情。
*
......
......@@ -55,6 +55,13 @@
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
<sql id="inputFilterRef">
<if test="modelInstanceFilter != null">
<if test="modelInstanceFilter.deployStatus != null">
AND lmp_model_instance.deploy_status = #{modelInstanceFilter.deployStatus}
</if>
<if test="modelInstanceFilter.serviceName != null">
<bind name="safeServiceName" value="'%' + modelInstanceFilter.serviceName + '%'"/>
AND IFNULL(lmp_model_service.service_name,'') LIKE #{safeServiceName}
</if>
</if>
</sql>
......
package com.yice.webadmin.app.service;
import com.yice.webadmin.app.model.*;
import com.yice.common.core.base.service.IBaseService;
import com.yice.webadmin.app.model.PluginManage;
import java.util.*;
import java.util.List;
/**
* 知识图谱管理数据操作服务接口。
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment