Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lmp_server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lmp
lmp_server
Commits
b2769f98
Commit
b2769f98
authored
May 20, 2024
by
pengxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
插件编排、应用接入查询接口,不进行分页操作。
parent
f0765646
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
23 deletions
+74
-23
ApiManageController.java
...com/yice/webadmin/app/controller/ApiManageController.java
+13
-1
ModelInstanceController.java
...yice/webadmin/app/controller/ModelInstanceController.java
+34
-20
ModelServiceController.java
.../yice/webadmin/app/controller/ModelServiceController.java
+5
-0
PluginManageController.java
.../yice/webadmin/app/controller/PluginManageController.java
+13
-0
ModelInstanceMapper.xml
.../com/yice/webadmin/app/dao/mapper/ModelInstanceMapper.xml
+7
-0
PluginManageService.java
...va/com/yice/webadmin/app/service/PluginManageService.java
+2
-2
No files found.
application-webadmin/src/main/java/com/yice/webadmin/app/controller/ApiManageController.java
View file @
b2769f98
...
...
@@ -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
);
}
...
...
application-webadmin/src/main/java/com/yice/webadmin/app/controller/ModelInstanceController.java
View file @
b2769f98
...
...
@@ -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
deploy
IdList 待删除对象的主键Id列表。
* @param
instance
IdList 待删除对象的主键Id列表。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
DELETE_BATCH
)
@PostMapping
(
"/deleteBatch"
)
public
ResponseResult
<
Void
>
deleteBatch
(
@MyRequestBody
List
<
Long
>
deploy
IdList
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
deploy
IdList
))
{
public
ResponseResult
<
Void
>
deleteBatch
(
@MyRequestBody
List
<
Long
>
instance
IdList
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
instance
IdList
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
ARGUMENT_NULL_EXIST
);
}
for
(
Long
deployId
:
deploy
IdList
)
{
ResponseResult
<
Void
>
responseResult
=
this
.
doDelete
(
deploy
Id
);
for
(
Long
instanceId
:
instance
IdList
)
{
ResponseResult
<
Void
>
responseResult
=
this
.
doDelete
(
instance
Id
);
if
(!
responseResult
.
isSuccess
())
{
return
responseResult
;
}
...
...
@@ -290,7 +300,7 @@ public class ModelInstanceController {
}
/**
* 列出符合过滤条件的
知识图谱
管理列表。
* 列出符合过滤条件的
模型实例
管理列表。
*
* @param modelInstanceDtoFilter 过滤对象。
* @param orderParam 排序参数。
...
...
@@ -313,14 +323,14 @@ public class ModelInstanceController {
}
/**
* 查看指定
知识图谱
管理对象详情。
* 查看指定
模型实例
管理对象详情。
*
* @param
deploy
Id 指定对象主键Id。
* @param
instance
Id 指定对象主键Id。
* @return 应答结果对象,包含对象详情。
*/
@GetMapping
(
"/view"
)
public
ResponseResult
<
ModelInstanceVo
>
view
(
@RequestParam
Long
deploy
Id
)
{
ModelInstance
modelInstance
=
modelInstanceService
.
getByIdWithRelation
(
deploy
Id
,
MyRelationParam
.
full
());
public
ResponseResult
<
ModelInstanceVo
>
view
(
@RequestParam
Long
instance
Id
)
{
ModelInstance
modelInstance
=
modelInstanceService
.
getByIdWithRelation
(
instance
Id
,
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
(
deploy
Id
);
ModelInstance
originalModelInstance
=
modelInstanceService
.
getById
(
instance
Id
);
if
(
originalModelInstance
==
null
)
{
// NOTE: 修改下面方括号中的话述
errorMessage
=
"数据验证失败,当前 [对象] 并不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
if
(!
modelInstanceService
.
remove
(
deploy
Id
))
{
if
(!
modelInstanceService
.
remove
(
instance
Id
))
{
errorMessage
=
"数据操作失败,删除的对象不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
...
...
application-webadmin/src/main/java/com/yice/webadmin/app/controller/ModelServiceController.java
View file @
b2769f98
...
...
@@ -156,6 +156,11 @@ public class ModelServiceController {
return
ResponseResult
.
success
(
modelServiceVo
);
}
/**
* 根据服务标识进行删除
* @param serviceId 模型服务标识
* @return 响应内容
*/
private
ResponseResult
<
Void
>
doDelete
(
Long
serviceId
)
{
String
errorMessage
;
// 验证关联Id的数据合法性
...
...
application-webadmin/src/main/java/com/yice/webadmin/app/controller/PluginManageController.java
View file @
b2769f98
...
...
@@ -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
));
}
/**
* 查看指定知识图谱管理对象详情。
*
...
...
application-webadmin/src/main/java/com/yice/webadmin/app/dao/mapper/ModelInstanceMapper.xml
View file @
b2769f98
...
...
@@ -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>
...
...
application-webadmin/src/main/java/com/yice/webadmin/app/service/PluginManageService.java
View file @
b2769f98
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
;
/**
* 知识图谱管理数据操作服务接口。
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment