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
2a1e163c
Commit
2a1e163c
authored
May 09, 2024
by
pengxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应用接入与插件编排新增。
parent
d4cd01a8
Changes
44
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
2893 additions
and
8 deletions
+2893
-8
ModelInstanceController.java
...yice/webadmin/app/controller/ModelInstanceController.java
+174
-0
ModelServiceController.java
.../yice/webadmin/app/controller/ModelServiceController.java
+174
-0
PluginConfigController.java
.../yice/webadmin/app/controller/PluginConfigController.java
+174
-0
PluginManageController.java
.../yice/webadmin/app/controller/PluginManageController.java
+174
-0
ApiPluginMapper.java
.../main/java/com/yice/webadmin/app/dao/ApiPluginMapper.java
+22
-0
ApiServiceMapper.java
...main/java/com/yice/webadmin/app/dao/ApiServiceMapper.java
+22
-0
ModelInstanceMapper.java
...n/java/com/yice/webadmin/app/dao/ModelInstanceMapper.java
+33
-0
ModelServiceMapper.java
...in/java/com/yice/webadmin/app/dao/ModelServiceMapper.java
+33
-0
PluginConfigMapper.java
...in/java/com/yice/webadmin/app/dao/PluginConfigMapper.java
+33
-0
PluginManageMapper.java
...in/java/com/yice/webadmin/app/dao/PluginManageMapper.java
+33
-0
ApiManageMapper.xml
...java/com/yice/webadmin/app/dao/mapper/ApiManageMapper.xml
+7
-3
ApiPluginMapper.xml
...java/com/yice/webadmin/app/dao/mapper/ApiPluginMapper.xml
+19
-0
ApiServiceMapper.xml
...ava/com/yice/webadmin/app/dao/mapper/ApiServiceMapper.xml
+19
-0
ModelInstanceMapper.xml
.../com/yice/webadmin/app/dao/mapper/ModelInstanceMapper.xml
+62
-0
ModelServiceMapper.xml
...a/com/yice/webadmin/app/dao/mapper/ModelServiceMapper.xml
+65
-0
PluginConfigMapper.xml
...a/com/yice/webadmin/app/dao/mapper/PluginConfigMapper.xml
+80
-0
PluginManageMapper.xml
...a/com/yice/webadmin/app/dao/mapper/PluginManageMapper.xml
+68
-0
ApiManageDto.java
...src/main/java/com/yice/webadmin/app/dto/ApiManageDto.java
+2
-2
ModelInstanceDto.java
...main/java/com/yice/webadmin/app/dto/ModelInstanceDto.java
+51
-0
ModelServiceDto.java
.../main/java/com/yice/webadmin/app/dto/ModelServiceDto.java
+56
-0
PluginConfigDto.java
.../main/java/com/yice/webadmin/app/dto/PluginConfigDto.java
+87
-0
PluginManageDto.java
.../main/java/com/yice/webadmin/app/dto/PluginManageDto.java
+51
-0
ApiManage.java
.../src/main/java/com/yice/webadmin/app/model/ApiManage.java
+1
-1
ApiPlugin.java
.../src/main/java/com/yice/webadmin/app/model/ApiPlugin.java
+25
-0
ApiService.java
...src/main/java/com/yice/webadmin/app/model/ApiService.java
+25
-0
ModelInstance.java
.../main/java/com/yice/webadmin/app/model/ModelInstance.java
+55
-0
ModelService.java
...c/main/java/com/yice/webadmin/app/model/ModelService.java
+60
-0
PluginConfig.java
...c/main/java/com/yice/webadmin/app/model/PluginConfig.java
+87
-0
PluginManage.java
...c/main/java/com/yice/webadmin/app/model/PluginManage.java
+56
-0
ModelInstanceService.java
...a/com/yice/webadmin/app/service/ModelInstanceService.java
+68
-0
ModelServiceService.java
...va/com/yice/webadmin/app/service/ModelServiceService.java
+68
-0
PluginConfigService.java
...va/com/yice/webadmin/app/service/PluginConfigService.java
+68
-0
PluginManageService.java
...va/com/yice/webadmin/app/service/PluginManageService.java
+68
-0
ApiManageServiceImpl.java
.../yice/webadmin/app/service/impl/ApiManageServiceImpl.java
+4
-0
ModelInstanceServiceImpl.java
...e/webadmin/app/service/impl/ModelInstanceServiceImpl.java
+140
-0
ModelServiceServiceImpl.java
...ce/webadmin/app/service/impl/ModelServiceServiceImpl.java
+140
-0
PluginConfigServiceImpl.java
...ce/webadmin/app/service/impl/PluginConfigServiceImpl.java
+140
-0
PluginManageServiceImpl.java
...ce/webadmin/app/service/impl/PluginManageServiceImpl.java
+134
-0
GenerateUtil.java
...rc/main/java/com/yice/webadmin/app/util/GenerateUtil.java
+71
-0
ApiManageVo.java
...n/src/main/java/com/yice/webadmin/app/vo/ApiManageVo.java
+2
-2
ModelInstanceVo.java
...c/main/java/com/yice/webadmin/app/vo/ModelInstanceVo.java
+49
-0
ModelServiceVo.java
...rc/main/java/com/yice/webadmin/app/vo/ModelServiceVo.java
+57
-0
PluginConfigVo.java
...rc/main/java/com/yice/webadmin/app/vo/PluginConfigVo.java
+87
-0
PluginManageVo.java
...rc/main/java/com/yice/webadmin/app/vo/PluginManageVo.java
+49
-0
No files found.
application-webadmin/src/main/java/com/yice/webadmin/app/controller/ModelInstanceController.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
controller
;
import
com.github.pagehelper.page.PageMethod
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.yice.common.core.annotation.MyRequestBody
;
import
com.yice.common.core.constant.ErrorCodeEnum
;
import
com.yice.common.core.object.*
;
import
com.yice.common.core.util.MyCommonUtil
;
import
com.yice.common.core.util.MyModelUtil
;
import
com.yice.common.core.util.MyPageUtil
;
import
com.yice.common.log.annotation.OperationLog
;
import
com.yice.common.log.model.constant.SysOperationLogType
;
import
com.yice.webadmin.app.dto.ModelInstanceDto
;
import
com.yice.webadmin.app.model.ModelInstance
;
import
com.yice.webadmin.app.service.ModelInstanceService
;
import
com.yice.webadmin.app.vo.ModelInstanceVo
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 模型实例管理操作控制器类。
*
* @author linking
* @date 2023-04-13
*/
@Api
(
tags
=
"模型实例管理接口"
)
@Slf4j
@RestController
@RequestMapping
(
"/admin/app/modelInstance"
)
public
class
ModelInstanceController
{
@Autowired
private
ModelInstanceService
modelInstanceService
;
/**
* 新增知识图谱管理数据。
*
* @param modelInstanceDto 新增对象。
* @return 应答结果对象,包含新增对象主键Id。
*/
@ApiOperationSupport
(
ignoreParameters
=
{
"modelInstanceDto.deployId"
})
@OperationLog
(
type
=
SysOperationLogType
.
ADD
)
@PostMapping
(
"/add"
)
public
ResponseResult
<
Long
>
add
(
@MyRequestBody
ModelInstanceDto
modelInstanceDto
)
{
String
errorMessage
=
MyCommonUtil
.
getModelValidationError
(
modelInstanceDto
,
false
);
if
(
errorMessage
!=
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_VALIDATED_FAILED
,
errorMessage
);
}
ModelInstance
modelInstance
=
MyModelUtil
.
copyTo
(
modelInstanceDto
,
ModelInstance
.
class
);
modelInstance
=
modelInstanceService
.
saveNew
(
modelInstance
);
return
ResponseResult
.
success
(
modelInstance
.
getDeployId
());
}
/**
* 更新知识图谱管理数据。
*
* @param modelInstanceDto 更新对象。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
UPDATE
)
@PostMapping
(
"/update"
)
public
ResponseResult
<
Void
>
update
(
@MyRequestBody
ModelInstanceDto
modelInstanceDto
)
{
String
errorMessage
=
MyCommonUtil
.
getModelValidationError
(
modelInstanceDto
,
true
);
if
(
errorMessage
!=
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_VALIDATED_FAILED
,
errorMessage
);
}
ModelInstance
modelInstance
=
MyModelUtil
.
copyTo
(
modelInstanceDto
,
ModelInstance
.
class
);
ModelInstance
originalModelInstance
=
modelInstanceService
.
getById
(
modelInstance
.
getDeployId
());
if
(
originalModelInstance
==
null
)
{
// NOTE: 修改下面方括号中的话述
errorMessage
=
"数据验证失败,当前 [数据] 并不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
if
(!
modelInstanceService
.
update
(
modelInstance
,
originalModelInstance
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
);
}
return
ResponseResult
.
success
();
}
/**
* 删除知识图谱管理数据。
*
* @param deployId 删除对象主键Id。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
DELETE
)
@PostMapping
(
"/delete"
)
public
ResponseResult
<
Void
>
delete
(
@MyRequestBody
Long
deployId
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
deployId
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
ARGUMENT_NULL_EXIST
);
}
return
this
.
doDelete
(
deployId
);
}
/**
* 批量删除知识图谱管理数据。
*
* @param deployIdList 待删除对象的主键Id列表。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
DELETE_BATCH
)
@PostMapping
(
"/deleteBatch"
)
public
ResponseResult
<
Void
>
deleteBatch
(
@MyRequestBody
List
<
Long
>
deployIdList
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
deployIdList
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
ARGUMENT_NULL_EXIST
);
}
for
(
Long
deployId
:
deployIdList
)
{
ResponseResult
<
Void
>
responseResult
=
this
.
doDelete
(
deployId
);
if
(!
responseResult
.
isSuccess
())
{
return
responseResult
;
}
}
return
ResponseResult
.
success
();
}
/**
* 列出符合过滤条件的知识图谱管理列表。
*
* @param modelInstanceDtoFilter 过滤对象。
* @param orderParam 排序参数。
* @param pageParam 分页参数。
* @return 应答结果对象,包含查询结果集。
*/
@PostMapping
(
"/list"
)
public
ResponseResult
<
MyPageData
<
ModelInstanceVo
>>
list
(
@MyRequestBody
ModelInstanceDto
modelInstanceDtoFilter
,
@MyRequestBody
MyOrderParam
orderParam
,
@MyRequestBody
MyPageParam
pageParam
)
{
if
(
pageParam
!=
null
)
{
PageMethod
.
startPage
(
pageParam
.
getPageNum
(),
pageParam
.
getPageSize
());
}
ModelInstance
modelInstanceFilter
=
MyModelUtil
.
copyTo
(
modelInstanceDtoFilter
,
ModelInstance
.
class
);
String
orderBy
=
MyOrderParam
.
buildOrderBy
(
orderParam
,
ModelInstance
.
class
);
List
<
ModelInstance
>
modelInstanceList
=
modelInstanceService
.
getModelInstanceListWithRelation
(
modelInstanceFilter
,
orderBy
);
return
ResponseResult
.
success
(
MyPageUtil
.
makeResponseData
(
modelInstanceList
,
ModelInstance
.
INSTANCE
));
}
/**
* 查看指定知识图谱管理对象详情。
*
* @param deployId 指定对象主键Id。
* @return 应答结果对象,包含对象详情。
*/
@GetMapping
(
"/view"
)
public
ResponseResult
<
ModelInstanceVo
>
view
(
@RequestParam
Long
deployId
)
{
ModelInstance
modelInstance
=
modelInstanceService
.
getByIdWithRelation
(
deployId
,
MyRelationParam
.
full
());
if
(
modelInstance
==
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
);
}
ModelInstanceVo
modelInstanceVo
=
MyModelUtil
.
copyTo
(
modelInstance
,
ModelInstanceVo
.
class
);
return
ResponseResult
.
success
(
modelInstanceVo
);
}
private
ResponseResult
<
Void
>
doDelete
(
Long
deployId
)
{
String
errorMessage
;
// 验证关联Id的数据合法性
ModelInstance
originalModelInstance
=
modelInstanceService
.
getById
(
deployId
);
if
(
originalModelInstance
==
null
)
{
// NOTE: 修改下面方括号中的话述
errorMessage
=
"数据验证失败,当前 [对象] 并不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
if
(!
modelInstanceService
.
remove
(
deployId
))
{
errorMessage
=
"数据操作失败,删除的对象不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
return
ResponseResult
.
success
();
}
}
application-webadmin/src/main/java/com/yice/webadmin/app/controller/ModelServiceController.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
controller
;
import
com.github.pagehelper.page.PageMethod
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.yice.common.core.annotation.MyRequestBody
;
import
com.yice.common.core.constant.ErrorCodeEnum
;
import
com.yice.common.core.object.*
;
import
com.yice.common.core.util.MyCommonUtil
;
import
com.yice.common.core.util.MyModelUtil
;
import
com.yice.common.core.util.MyPageUtil
;
import
com.yice.common.log.annotation.OperationLog
;
import
com.yice.common.log.model.constant.SysOperationLogType
;
import
com.yice.webadmin.app.dto.ModelServiceDto
;
import
com.yice.webadmin.app.model.ModelService
;
import
com.yice.webadmin.app.service.ModelServiceService
;
import
com.yice.webadmin.app.vo.ModelServiceVo
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 模型服务管理操作控制器类。
*
* @author linking
* @date 2023-04-13
*/
@Api
(
tags
=
"模型服务管理接口"
)
@Slf4j
@RestController
@RequestMapping
(
"/admin/app/modelService"
)
public
class
ModelServiceController
{
@Autowired
private
ModelServiceService
modelServiceService
;
/**
* 新增知识图谱管理数据。
*
* @param modelServiceDto 新增对象。
* @return 应答结果对象,包含新增对象主键Id。
*/
@ApiOperationSupport
(
ignoreParameters
=
{
"modelServiceDto.serviceId"
})
@OperationLog
(
type
=
SysOperationLogType
.
ADD
)
@PostMapping
(
"/add"
)
public
ResponseResult
<
Long
>
add
(
@MyRequestBody
ModelServiceDto
modelServiceDto
)
{
String
errorMessage
=
MyCommonUtil
.
getModelValidationError
(
modelServiceDto
,
false
);
if
(
errorMessage
!=
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_VALIDATED_FAILED
,
errorMessage
);
}
ModelService
modelService
=
MyModelUtil
.
copyTo
(
modelServiceDto
,
ModelService
.
class
);
modelService
=
modelServiceService
.
saveNew
(
modelService
);
return
ResponseResult
.
success
(
modelService
.
getServiceId
());
}
/**
* 更新知识图谱管理数据。
*
* @param modelServiceDto 更新对象。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
UPDATE
)
@PostMapping
(
"/update"
)
public
ResponseResult
<
Void
>
update
(
@MyRequestBody
ModelServiceDto
modelServiceDto
)
{
String
errorMessage
=
MyCommonUtil
.
getModelValidationError
(
modelServiceDto
,
true
);
if
(
errorMessage
!=
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_VALIDATED_FAILED
,
errorMessage
);
}
ModelService
modelService
=
MyModelUtil
.
copyTo
(
modelServiceDto
,
ModelService
.
class
);
ModelService
originalModelService
=
modelServiceService
.
getById
(
modelService
.
getServiceId
());
if
(
originalModelService
==
null
)
{
// NOTE: 修改下面方括号中的话述
errorMessage
=
"数据验证失败,当前 [数据] 并不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
if
(!
modelServiceService
.
update
(
modelService
,
originalModelService
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
);
}
return
ResponseResult
.
success
();
}
/**
* 删除知识图谱管理数据。
*
* @param serviceId 删除对象主键Id。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
DELETE
)
@PostMapping
(
"/delete"
)
public
ResponseResult
<
Void
>
delete
(
@MyRequestBody
Long
serviceId
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
serviceId
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
ARGUMENT_NULL_EXIST
);
}
return
this
.
doDelete
(
serviceId
);
}
/**
* 批量删除知识图谱管理数据。
*
* @param serviceIdList 待删除对象的主键Id列表。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
DELETE_BATCH
)
@PostMapping
(
"/deleteBatch"
)
public
ResponseResult
<
Void
>
deleteBatch
(
@MyRequestBody
List
<
Long
>
serviceIdList
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
serviceIdList
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
ARGUMENT_NULL_EXIST
);
}
for
(
Long
serviceId
:
serviceIdList
)
{
ResponseResult
<
Void
>
responseResult
=
this
.
doDelete
(
serviceId
);
if
(!
responseResult
.
isSuccess
())
{
return
responseResult
;
}
}
return
ResponseResult
.
success
();
}
/**
* 列出符合过滤条件的知识图谱管理列表。
*
* @param modelServiceDtoFilter 过滤对象。
* @param orderParam 排序参数。
* @param pageParam 分页参数。
* @return 应答结果对象,包含查询结果集。
*/
@PostMapping
(
"/list"
)
public
ResponseResult
<
MyPageData
<
ModelServiceVo
>>
list
(
@MyRequestBody
ModelServiceDto
modelServiceDtoFilter
,
@MyRequestBody
MyOrderParam
orderParam
,
@MyRequestBody
MyPageParam
pageParam
)
{
if
(
pageParam
!=
null
)
{
PageMethod
.
startPage
(
pageParam
.
getPageNum
(),
pageParam
.
getPageSize
());
}
ModelService
modelServiceFilter
=
MyModelUtil
.
copyTo
(
modelServiceDtoFilter
,
ModelService
.
class
);
String
orderBy
=
MyOrderParam
.
buildOrderBy
(
orderParam
,
ModelService
.
class
);
List
<
ModelService
>
modelServiceList
=
modelServiceService
.
getModelServiceListWithRelation
(
modelServiceFilter
,
orderBy
);
return
ResponseResult
.
success
(
MyPageUtil
.
makeResponseData
(
modelServiceList
,
ModelService
.
INSTANCE
));
}
/**
* 查看指定知识图谱管理对象详情。
*
* @param serviceId 指定对象主键Id。
* @return 应答结果对象,包含对象详情。
*/
@GetMapping
(
"/view"
)
public
ResponseResult
<
ModelServiceVo
>
view
(
@RequestParam
Long
serviceId
)
{
ModelService
modelService
=
modelServiceService
.
getByIdWithRelation
(
serviceId
,
MyRelationParam
.
full
());
if
(
modelService
==
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
);
}
ModelServiceVo
modelServiceVo
=
MyModelUtil
.
copyTo
(
modelService
,
ModelServiceVo
.
class
);
return
ResponseResult
.
success
(
modelServiceVo
);
}
private
ResponseResult
<
Void
>
doDelete
(
Long
serviceId
)
{
String
errorMessage
;
// 验证关联Id的数据合法性
ModelService
originalModelService
=
modelServiceService
.
getById
(
serviceId
);
if
(
originalModelService
==
null
)
{
// NOTE: 修改下面方括号中的话述
errorMessage
=
"数据验证失败,当前 [对象] 并不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
if
(!
modelServiceService
.
remove
(
serviceId
))
{
errorMessage
=
"数据操作失败,删除的对象不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
return
ResponseResult
.
success
();
}
}
application-webadmin/src/main/java/com/yice/webadmin/app/controller/PluginConfigController.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
controller
;
import
com.github.pagehelper.page.PageMethod
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.yice.common.core.annotation.MyRequestBody
;
import
com.yice.common.core.constant.ErrorCodeEnum
;
import
com.yice.common.core.object.*
;
import
com.yice.common.core.util.MyCommonUtil
;
import
com.yice.common.core.util.MyModelUtil
;
import
com.yice.common.core.util.MyPageUtil
;
import
com.yice.common.log.annotation.OperationLog
;
import
com.yice.common.log.model.constant.SysOperationLogType
;
import
com.yice.webadmin.app.dto.PluginConfigDto
;
import
com.yice.webadmin.app.model.PluginConfig
;
import
com.yice.webadmin.app.service.PluginConfigService
;
import
com.yice.webadmin.app.vo.PluginConfigVo
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 插件编排配置管理操作控制器类。
*
* @author linking
* @date 2023-04-13
*/
@Api
(
tags
=
"插件编排配置管理接口"
)
@Slf4j
@RestController
@RequestMapping
(
"/admin/app/pluginConfig"
)
public
class
PluginConfigController
{
@Autowired
private
PluginConfigService
pluginConfigService
;
/**
* 新增知识图谱管理数据。
*
* @param pluginConfigDto 新增对象。
* @return 应答结果对象,包含新增对象主键Id。
*/
@ApiOperationSupport
(
ignoreParameters
=
{
"pluginConfigDto.configId"
})
@OperationLog
(
type
=
SysOperationLogType
.
ADD
)
@PostMapping
(
"/add"
)
public
ResponseResult
<
Long
>
add
(
@MyRequestBody
PluginConfigDto
pluginConfigDto
)
{
String
errorMessage
=
MyCommonUtil
.
getModelValidationError
(
pluginConfigDto
,
false
);
if
(
errorMessage
!=
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_VALIDATED_FAILED
,
errorMessage
);
}
PluginConfig
pluginConfig
=
MyModelUtil
.
copyTo
(
pluginConfigDto
,
PluginConfig
.
class
);
pluginConfig
=
pluginConfigService
.
saveNew
(
pluginConfig
);
return
ResponseResult
.
success
(
pluginConfig
.
getConfigId
());
}
/**
* 更新知识图谱管理数据。
*
* @param pluginConfigDto 更新对象。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
UPDATE
)
@PostMapping
(
"/update"
)
public
ResponseResult
<
Void
>
update
(
@MyRequestBody
PluginConfigDto
pluginConfigDto
)
{
String
errorMessage
=
MyCommonUtil
.
getModelValidationError
(
pluginConfigDto
,
true
);
if
(
errorMessage
!=
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_VALIDATED_FAILED
,
errorMessage
);
}
PluginConfig
pluginConfig
=
MyModelUtil
.
copyTo
(
pluginConfigDto
,
PluginConfig
.
class
);
PluginConfig
originalPluginConfig
=
pluginConfigService
.
getById
(
pluginConfig
.
getConfigId
());
if
(
originalPluginConfig
==
null
)
{
// NOTE: 修改下面方括号中的话述
errorMessage
=
"数据验证失败,当前 [数据] 并不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
if
(!
pluginConfigService
.
update
(
pluginConfig
,
originalPluginConfig
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
);
}
return
ResponseResult
.
success
();
}
/**
* 删除知识图谱管理数据。
*
* @param configId 删除对象主键Id。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
DELETE
)
@PostMapping
(
"/delete"
)
public
ResponseResult
<
Void
>
delete
(
@MyRequestBody
Long
configId
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
configId
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
ARGUMENT_NULL_EXIST
);
}
return
this
.
doDelete
(
configId
);
}
/**
* 批量删除知识图谱管理数据。
*
* @param configIdList 待删除对象的主键Id列表。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
DELETE_BATCH
)
@PostMapping
(
"/deleteBatch"
)
public
ResponseResult
<
Void
>
deleteBatch
(
@MyRequestBody
List
<
Long
>
configIdList
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
configIdList
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
ARGUMENT_NULL_EXIST
);
}
for
(
Long
configId
:
configIdList
)
{
ResponseResult
<
Void
>
responseResult
=
this
.
doDelete
(
configId
);
if
(!
responseResult
.
isSuccess
())
{
return
responseResult
;
}
}
return
ResponseResult
.
success
();
}
/**
* 列出符合过滤条件的知识图谱管理列表。
*
* @param pluginConfigDtoFilter 过滤对象。
* @param orderParam 排序参数。
* @param pageParam 分页参数。
* @return 应答结果对象,包含查询结果集。
*/
@PostMapping
(
"/list"
)
public
ResponseResult
<
MyPageData
<
PluginConfigVo
>>
list
(
@MyRequestBody
PluginConfigDto
pluginConfigDtoFilter
,
@MyRequestBody
MyOrderParam
orderParam
,
@MyRequestBody
MyPageParam
pageParam
)
{
if
(
pageParam
!=
null
)
{
PageMethod
.
startPage
(
pageParam
.
getPageNum
(),
pageParam
.
getPageSize
());
}
PluginConfig
pluginConfigFilter
=
MyModelUtil
.
copyTo
(
pluginConfigDtoFilter
,
PluginConfig
.
class
);
String
orderBy
=
MyOrderParam
.
buildOrderBy
(
orderParam
,
PluginConfig
.
class
);
List
<
PluginConfig
>
pluginConfigList
=
pluginConfigService
.
getPluginConfigListWithRelation
(
pluginConfigFilter
,
orderBy
);
return
ResponseResult
.
success
(
MyPageUtil
.
makeResponseData
(
pluginConfigList
,
PluginConfig
.
INSTANCE
));
}
/**
* 查看指定知识图谱管理对象详情。
*
* @param configId 指定对象主键Id。
* @return 应答结果对象,包含对象详情。
*/
@GetMapping
(
"/view"
)
public
ResponseResult
<
PluginConfigVo
>
view
(
@RequestParam
Long
configId
)
{
PluginConfig
pluginConfig
=
pluginConfigService
.
getByIdWithRelation
(
configId
,
MyRelationParam
.
full
());
if
(
pluginConfig
==
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
);
}
PluginConfigVo
pluginConfigVo
=
MyModelUtil
.
copyTo
(
pluginConfig
,
PluginConfigVo
.
class
);
return
ResponseResult
.
success
(
pluginConfigVo
);
}
private
ResponseResult
<
Void
>
doDelete
(
Long
configId
)
{
String
errorMessage
;
// 验证关联Id的数据合法性
PluginConfig
originalPluginConfig
=
pluginConfigService
.
getById
(
configId
);
if
(
originalPluginConfig
==
null
)
{
// NOTE: 修改下面方括号中的话述
errorMessage
=
"数据验证失败,当前 [对象] 并不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
if
(!
pluginConfigService
.
remove
(
configId
))
{
errorMessage
=
"数据操作失败,删除的对象不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
return
ResponseResult
.
success
();
}
}
application-webadmin/src/main/java/com/yice/webadmin/app/controller/PluginManageController.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
controller
;
import
com.github.pagehelper.page.PageMethod
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.yice.common.core.annotation.MyRequestBody
;
import
com.yice.common.core.constant.ErrorCodeEnum
;
import
com.yice.common.core.object.*
;
import
com.yice.common.core.util.MyCommonUtil
;
import
com.yice.common.core.util.MyModelUtil
;
import
com.yice.common.core.util.MyPageUtil
;
import
com.yice.common.log.annotation.OperationLog
;
import
com.yice.common.log.model.constant.SysOperationLogType
;
import
com.yice.webadmin.app.dto.PluginManageDto
;
import
com.yice.webadmin.app.model.PluginManage
;
import
com.yice.webadmin.app.service.PluginManageService
;
import
com.yice.webadmin.app.vo.PluginManageVo
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 插件编排管理接口。
*
* @author linking
* @date 2023-04-13
*/
@Api
(
tags
=
"插件编排管理接口"
)
@Slf4j
@RestController
@RequestMapping
(
"/admin/app/pluginManage"
)
public
class
PluginManageController
{
@Autowired
private
PluginManageService
pluginManageService
;
/**
* 新增知识图谱管理数据。
*
* @param pluginManageDto 新增对象。
* @return 应答结果对象,包含新增对象主键Id。
*/
@ApiOperationSupport
(
ignoreParameters
=
{
"pluginManageDto.pluginId"
})
@OperationLog
(
type
=
SysOperationLogType
.
ADD
)
@PostMapping
(
"/add"
)
public
ResponseResult
<
Long
>
add
(
@MyRequestBody
PluginManageDto
pluginManageDto
)
{
String
errorMessage
=
MyCommonUtil
.
getModelValidationError
(
pluginManageDto
,
false
);
if
(
errorMessage
!=
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_VALIDATED_FAILED
,
errorMessage
);
}
PluginManage
pluginManage
=
MyModelUtil
.
copyTo
(
pluginManageDto
,
PluginManage
.
class
);
pluginManage
=
pluginManageService
.
saveNew
(
pluginManage
);
return
ResponseResult
.
success
(
pluginManage
.
getPluginId
());
}
/**
* 更新知识图谱管理数据。
*
* @param pluginManageDto 更新对象。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
UPDATE
)
@PostMapping
(
"/update"
)
public
ResponseResult
<
Void
>
update
(
@MyRequestBody
PluginManageDto
pluginManageDto
)
{
String
errorMessage
=
MyCommonUtil
.
getModelValidationError
(
pluginManageDto
,
true
);
if
(
errorMessage
!=
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_VALIDATED_FAILED
,
errorMessage
);
}
PluginManage
pluginManage
=
MyModelUtil
.
copyTo
(
pluginManageDto
,
PluginManage
.
class
);
PluginManage
originalPluginManage
=
pluginManageService
.
getById
(
pluginManage
.
getPluginId
());
if
(
originalPluginManage
==
null
)
{
// NOTE: 修改下面方括号中的话述
errorMessage
=
"数据验证失败,当前 [数据] 并不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
if
(!
pluginManageService
.
update
(
pluginManage
,
originalPluginManage
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
);
}
return
ResponseResult
.
success
();
}
/**
* 删除知识图谱管理数据。
*
* @param pluginId 删除对象主键Id。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
DELETE
)
@PostMapping
(
"/delete"
)
public
ResponseResult
<
Void
>
delete
(
@MyRequestBody
Long
pluginId
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
pluginId
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
ARGUMENT_NULL_EXIST
);
}
return
this
.
doDelete
(
pluginId
);
}
/**
* 批量删除知识图谱管理数据。
*
* @param pluginIdList 待删除对象的主键Id列表。
* @return 应答结果对象。
*/
@OperationLog
(
type
=
SysOperationLogType
.
DELETE_BATCH
)
@PostMapping
(
"/deleteBatch"
)
public
ResponseResult
<
Void
>
deleteBatch
(
@MyRequestBody
List
<
Long
>
pluginIdList
)
{
if
(
MyCommonUtil
.
existBlankArgument
(
pluginIdList
))
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
ARGUMENT_NULL_EXIST
);
}
for
(
Long
pluginId
:
pluginIdList
)
{
ResponseResult
<
Void
>
responseResult
=
this
.
doDelete
(
pluginId
);
if
(!
responseResult
.
isSuccess
())
{
return
responseResult
;
}
}
return
ResponseResult
.
success
();
}
/**
* 列出符合过滤条件的知识图谱管理列表。
*
* @param pluginManageDtoFilter 过滤对象。
* @param orderParam 排序参数。
* @param pageParam 分页参数。
* @return 应答结果对象,包含查询结果集。
*/
@PostMapping
(
"/list"
)
public
ResponseResult
<
MyPageData
<
PluginManageVo
>>
list
(
@MyRequestBody
PluginManageDto
pluginManageDtoFilter
,
@MyRequestBody
MyOrderParam
orderParam
,
@MyRequestBody
MyPageParam
pageParam
)
{
if
(
pageParam
!=
null
)
{
PageMethod
.
startPage
(
pageParam
.
getPageNum
(),
pageParam
.
getPageSize
());
}
PluginManage
pluginManageFilter
=
MyModelUtil
.
copyTo
(
pluginManageDtoFilter
,
PluginManage
.
class
);
String
orderBy
=
MyOrderParam
.
buildOrderBy
(
orderParam
,
PluginManage
.
class
);
List
<
PluginManage
>
pluginManageList
=
pluginManageService
.
getPluginManageListWithRelation
(
pluginManageFilter
,
orderBy
);
return
ResponseResult
.
success
(
MyPageUtil
.
makeResponseData
(
pluginManageList
,
PluginManage
.
INSTANCE
));
}
/**
* 查看指定知识图谱管理对象详情。
*
* @param pluginId 指定对象主键Id。
* @return 应答结果对象,包含对象详情。
*/
@GetMapping
(
"/view"
)
public
ResponseResult
<
PluginManageVo
>
view
(
@RequestParam
Long
pluginId
)
{
PluginManage
pluginManage
=
pluginManageService
.
getByIdWithRelation
(
pluginId
,
MyRelationParam
.
full
());
if
(
pluginManage
==
null
)
{
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
);
}
PluginManageVo
pluginManageVo
=
MyModelUtil
.
copyTo
(
pluginManage
,
PluginManageVo
.
class
);
return
ResponseResult
.
success
(
pluginManageVo
);
}
private
ResponseResult
<
Void
>
doDelete
(
Long
pluginId
)
{
String
errorMessage
;
// 验证关联Id的数据合法性
PluginManage
originalPluginManage
=
pluginManageService
.
getById
(
pluginId
);
if
(
originalPluginManage
==
null
)
{
// NOTE: 修改下面方括号中的话述
errorMessage
=
"数据验证失败,当前 [对象] 并不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
if
(!
pluginManageService
.
remove
(
pluginId
))
{
errorMessage
=
"数据操作失败,删除的对象不存在,请刷新后重试!"
;
return
ResponseResult
.
error
(
ErrorCodeEnum
.
DATA_NOT_EXIST
,
errorMessage
);
}
return
ResponseResult
.
success
();
}
}
application-webadmin/src/main/java/com/yice/webadmin/app/dao/ApiPluginMapper.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
dao
;
import
com.yice.common.core.base.dao.BaseDaoMapper
;
import
com.yice.webadmin.app.model.ApiPlugin
;
import
java.util.*
;
/**
* 数据操作访问接口。
*
* @author linking
* @date 2023-04-13
*/
public
interface
ApiPluginMapper
extends
BaseDaoMapper
<
ApiPlugin
>
{
/**
* 批量插入对象列表。
*
* @param apiPluginList 新增对象列表。
*/
void
insertList
(
List
<
ApiPlugin
>
apiPluginList
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/dao/ApiServiceMapper.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
dao
;
import
com.yice.common.core.base.dao.BaseDaoMapper
;
import
com.yice.webadmin.app.model.ApiService
;
import
java.util.*
;
/**
* 数据操作访问接口。
*
* @author linking
* @date 2023-04-13
*/
public
interface
ApiServiceMapper
extends
BaseDaoMapper
<
ApiService
>
{
/**
* 批量插入对象列表。
*
* @param apiServiceList 新增对象列表。
*/
void
insertList
(
List
<
ApiService
>
apiServiceList
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/dao/ModelInstanceMapper.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
dao
;
import
com.yice.common.core.base.dao.BaseDaoMapper
;
import
com.yice.webadmin.app.model.ModelInstance
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 数据操作访问接口。
*
* @author linking
* @date 2023-04-13
*/
public
interface
ModelInstanceMapper
extends
BaseDaoMapper
<
ModelInstance
>
{
/**
* 批量插入对象列表。
*
* @param modelInstanceList 新增对象列表。
*/
void
insertList
(
List
<
ModelInstance
>
modelInstanceList
);
/**
* 获取过滤后的对象列表。
*
* @param modelInstanceFilter 主表过滤对象。
* @param orderBy 排序字符串,order by从句的参数。
* @return 对象列表。
*/
List
<
ModelInstance
>
getModelInstanceList
(
@Param
(
"modelInstanceFilter"
)
ModelInstance
modelInstanceFilter
,
@Param
(
"orderBy"
)
String
orderBy
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/dao/ModelServiceMapper.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
dao
;
import
com.yice.common.core.base.dao.BaseDaoMapper
;
import
com.yice.webadmin.app.model.ModelService
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 数据操作访问接口。
*
* @author linking
* @date 2023-04-13
*/
public
interface
ModelServiceMapper
extends
BaseDaoMapper
<
ModelService
>
{
/**
* 批量插入对象列表。
*
* @param modelServiceList 新增对象列表。
*/
void
insertList
(
List
<
ModelService
>
modelServiceList
);
/**
* 获取过滤后的对象列表。
*
* @param modelServiceFilter 主表过滤对象。
* @param orderBy 排序字符串,order by从句的参数。
* @return 对象列表。
*/
List
<
ModelService
>
getModelServiceList
(
@Param
(
"modelServiceFilter"
)
ModelService
modelServiceFilter
,
@Param
(
"orderBy"
)
String
orderBy
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/dao/PluginConfigMapper.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
dao
;
import
com.yice.common.core.base.dao.BaseDaoMapper
;
import
com.yice.webadmin.app.model.PluginConfig
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 数据操作访问接口。
*
* @author linking
* @date 2023-04-13
*/
public
interface
PluginConfigMapper
extends
BaseDaoMapper
<
PluginConfig
>
{
/**
* 批量插入对象列表。
*
* @param pluginConfigList 新增对象列表。
*/
void
insertList
(
List
<
PluginConfig
>
pluginConfigList
);
/**
* 获取过滤后的对象列表。
*
* @param pluginConfigFilter 主表过滤对象。
* @param orderBy 排序字符串,order by从句的参数。
* @return 对象列表。
*/
List
<
PluginConfig
>
getPluginConfigList
(
@Param
(
"pluginConfigFilter"
)
PluginConfig
pluginConfigFilter
,
@Param
(
"orderBy"
)
String
orderBy
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/dao/PluginManageMapper.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
dao
;
import
com.yice.common.core.base.dao.BaseDaoMapper
;
import
com.yice.webadmin.app.model.PluginManage
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 数据操作访问接口。
*
* @author linking
* @date 2023-04-13
*/
public
interface
PluginManageMapper
extends
BaseDaoMapper
<
PluginManage
>
{
/**
* 批量插入对象列表。
*
* @param pluginManageList 新增对象列表。
*/
void
insertList
(
List
<
PluginManage
>
pluginManageList
);
/**
* 获取过滤后的对象列表。
*
* @param pluginManageFilter 主表过滤对象。
* @param orderBy 排序字符串,order by从句的参数。
* @return 对象列表。
*/
List
<
PluginManage
>
getPluginManageList
(
@Param
(
"pluginManageFilter"
)
PluginManage
pluginManageFilter
,
@Param
(
"orderBy"
)
String
orderBy
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/dao/mapper/ApiManageMapper.xml
View file @
2a1e163c
...
...
@@ -11,7 +11,7 @@
<result
column=
"app_id"
jdbcType=
"BIGINT"
property=
"appId"
/>
<result
column=
"api_key"
jdbcType=
"VARCHAR"
property=
"apiKey"
/>
<result
column=
"secret_key"
jdbcType=
"VARCHAR"
property=
"secretKey"
/>
<result
column=
"
desc"
jdbcType=
"VARCHAR"
property=
"desc
"
/>
<result
column=
"
remark"
jdbcType=
"VARCHAR"
property=
"remark
"
/>
</resultMap>
<insert
id=
"insertList"
>
...
...
@@ -25,7 +25,7 @@
app_id,
api_key,
secret_key,
desc
)
remark
)
VALUES
<foreach
collection=
"list"
index=
"index"
item=
"item"
separator=
","
>
(#{item.apiId},
...
...
@@ -37,7 +37,7 @@
#{item.appId},
#{item.apiKey},
#{item.secretKey},
#{item.
desc
})
#{item.
remark
})
</foreach>
</insert>
...
...
@@ -53,6 +53,10 @@
<if
test=
"apiManageFilter.apiId != null"
>
AND lmp_api_manage.api_id = #{apiManageFilter.apiId}
</if>
<if
test=
"apiManageFilter.apiName != null"
>
<bind
name=
"safeApiName"
value=
"'%' + apiManageFilter.apiName + '%'"
/>
AND lmp_api_manage.api_name LIKE #{safeApiName}
</if>
</if>
</sql>
...
...
application-webadmin/src/main/java/com/yice/webadmin/app/dao/mapper/ApiPluginMapper.xml
0 → 100644
View file @
2a1e163c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yice.webadmin.app.dao.ApiPluginMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yice.webadmin.app.model.ApiPlugin"
>
<id
column=
"api_id"
jdbcType=
"BIGINT"
property=
"apiId"
/>
<id
column=
"plugin_id"
jdbcType=
"BIGINT"
property=
"pluginId"
/>
</resultMap>
<insert
id=
"insertList"
>
INSERT INTO lmp_api_plugin
(api_id,
plugin_id)
VALUES
<foreach
collection=
"list"
index=
"index"
item=
"item"
separator=
","
>
(#{item.apiId},
#{item.pluginId})
</foreach>
</insert>
</mapper>
application-webadmin/src/main/java/com/yice/webadmin/app/dao/mapper/ApiServiceMapper.xml
0 → 100644
View file @
2a1e163c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yice.webadmin.app.dao.ApiServiceMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yice.webadmin.app.model.ApiService"
>
<id
column=
"api_id"
jdbcType=
"BIGINT"
property=
"apiId"
/>
<id
column=
"service_id"
jdbcType=
"BIGINT"
property=
"serviceId"
/>
</resultMap>
<insert
id=
"insertList"
>
INSERT INTO lmp_api_service
(api_id,
service_id)
VALUES
<foreach
collection=
"list"
index=
"index"
item=
"item"
separator=
","
>
(#{item.apiId},
#{item.serviceId})
</foreach>
</insert>
</mapper>
application-webadmin/src/main/java/com/yice/webadmin/app/dao/mapper/ModelInstanceMapper.xml
0 → 100644
View file @
2a1e163c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yice.webadmin.app.dao.ModelInstanceMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yice.webadmin.app.model.ModelInstance"
>
<id
column=
"deploy_id"
jdbcType=
"BIGINT"
property=
"deployId"
/>
<result
column=
"model_id"
jdbcType=
"BIGINT"
property=
"modelId"
/>
<result
column=
"version_id"
jdbcType=
"BIGINT"
property=
"versionId"
/>
<result
column=
"version_name"
jdbcType=
"VARCHAR"
property=
"versionName"
/>
<result
column=
"deploy_status"
jdbcType=
"TINYINT"
property=
"deployStatus"
/>
<result
column=
"create_user_id"
jdbcType=
"BIGINT"
property=
"createUserId"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_user_id"
jdbcType=
"BIGINT"
property=
"updateUserId"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<insert
id=
"insertList"
>
INSERT INTO lmp_model_instance
(deploy_id,
model_id,
version_id,
version_name,
deploy_status,
create_user_id,
create_time,
update_user_id,
update_time)
VALUES
<foreach
collection=
"list"
index=
"index"
item=
"item"
separator=
","
>
(#{item.deployId},
#{item.modelId},
#{item.versionId},
#{item.versionName},
#{item.deployStatus},
#{item.createUserId},
#{item.createTime},
#{item.updateUserId},
#{item.updateTime})
</foreach>
</insert>
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
<sql
id=
"filterRef"
>
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
<include
refid=
"com.yice.webadmin.app.dao.ModelInstanceMapper.inputFilterRef"
/>
</sql>
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
<sql
id=
"inputFilterRef"
>
<if
test=
"modelInstanceFilter != null"
>
</if>
</sql>
<select
id=
"getModelInstanceList"
resultMap=
"BaseResultMap"
parameterType=
"com.yice.webadmin.app.model.ModelInstance"
>
SELECT * FROM lmp_model_instance
<where>
<include
refid=
"filterRef"
/>
</where>
<if
test=
"orderBy != null and orderBy != ''"
>
ORDER BY ${orderBy}
</if>
</select>
</mapper>
application-webadmin/src/main/java/com/yice/webadmin/app/dao/mapper/ModelServiceMapper.xml
0 → 100644
View file @
2a1e163c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yice.webadmin.app.dao.ModelServiceMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yice.webadmin.app.model.ModelService"
>
<id
column=
"service_id"
jdbcType=
"BIGINT"
property=
"serviceId"
/>
<result
column=
"model_id"
jdbcType=
"BIGINT"
property=
"modelId"
/>
<result
column=
"service_name"
jdbcType=
"VARCHAR"
property=
"serviceName"
/>
<result
column=
"service_version"
jdbcType=
"TINYINT"
property=
"serviceVersion"
/>
<result
column=
"resource_info"
jdbcType=
"VARCHAR"
property=
"resourceInfo"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"create_user_id"
jdbcType=
"BIGINT"
property=
"createUserId"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_user_id"
jdbcType=
"BIGINT"
property=
"updateUserId"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<insert
id=
"insertList"
>
INSERT INTO lmp_model_service
(service_id,
model_id,
service_name,
service_version,
resource_info,
remark,
create_user_id,
create_time,
update_user_id,
update_time)
VALUES
<foreach
collection=
"list"
index=
"index"
item=
"item"
separator=
","
>
(#{item.serviceId},
#{item.modelId},
#{item.serviceName},
#{item.serviceVersion},
#{item.resourceInfo},
#{item.remark},
#{item.createUserId},
#{item.createTime},
#{item.updateUserId},
#{item.updateTime})
</foreach>
</insert>
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
<sql
id=
"filterRef"
>
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
<include
refid=
"com.yice.webadmin.app.dao.ModelServiceMapper.inputFilterRef"
/>
</sql>
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
<sql
id=
"inputFilterRef"
>
<if
test=
"modelServiceFilter != null"
>
</if>
</sql>
<select
id=
"getModelServiceList"
resultMap=
"BaseResultMap"
parameterType=
"com.yice.webadmin.app.model.ModelService"
>
SELECT * FROM lmp_model_service
<where>
<include
refid=
"filterRef"
/>
</where>
<if
test=
"orderBy != null and orderBy != ''"
>
ORDER BY ${orderBy}
</if>
</select>
</mapper>
application-webadmin/src/main/java/com/yice/webadmin/app/dao/mapper/PluginConfigMapper.xml
0 → 100644
View file @
2a1e163c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yice.webadmin.app.dao.PluginConfigMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yice.webadmin.app.model.PluginConfig"
>
<id
column=
"config_id"
jdbcType=
"BIGINT"
property=
"configId"
/>
<result
column=
"service_id"
jdbcType=
"BIGINT"
property=
"serviceId"
/>
<result
column=
"api_id"
jdbcType=
"BIGINT"
property=
"apiId"
/>
<result
column=
"temperature"
jdbcType=
"DOUBLE"
property=
"temperature"
/>
<result
column=
"diversity"
jdbcType=
"DECIMAL"
property=
"diversity"
/>
<result
column=
"duplicate_penalty"
jdbcType=
"DECIMAL"
property=
"duplicatePenalty"
/>
<result
column=
"prompt"
jdbcType=
"LONGVARCHAR"
property=
"prompt"
/>
<result
column=
"plugin_knowledge_id"
jdbcType=
"BIGINT"
property=
"pluginKnowledgeId"
/>
<result
column=
"max_length_context"
jdbcType=
"INTEGER"
property=
"maxLengthContext"
/>
<result
column=
"open_words"
jdbcType=
"LONGVARCHAR"
property=
"openWords"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"create_user_id"
jdbcType=
"BIGINT"
property=
"createUserId"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"update_user_id"
jdbcType=
"BIGINT"
property=
"updateUserId"
/>
</resultMap>
<insert
id=
"insertList"
>
INSERT INTO lmp_plugin_config
(config_id,
service_id,
api_id,
temperature,
diversity,
duplicate_penalty,
prompt,
plugin_knowledge_id,
max_length_context,
open_words,
remark,
create_user_id,
create_time,
update_time,
update_user_id)
VALUES
<foreach
collection=
"list"
index=
"index"
item=
"item"
separator=
","
>
(#{item.configId},
#{item.serviceId},
#{item.apiId},
#{item.temperature},
#{item.diversity},
#{item.duplicatePenalty},
#{item.prompt},
#{item.pluginKnowledgeId},
#{item.maxLengthContext},
#{item.openWords},
#{item.remark},
#{item.createUserId},
#{item.createTime},
#{item.updateTime},
#{item.updateUserId})
</foreach>
</insert>
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
<sql
id=
"filterRef"
>
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
<include
refid=
"com.yice.webadmin.app.dao.PluginConfigMapper.inputFilterRef"
/>
</sql>
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
<sql
id=
"inputFilterRef"
>
<if
test=
"pluginConfigFilter != null"
>
</if>
</sql>
<select
id=
"getPluginConfigList"
resultMap=
"BaseResultMap"
parameterType=
"com.yice.webadmin.app.model.PluginConfig"
>
SELECT * FROM lmp_plugin_config
<where>
<include
refid=
"filterRef"
/>
</where>
<if
test=
"orderBy != null and orderBy != ''"
>
ORDER BY ${orderBy}
</if>
</select>
</mapper>
application-webadmin/src/main/java/com/yice/webadmin/app/dao/mapper/PluginManageMapper.xml
0 → 100644
View file @
2a1e163c
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yice.webadmin.app.dao.PluginManageMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yice.webadmin.app.model.PluginManage"
>
<id
column=
"plugin_id"
jdbcType=
"BIGINT"
property=
"pluginId"
/>
<result
column=
"scene_type"
jdbcType=
"INTEGER"
property=
"sceneType"
/>
<result
column=
"plugin_name"
jdbcType=
"VARCHAR"
property=
"pluginName"
/>
<result
column=
"status"
jdbcType=
"INTEGER"
property=
"status"
/>
<result
column=
"remark"
jdbcType=
"VARCHAR"
property=
"remark"
/>
<result
column=
"create_user_id"
jdbcType=
"BIGINT"
property=
"createUserId"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
<result
column=
"update_user_id"
jdbcType=
"BIGINT"
property=
"updateUserId"
/>
</resultMap>
<insert
id=
"insertList"
>
INSERT INTO lmp_plugin_manage
(plugin_id,
scene_type,
plugin_name,
status,
remark,
create_user_id,
create_time,
update_time,
update_user_id)
VALUES
<foreach
collection=
"list"
index=
"index"
item=
"item"
separator=
","
>
(#{item.pluginId},
#{item.sceneType},
#{item.pluginName},
#{item.status},
#{item.remark},
#{item.createUserId},
#{item.createTime},
#{item.updateTime},
#{item.updateUserId})
</foreach>
</insert>
<!-- 如果有逻辑删除字段过滤,请写到这里 -->
<sql
id=
"filterRef"
>
<!-- 这里必须加上全包名,否则当filterRef被其他Mapper.xml包含引用的时候,就会调用Mapper.xml中的该SQL片段 -->
<include
refid=
"com.yice.webadmin.app.dao.PluginManageMapper.inputFilterRef"
/>
</sql>
<!-- 这里仅包含调用接口输入的主表过滤条件 -->
<sql
id=
"inputFilterRef"
>
<if
test=
"pluginManageFilter != null"
>
<if
test=
"pluginManageFilter.pluginName != null"
>
AND lmp_plugin_manage.plugin_name = #{pluginManageFilter.pluginName}
</if>
<if
test=
"pluginManageFilter.status != null"
>
AND lmp_plugin_manage.status = #{pluginManageFilter.status}
</if>
</if>
</sql>
<select
id=
"getPluginManageList"
resultMap=
"BaseResultMap"
parameterType=
"com.yice.webadmin.app.model.PluginManage"
>
SELECT * FROM lmp_plugin_manage
<where>
<include
refid=
"filterRef"
/>
</where>
<if
test=
"orderBy != null and orderBy != ''"
>
ORDER BY ${orderBy}
</if>
</select>
</mapper>
application-webadmin/src/main/java/com/yice/webadmin/app/dto/ApiManageDto.java
View file @
2a1e163c
...
...
@@ -49,6 +49,6 @@ public class ApiManageDto {
/**
* 应用描述。
*/
@ApiModelProperty
(
value
=
"
desc
"
)
private
String
desc
;
@ApiModelProperty
(
value
=
"
remark
"
)
private
String
remark
;
}
application-webadmin/src/main/java/com/yice/webadmin/app/dto/ModelInstanceDto.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
dto
;
import
com.yice.common.core.validator.UpdateGroup
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.*
;
/**
* 知识图谱管理Dto对象。
*
* @author linking
* @date 2023-04-13
*/
@ApiModel
(
value
=
"ModelInstanceDto对象"
)
@Data
public
class
ModelInstanceDto
{
/**
* 部署ID。
*/
@ApiModelProperty
(
value
=
"部署ID"
,
required
=
true
)
@NotNull
(
message
=
"数据验证失败,部署ID不能为空!"
,
groups
=
{
UpdateGroup
.
class
})
private
Long
deployId
;
/**
* 模型ID,外键。
*/
@ApiModelProperty
(
value
=
"模型ID,外键"
)
private
Long
modelId
;
/**
* 版本ID,外键。
*/
@ApiModelProperty
(
value
=
"版本ID,外键"
)
private
Long
versionId
;
/**
* 模型版本名称。
*/
@ApiModelProperty
(
value
=
"模型版本名称"
)
private
String
versionName
;
/**
* 部署状态。
*/
@ApiModelProperty
(
value
=
"部署状态"
)
private
Integer
deployStatus
;
}
application-webadmin/src/main/java/com/yice/webadmin/app/dto/ModelServiceDto.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
dto
;
import
com.yice.common.core.validator.UpdateGroup
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* 知识图谱管理Dto对象。
*
* @author linking
* @date 2023-04-13
*/
@ApiModel
(
value
=
"ModelServiceDto对象"
)
@Data
public
class
ModelServiceDto
{
/**
* 服务ID。
*/
@ApiModelProperty
(
value
=
"服务ID"
,
required
=
true
)
@NotNull
(
message
=
"数据验证失败,服务ID不能为空!"
,
groups
=
{
UpdateGroup
.
class
})
private
Long
serviceId
;
/**
* 模型实例ID,外键。
*/
@ApiModelProperty
(
value
=
"模型实例ID,外键"
)
private
Long
modelId
;
/**
* 服务名称。
*/
@ApiModelProperty
(
value
=
"服务名称"
)
private
String
serviceName
;
/**
* 服务版本。
*/
@ApiModelProperty
(
value
=
"服务版本"
)
private
Integer
serviceVersion
;
/**
* 资源信息。
*/
@ApiModelProperty
(
value
=
"资源信息"
)
private
String
resourceInfo
;
/**
* 服务描述。
*/
@ApiModelProperty
(
value
=
"服务描述"
)
private
String
remark
;
}
application-webadmin/src/main/java/com/yice/webadmin/app/dto/PluginConfigDto.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
dto
;
import
com.yice.common.core.validator.UpdateGroup
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
/**
* 知识图谱管理Dto对象。
*
* @author linking
* @date 2023-04-13
*/
@ApiModel
(
value
=
"PluginConfigDto对象"
)
@Data
public
class
PluginConfigDto
{
/**
* 编排配置表ID。
*/
@ApiModelProperty
(
value
=
"编排配置表ID"
,
required
=
true
)
@NotNull
(
message
=
"数据验证失败,编排配置表ID不能为空!"
,
groups
=
{
UpdateGroup
.
class
})
private
Long
configId
;
/**
* 模型服务ID,外键。
*/
@ApiModelProperty
(
value
=
"模型服务ID,外键"
)
private
Long
serviceId
;
/**
* 应用ID,外键。
*/
@ApiModelProperty
(
value
=
"应用ID,外键"
)
private
Long
apiId
;
/**
* 温度,保留两位小数。
*/
@ApiModelProperty
(
value
=
"温度,保留两位小数"
)
private
Double
temperature
;
/**
* 多样性,保留两位小数。
*/
@ApiModelProperty
(
value
=
"多样性,保留两位小数"
)
private
BigDecimal
diversity
;
/**
* 重复惩罚。
*/
@ApiModelProperty
(
value
=
"重复惩罚"
)
private
BigDecimal
duplicatePenalty
;
/**
* 提示词。
*/
@ApiModelProperty
(
value
=
"提示词"
)
private
String
prompt
;
/**
* 插件编排知识库ID,外键。
*/
@ApiModelProperty
(
value
=
"插件编排知识库ID,外键"
)
private
Long
pluginKnowledgeId
;
/**
* 最长上下文。
*/
@ApiModelProperty
(
value
=
"最长上下文"
)
private
Integer
maxLengthContext
;
/**
* 开场白。
*/
@ApiModelProperty
(
value
=
"开场白"
)
private
String
openWords
;
/**
* 备注。
*/
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
}
application-webadmin/src/main/java/com/yice/webadmin/app/dto/PluginManageDto.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
dto
;
import
com.yice.common.core.validator.UpdateGroup
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.*
;
/**
* 知识图谱管理Dto对象。
*
* @author linking
* @date 2023-04-13
*/
@ApiModel
(
description
=
"PluginManageDto对象"
)
@Data
public
class
PluginManageDto
{
/**
* 插件编排ID,主键。
*/
@ApiModelProperty
(
value
=
"插件编排ID,主键"
,
required
=
true
)
@NotNull
(
message
=
"数据验证失败,插件编排ID,主键不能为空!"
,
groups
=
{
UpdateGroup
.
class
})
private
Long
pluginId
;
/**
* 场景类型:1、对话类场景;2、生成类场景。
*/
@ApiModelProperty
(
value
=
"场景类型:1、对话类场景;2、生成类场景"
)
private
Integer
sceneType
;
/**
* 插件编排名称。
*/
@ApiModelProperty
(
value
=
"插件编排名称"
)
private
String
pluginName
;
/**
* 服务状态:1、编辑中;2、已上线;3、已下线。
*/
@ApiModelProperty
(
value
=
"服务状态:1、编辑中;2、已上线;3、已下线"
)
private
Integer
status
;
/**
* 备注。
*/
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
}
application-webadmin/src/main/java/com/yice/webadmin/app/model/ApiManage.java
View file @
2a1e163c
...
...
@@ -50,7 +50,7 @@ public class ApiManage extends BaseModel {
/**
* 应用描述。
*/
private
String
desc
;
private
String
remark
;
@Mapper
public
interface
ApiManageModelMapper
extends
BaseModelMapper
<
ApiManageVo
,
ApiManage
>
{
...
...
application-webadmin/src/main/java/com/yice/webadmin/app/model/ApiPlugin.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
model
;
import
com.baomidou.mybatisplus.annotation.*
;
import
lombok.Data
;
/**
* 实体对象。
*
* @author linking
* @date 2023-04-13
*/
@Data
@TableName
(
value
=
"lmp_api_plugin"
)
public
class
ApiPlugin
{
/**
* 应用接入ID,外键。
*/
private
Long
apiId
;
/**
* 编排插件ID,外键。
*/
private
Long
pluginId
;
}
application-webadmin/src/main/java/com/yice/webadmin/app/model/ApiService.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
model
;
import
com.baomidou.mybatisplus.annotation.*
;
import
lombok.Data
;
/**
* 实体对象。
*
* @author linking
* @date 2023-04-13
*/
@Data
@TableName
(
value
=
"lmp_api_service"
)
public
class
ApiService
{
/**
* 应用接入ID,外键。
*/
private
Long
apiId
;
/**
* 模型服务ID,外键。
*/
private
Long
serviceId
;
}
application-webadmin/src/main/java/com/yice/webadmin/app/model/ModelInstance.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
model
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yice.common.core.base.mapper.BaseModelMapper
;
import
com.yice.common.core.base.model.BaseModel
;
import
com.yice.webadmin.app.vo.ModelInstanceVo
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.factory.Mappers
;
/**
* 实体对象。
*
* @author linking
* @date 2023-04-13
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
value
=
"lmp_model_instance"
)
public
class
ModelInstance
extends
BaseModel
{
/**
* 部署ID。
*/
@TableId
(
value
=
"deploy_id"
)
private
Long
deployId
;
/**
* 模型ID,外键。
*/
private
Long
modelId
;
/**
* 版本ID,外键。
*/
private
Long
versionId
;
/**
* 模型版本名称。
*/
private
String
versionName
;
/**
* 部署状态。
*/
private
Integer
deployStatus
;
@Mapper
public
interface
ModelInstanceMapper
extends
BaseModelMapper
<
ModelInstanceVo
,
ModelInstance
>
{
}
public
static
final
ModelInstanceMapper
INSTANCE
=
Mappers
.
getMapper
(
ModelInstanceMapper
.
class
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/model/ModelService.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
model
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yice.common.core.base.mapper.BaseModelMapper
;
import
com.yice.common.core.base.model.BaseModel
;
import
com.yice.webadmin.app.vo.ModelServiceVo
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.factory.Mappers
;
/**
* 实体对象。
*
* @author linking
* @date 2023-04-13
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
value
=
"lmp_model_service"
)
public
class
ModelService
extends
BaseModel
{
/**
* 服务ID。
*/
@TableId
(
value
=
"service_id"
)
private
Long
serviceId
;
/**
* 模型实例ID,外键。
*/
private
Long
modelId
;
/**
* 服务名称。
*/
private
String
serviceName
;
/**
* 服务版本。
*/
private
Integer
serviceVersion
;
/**
* 资源信息。
*/
private
String
resourceInfo
;
/**
* 服务描述。
*/
private
String
remark
;
@Mapper
public
interface
ModelServiceMapper
extends
BaseModelMapper
<
ModelServiceVo
,
ModelService
>
{
}
public
static
final
ModelServiceMapper
INSTANCE
=
Mappers
.
getMapper
(
ModelServiceMapper
.
class
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/model/PluginConfig.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
model
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yice.common.core.base.mapper.BaseModelMapper
;
import
com.yice.common.core.base.model.BaseModel
;
import
com.yice.webadmin.app.vo.PluginConfigVo
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.factory.Mappers
;
import
java.math.BigDecimal
;
/**
* 实体对象。
*
* @author linking
* @date 2023-04-13
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
value
=
"lmp_plugin_config"
)
public
class
PluginConfig
extends
BaseModel
{
/**
* 编排配置表ID。
*/
@TableId
(
value
=
"config_id"
)
private
Long
configId
;
/**
* 模型服务ID,外键。
*/
private
Long
serviceId
;
/**
* 应用ID,外键。
*/
private
Long
apiId
;
/**
* 温度,保留两位小数。
*/
private
Double
temperature
;
/**
* 多样性,保留两位小数。
*/
private
BigDecimal
diversity
;
/**
* 重复惩罚。
*/
private
BigDecimal
duplicatePenalty
;
/**
* 提示词。
*/
private
String
prompt
;
/**
* 插件编排知识库ID,外键。
*/
private
Long
pluginKnowledgeId
;
/**
* 最长上下文。
*/
private
Integer
maxLengthContext
;
/**
* 开场白。
*/
private
String
openWords
;
/**
* 备注。
*/
private
String
remark
;
@Mapper
public
interface
PluginConfigMapper
extends
BaseModelMapper
<
PluginConfigVo
,
PluginConfig
>
{
}
public
static
final
PluginConfigMapper
INSTANCE
=
Mappers
.
getMapper
(
PluginConfigMapper
.
class
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/model/PluginManage.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
model
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yice.common.core.base.mapper.BaseModelMapper
;
import
com.yice.common.core.base.model.BaseModel
;
import
com.yice.webadmin.app.vo.PluginManageVo
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.factory.Mappers
;
/**
* 实体对象。
*
* @author linking
* @date 2023-04-13
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@TableName
(
value
=
"lmp_plugin_manage"
)
public
class
PluginManage
extends
BaseModel
{
/**
* 插件编排ID,主键。
*/
@TableId
(
value
=
"plugin_id"
,
type
=
IdType
.
AUTO
)
private
Long
pluginId
;
/**
* 场景类型:1、对话类场景;2、生成类场景。
*/
private
Integer
sceneType
;
/**
* 插件编排名称。
*/
private
String
pluginName
;
/**
* 服务状态:1、编辑中;2、已上线;3、已下线。
*/
private
Integer
status
;
/**
* 备注。
*/
private
String
remark
;
@Mapper
public
interface
PluginManageMapper
extends
BaseModelMapper
<
PluginManageVo
,
PluginManage
>
{
}
public
static
final
PluginManageMapper
INSTANCE
=
Mappers
.
getMapper
(
PluginManageMapper
.
class
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/service/ModelInstanceService.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
service
;
import
com.yice.webadmin.app.model.*
;
import
com.yice.common.core.base.service.IBaseService
;
import
java.util.*
;
/**
* 知识图谱管理数据操作服务接口。
*
* @author linking
* @date 2023-04-13
*/
public
interface
ModelInstanceService
extends
IBaseService
<
ModelInstance
,
Long
>
{
/**
* 保存新增对象。
*
* @param modelInstance 新增对象。
* @return 返回新增对象。
*/
ModelInstance
saveNew
(
ModelInstance
modelInstance
);
/**
* 利用数据库的insertList语法,批量插入对象列表。
*
* @param modelInstanceList 新增对象列表。
*/
void
saveNewBatch
(
List
<
ModelInstance
>
modelInstanceList
);
/**
* 更新数据对象。
*
* @param modelInstance 更新的对象。
* @param originalModelInstance 原有数据对象。
* @return 成功返回true,否则false。
*/
boolean
update
(
ModelInstance
modelInstance
,
ModelInstance
originalModelInstance
);
/**
* 删除指定数据。
*
* @param deployId 主键Id。
* @return 成功返回true,否则false。
*/
boolean
remove
(
Long
deployId
);
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getModelInstanceListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
List
<
ModelInstance
>
getModelInstanceList
(
ModelInstance
filter
,
String
orderBy
);
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getModelInstanceList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
List
<
ModelInstance
>
getModelInstanceListWithRelation
(
ModelInstance
filter
,
String
orderBy
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/service/ModelServiceService.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
service
;
import
com.yice.webadmin.app.model.*
;
import
com.yice.common.core.base.service.IBaseService
;
import
java.util.*
;
/**
* 知识图谱管理数据操作服务接口。
*
* @author linking
* @date 2023-04-13
*/
public
interface
ModelServiceService
extends
IBaseService
<
ModelService
,
Long
>
{
/**
* 保存新增对象。
*
* @param modelService 新增对象。
* @return 返回新增对象。
*/
ModelService
saveNew
(
ModelService
modelService
);
/**
* 利用数据库的insertList语法,批量插入对象列表。
*
* @param modelServiceList 新增对象列表。
*/
void
saveNewBatch
(
List
<
ModelService
>
modelServiceList
);
/**
* 更新数据对象。
*
* @param modelService 更新的对象。
* @param originalModelService 原有数据对象。
* @return 成功返回true,否则false。
*/
boolean
update
(
ModelService
modelService
,
ModelService
originalModelService
);
/**
* 删除指定数据。
*
* @param serviceId 主键Id。
* @return 成功返回true,否则false。
*/
boolean
remove
(
Long
serviceId
);
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getModelServiceListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
List
<
ModelService
>
getModelServiceList
(
ModelService
filter
,
String
orderBy
);
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getModelServiceList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
List
<
ModelService
>
getModelServiceListWithRelation
(
ModelService
filter
,
String
orderBy
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/service/PluginConfigService.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
service
;
import
com.yice.webadmin.app.model.*
;
import
com.yice.common.core.base.service.IBaseService
;
import
java.util.*
;
/**
* 知识图谱管理数据操作服务接口。
*
* @author linking
* @date 2023-04-13
*/
public
interface
PluginConfigService
extends
IBaseService
<
PluginConfig
,
Long
>
{
/**
* 保存新增对象。
*
* @param pluginConfig 新增对象。
* @return 返回新增对象。
*/
PluginConfig
saveNew
(
PluginConfig
pluginConfig
);
/**
* 利用数据库的insertList语法,批量插入对象列表。
*
* @param pluginConfigList 新增对象列表。
*/
void
saveNewBatch
(
List
<
PluginConfig
>
pluginConfigList
);
/**
* 更新数据对象。
*
* @param pluginConfig 更新的对象。
* @param originalPluginConfig 原有数据对象。
* @return 成功返回true,否则false。
*/
boolean
update
(
PluginConfig
pluginConfig
,
PluginConfig
originalPluginConfig
);
/**
* 删除指定数据。
*
* @param configId 主键Id。
* @return 成功返回true,否则false。
*/
boolean
remove
(
Long
configId
);
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getPluginConfigListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
List
<
PluginConfig
>
getPluginConfigList
(
PluginConfig
filter
,
String
orderBy
);
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getPluginConfigList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
List
<
PluginConfig
>
getPluginConfigListWithRelation
(
PluginConfig
filter
,
String
orderBy
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/service/PluginManageService.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
service
;
import
com.yice.webadmin.app.model.*
;
import
com.yice.common.core.base.service.IBaseService
;
import
java.util.*
;
/**
* 知识图谱管理数据操作服务接口。
*
* @author linking
* @date 2023-04-13
*/
public
interface
PluginManageService
extends
IBaseService
<
PluginManage
,
Long
>
{
/**
* 保存新增对象。
*
* @param pluginManage 新增对象。
* @return 返回新增对象。
*/
PluginManage
saveNew
(
PluginManage
pluginManage
);
/**
* 利用数据库的insertList语法,批量插入对象列表。
*
* @param pluginManageList 新增对象列表。
*/
void
saveNewBatch
(
List
<
PluginManage
>
pluginManageList
);
/**
* 更新数据对象。
*
* @param pluginManage 更新的对象。
* @param originalPluginManage 原有数据对象。
* @return 成功返回true,否则false。
*/
boolean
update
(
PluginManage
pluginManage
,
PluginManage
originalPluginManage
);
/**
* 删除指定数据。
*
* @param pluginId 主键Id。
* @return 成功返回true,否则false。
*/
boolean
remove
(
Long
pluginId
);
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getPluginManageListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
List
<
PluginManage
>
getPluginManageList
(
PluginManage
filter
,
String
orderBy
);
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getPluginManageList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
List
<
PluginManage
>
getPluginManageListWithRelation
(
PluginManage
filter
,
String
orderBy
);
}
application-webadmin/src/main/java/com/yice/webadmin/app/service/impl/ApiManageServiceImpl.java
View file @
2a1e163c
...
...
@@ -11,6 +11,7 @@ import com.yice.common.sequence.wrapper.IdGeneratorWrapper;
import
com.yice.webadmin.app.dao.ApiManageMapper
;
import
com.yice.webadmin.app.model.ApiManage
;
import
com.yice.webadmin.app.service.ApiManageService
;
import
com.yice.webadmin.app.util.GenerateUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -52,6 +53,9 @@ public class ApiManageServiceImpl extends BaseService<ApiManage, Long> implement
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
ApiManage
saveNew
(
ApiManage
apiManage
)
{
apiManage
.
setAppId
(
GenerateUtil
.
generateAppId
());
apiManage
.
setApiKey
(
GenerateUtil
.
generateApiKey
());
apiManage
.
setSecretKey
(
GenerateUtil
.
generateSecretKey
());
apiManageMapper
.
insert
(
this
.
buildDefaultValue
(
apiManage
));
return
apiManage
;
}
...
...
application-webadmin/src/main/java/com/yice/webadmin/app/service/impl/ModelInstanceServiceImpl.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
service
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.yice.webadmin.app.service.*
;
import
com.yice.webadmin.app.dao.*
;
import
com.yice.webadmin.app.model.*
;
import
com.yice.common.core.base.dao.BaseDaoMapper
;
import
com.yice.common.core.object.MyRelationParam
;
import
com.yice.common.core.base.service.BaseService
;
import
com.yice.common.core.util.MyModelUtil
;
import
com.yice.common.sequence.wrapper.IdGeneratorWrapper
;
import
com.github.pagehelper.Page
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
/**
* 知识图谱管理数据操作服务类。
*
* @author linking
* @date 2023-04-13
*/
@Slf4j
@Service
(
"modelInstanceService"
)
public
class
ModelInstanceServiceImpl
extends
BaseService
<
ModelInstance
,
Long
>
implements
ModelInstanceService
{
@Autowired
private
ModelInstanceMapper
modelInstanceMapper
;
@Autowired
private
IdGeneratorWrapper
idGenerator
;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected
BaseDaoMapper
<
ModelInstance
>
mapper
()
{
return
modelInstanceMapper
;
}
/**
* 保存新增对象。
*
* @param modelInstance 新增对象。
* @return 返回新增对象。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
ModelInstance
saveNew
(
ModelInstance
modelInstance
)
{
modelInstanceMapper
.
insert
(
this
.
buildDefaultValue
(
modelInstance
));
return
modelInstance
;
}
/**
* 利用数据库的insertList语法,批量插入对象列表。
*
* @param modelInstanceList 新增对象列表。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
saveNewBatch
(
List
<
ModelInstance
>
modelInstanceList
)
{
if
(
CollUtil
.
isNotEmpty
(
modelInstanceList
))
{
modelInstanceList
.
forEach
(
this
::
buildDefaultValue
);
modelInstanceMapper
.
insertList
(
modelInstanceList
);
}
}
/**
* 更新数据对象。
*
* @param modelInstance 更新的对象。
* @param originalModelInstance 原有数据对象。
* @return 成功返回true,否则false。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
update
(
ModelInstance
modelInstance
,
ModelInstance
originalModelInstance
)
{
MyModelUtil
.
fillCommonsForUpdate
(
modelInstance
,
originalModelInstance
);
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
UpdateWrapper
<
ModelInstance
>
uw
=
this
.
createUpdateQueryForNullValue
(
modelInstance
,
modelInstance
.
getDeployId
());
return
modelInstanceMapper
.
update
(
modelInstance
,
uw
)
==
1
;
}
/**
* 删除指定数据。
*
* @param deployId 主键Id。
* @return 成功返回true,否则false。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
remove
(
Long
deployId
)
{
return
modelInstanceMapper
.
deleteById
(
deployId
)
==
1
;
}
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getModelInstanceListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public
List
<
ModelInstance
>
getModelInstanceList
(
ModelInstance
filter
,
String
orderBy
)
{
return
modelInstanceMapper
.
getModelInstanceList
(
filter
,
orderBy
);
}
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getModelInstanceList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public
List
<
ModelInstance
>
getModelInstanceListWithRelation
(
ModelInstance
filter
,
String
orderBy
)
{
List
<
ModelInstance
>
resultList
=
modelInstanceMapper
.
getModelInstanceList
(
filter
,
orderBy
);
// 在缺省生成的代码中,如果查询结果resultList不是Page对象,说明没有分页,那么就很可能是数据导出接口调用了当前方法。
// 为了避免一次性的大量数据关联,规避因此而造成的系统运行性能冲击,这里手动进行了分批次读取,开发者可按需修改该值。
int
batchSize
=
resultList
instanceof
Page
?
0
:
1000
;
this
.
buildRelationForDataList
(
resultList
,
MyRelationParam
.
normal
(),
batchSize
);
return
resultList
;
}
private
ModelInstance
buildDefaultValue
(
ModelInstance
modelInstance
)
{
if
(
modelInstance
.
getDeployId
()
==
null
)
{
modelInstance
.
setDeployId
(
idGenerator
.
nextLongId
());
}
MyModelUtil
.
fillCommonsForInsert
(
modelInstance
);
return
modelInstance
;
}
}
application-webadmin/src/main/java/com/yice/webadmin/app/service/impl/ModelServiceServiceImpl.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
service
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.yice.webadmin.app.service.*
;
import
com.yice.webadmin.app.dao.*
;
import
com.yice.webadmin.app.model.*
;
import
com.yice.common.core.base.dao.BaseDaoMapper
;
import
com.yice.common.core.object.MyRelationParam
;
import
com.yice.common.core.base.service.BaseService
;
import
com.yice.common.core.util.MyModelUtil
;
import
com.yice.common.sequence.wrapper.IdGeneratorWrapper
;
import
com.github.pagehelper.Page
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
/**
* 知识图谱管理数据操作服务类。
*
* @author linking
* @date 2023-04-13
*/
@Slf4j
@Service
(
"modelServiceService"
)
public
class
ModelServiceServiceImpl
extends
BaseService
<
ModelService
,
Long
>
implements
ModelServiceService
{
@Autowired
private
ModelServiceMapper
modelServiceMapper
;
@Autowired
private
IdGeneratorWrapper
idGenerator
;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected
BaseDaoMapper
<
ModelService
>
mapper
()
{
return
modelServiceMapper
;
}
/**
* 保存新增对象。
*
* @param modelService 新增对象。
* @return 返回新增对象。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
ModelService
saveNew
(
ModelService
modelService
)
{
modelServiceMapper
.
insert
(
this
.
buildDefaultValue
(
modelService
));
return
modelService
;
}
/**
* 利用数据库的insertList语法,批量插入对象列表。
*
* @param modelServiceList 新增对象列表。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
saveNewBatch
(
List
<
ModelService
>
modelServiceList
)
{
if
(
CollUtil
.
isNotEmpty
(
modelServiceList
))
{
modelServiceList
.
forEach
(
this
::
buildDefaultValue
);
modelServiceMapper
.
insertList
(
modelServiceList
);
}
}
/**
* 更新数据对象。
*
* @param modelService 更新的对象。
* @param originalModelService 原有数据对象。
* @return 成功返回true,否则false。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
update
(
ModelService
modelService
,
ModelService
originalModelService
)
{
MyModelUtil
.
fillCommonsForUpdate
(
modelService
,
originalModelService
);
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
UpdateWrapper
<
ModelService
>
uw
=
this
.
createUpdateQueryForNullValue
(
modelService
,
modelService
.
getServiceId
());
return
modelServiceMapper
.
update
(
modelService
,
uw
)
==
1
;
}
/**
* 删除指定数据。
*
* @param serviceId 主键Id。
* @return 成功返回true,否则false。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
remove
(
Long
serviceId
)
{
return
modelServiceMapper
.
deleteById
(
serviceId
)
==
1
;
}
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getModelServiceListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public
List
<
ModelService
>
getModelServiceList
(
ModelService
filter
,
String
orderBy
)
{
return
modelServiceMapper
.
getModelServiceList
(
filter
,
orderBy
);
}
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getModelServiceList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public
List
<
ModelService
>
getModelServiceListWithRelation
(
ModelService
filter
,
String
orderBy
)
{
List
<
ModelService
>
resultList
=
modelServiceMapper
.
getModelServiceList
(
filter
,
orderBy
);
// 在缺省生成的代码中,如果查询结果resultList不是Page对象,说明没有分页,那么就很可能是数据导出接口调用了当前方法。
// 为了避免一次性的大量数据关联,规避因此而造成的系统运行性能冲击,这里手动进行了分批次读取,开发者可按需修改该值。
int
batchSize
=
resultList
instanceof
Page
?
0
:
1000
;
this
.
buildRelationForDataList
(
resultList
,
MyRelationParam
.
normal
(),
batchSize
);
return
resultList
;
}
private
ModelService
buildDefaultValue
(
ModelService
modelService
)
{
if
(
modelService
.
getServiceId
()
==
null
)
{
modelService
.
setServiceId
(
idGenerator
.
nextLongId
());
}
MyModelUtil
.
fillCommonsForInsert
(
modelService
);
return
modelService
;
}
}
application-webadmin/src/main/java/com/yice/webadmin/app/service/impl/PluginConfigServiceImpl.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
service
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.github.pagehelper.Page
;
import
com.yice.common.core.base.dao.BaseDaoMapper
;
import
com.yice.common.core.base.service.BaseService
;
import
com.yice.common.core.object.MyRelationParam
;
import
com.yice.common.core.util.MyModelUtil
;
import
com.yice.common.sequence.wrapper.IdGeneratorWrapper
;
import
com.yice.webadmin.app.dao.PluginConfigMapper
;
import
com.yice.webadmin.app.model.PluginConfig
;
import
com.yice.webadmin.app.service.PluginConfigService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
/**
* 知识图谱管理数据操作服务类。
*
* @author linking
* @date 2023-04-13
*/
@Slf4j
@Service
(
"pluginConfigService"
)
public
class
PluginConfigServiceImpl
extends
BaseService
<
PluginConfig
,
Long
>
implements
PluginConfigService
{
@Autowired
private
PluginConfigMapper
pluginConfigMapper
;
@Autowired
private
IdGeneratorWrapper
idGenerator
;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected
BaseDaoMapper
<
PluginConfig
>
mapper
()
{
return
pluginConfigMapper
;
}
/**
* 保存新增对象。
*
* @param pluginConfig 新增对象。
* @return 返回新增对象。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
PluginConfig
saveNew
(
PluginConfig
pluginConfig
)
{
pluginConfigMapper
.
insert
(
this
.
buildDefaultValue
(
pluginConfig
));
return
pluginConfig
;
}
/**
* 利用数据库的insertList语法,批量插入对象列表。
*
* @param pluginConfigList 新增对象列表。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
saveNewBatch
(
List
<
PluginConfig
>
pluginConfigList
)
{
if
(
CollUtil
.
isNotEmpty
(
pluginConfigList
))
{
pluginConfigList
.
forEach
(
this
::
buildDefaultValue
);
pluginConfigMapper
.
insertList
(
pluginConfigList
);
}
}
/**
* 更新数据对象。
*
* @param pluginConfig 更新的对象。
* @param originalPluginConfig 原有数据对象。
* @return 成功返回true,否则false。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
update
(
PluginConfig
pluginConfig
,
PluginConfig
originalPluginConfig
)
{
MyModelUtil
.
fillCommonsForUpdate
(
pluginConfig
,
originalPluginConfig
);
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
UpdateWrapper
<
PluginConfig
>
uw
=
this
.
createUpdateQueryForNullValue
(
pluginConfig
,
pluginConfig
.
getConfigId
());
return
pluginConfigMapper
.
update
(
pluginConfig
,
uw
)
==
1
;
}
/**
* 删除指定数据。
*
* @param configId 主键Id。
* @return 成功返回true,否则false。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
remove
(
Long
configId
)
{
return
pluginConfigMapper
.
deleteById
(
configId
)
==
1
;
}
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getPluginConfigListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public
List
<
PluginConfig
>
getPluginConfigList
(
PluginConfig
filter
,
String
orderBy
)
{
return
pluginConfigMapper
.
getPluginConfigList
(
filter
,
orderBy
);
}
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getPluginConfigList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public
List
<
PluginConfig
>
getPluginConfigListWithRelation
(
PluginConfig
filter
,
String
orderBy
)
{
List
<
PluginConfig
>
resultList
=
pluginConfigMapper
.
getPluginConfigList
(
filter
,
orderBy
);
// 在缺省生成的代码中,如果查询结果resultList不是Page对象,说明没有分页,那么就很可能是数据导出接口调用了当前方法。
// 为了避免一次性的大量数据关联,规避因此而造成的系统运行性能冲击,这里手动进行了分批次读取,开发者可按需修改该值。
int
batchSize
=
resultList
instanceof
Page
?
0
:
1000
;
this
.
buildRelationForDataList
(
resultList
,
MyRelationParam
.
normal
(),
batchSize
);
return
resultList
;
}
private
PluginConfig
buildDefaultValue
(
PluginConfig
pluginConfig
)
{
if
(
pluginConfig
.
getConfigId
()
==
null
)
{
pluginConfig
.
setConfigId
(
idGenerator
.
nextLongId
());
}
MyModelUtil
.
fillCommonsForInsert
(
pluginConfig
);
return
pluginConfig
;
}
}
application-webadmin/src/main/java/com/yice/webadmin/app/service/impl/PluginManageServiceImpl.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
service
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.yice.webadmin.app.service.*
;
import
com.yice.webadmin.app.dao.*
;
import
com.yice.webadmin.app.model.*
;
import
com.yice.common.core.base.dao.BaseDaoMapper
;
import
com.yice.common.core.object.MyRelationParam
;
import
com.yice.common.core.base.service.BaseService
;
import
com.yice.common.core.util.MyModelUtil
;
import
com.github.pagehelper.Page
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
/**
* 知识图谱管理数据操作服务类。
*
* @author linking
* @date 2023-04-13
*/
@Slf4j
@Service
(
"pluginManageService"
)
public
class
PluginManageServiceImpl
extends
BaseService
<
PluginManage
,
Long
>
implements
PluginManageService
{
@Autowired
private
PluginManageMapper
pluginManageMapper
;
/**
* 返回当前Service的主表Mapper对象。
*
* @return 主表Mapper对象。
*/
@Override
protected
BaseDaoMapper
<
PluginManage
>
mapper
()
{
return
pluginManageMapper
;
}
/**
* 保存新增对象。
*
* @param pluginManage 新增对象。
* @return 返回新增对象。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
PluginManage
saveNew
(
PluginManage
pluginManage
)
{
pluginManageMapper
.
insert
(
this
.
buildDefaultValue
(
pluginManage
));
return
pluginManage
;
}
/**
* 利用数据库的insertList语法,批量插入对象列表。
*
* @param pluginManageList 新增对象列表。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
saveNewBatch
(
List
<
PluginManage
>
pluginManageList
)
{
if
(
CollUtil
.
isNotEmpty
(
pluginManageList
))
{
pluginManageList
.
forEach
(
this
::
buildDefaultValue
);
pluginManageMapper
.
insertList
(
pluginManageList
);
}
}
/**
* 更新数据对象。
*
* @param pluginManage 更新的对象。
* @param originalPluginManage 原有数据对象。
* @return 成功返回true,否则false。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
update
(
PluginManage
pluginManage
,
PluginManage
originalPluginManage
)
{
MyModelUtil
.
fillCommonsForUpdate
(
pluginManage
,
originalPluginManage
);
// 这里重点提示,在执行主表数据更新之前,如果有哪些字段不支持修改操作,请用原有数据对象字段替换当前数据字段。
UpdateWrapper
<
PluginManage
>
uw
=
this
.
createUpdateQueryForNullValue
(
pluginManage
,
pluginManage
.
getPluginId
());
return
pluginManageMapper
.
update
(
pluginManage
,
uw
)
==
1
;
}
/**
* 删除指定数据。
*
* @param pluginId 主键Id。
* @return 成功返回true,否则false。
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
remove
(
Long
pluginId
)
{
return
pluginManageMapper
.
deleteById
(
pluginId
)
==
1
;
}
/**
* 获取单表查询结果。由于没有关联数据查询,因此在仅仅获取单表数据的场景下,效率更高。
* 如果需要同时获取关联数据,请移步(getPluginManageListWithRelation)方法。
*
* @param filter 过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public
List
<
PluginManage
>
getPluginManageList
(
PluginManage
filter
,
String
orderBy
)
{
return
pluginManageMapper
.
getPluginManageList
(
filter
,
orderBy
);
}
/**
* 获取主表的查询结果,以及主表关联的字典数据和一对一从表数据,以及一对一从表的字典数据。
* 该查询会涉及到一对一从表的关联过滤,或一对多从表的嵌套关联过滤,因此性能不如单表过滤。
* 如果仅仅需要获取主表数据,请移步(getPluginManageList),以便获取更好的查询性能。
*
* @param filter 主表过滤对象。
* @param orderBy 排序参数。
* @return 查询结果集。
*/
@Override
public
List
<
PluginManage
>
getPluginManageListWithRelation
(
PluginManage
filter
,
String
orderBy
)
{
List
<
PluginManage
>
resultList
=
pluginManageMapper
.
getPluginManageList
(
filter
,
orderBy
);
// 在缺省生成的代码中,如果查询结果resultList不是Page对象,说明没有分页,那么就很可能是数据导出接口调用了当前方法。
// 为了避免一次性的大量数据关联,规避因此而造成的系统运行性能冲击,这里手动进行了分批次读取,开发者可按需修改该值。
int
batchSize
=
resultList
instanceof
Page
?
0
:
1000
;
this
.
buildRelationForDataList
(
resultList
,
MyRelationParam
.
normal
(),
batchSize
);
return
resultList
;
}
private
PluginManage
buildDefaultValue
(
PluginManage
pluginManage
)
{
MyModelUtil
.
fillCommonsForInsert
(
pluginManage
);
return
pluginManage
;
}
}
application-webadmin/src/main/java/com/yice/webadmin/app/util/GenerateUtil.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
util
;
import
java.security.NoSuchAlgorithmException
;
import
java.security.SecureRandom
;
import
java.util.Random
;
/**
* 生成工具包
*/
public
class
GenerateUtil
{
private
static
final
String
ALGORITHM
=
"AES"
;
private
static
final
String
SECRET_KEY
=
"This is a secret key!"
;
private
static
final
String
DIGITAL
=
"1234567890"
;
private
static
final
String
CHARACTERS
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
;
private
static
final
int
KEY_LENGTH
=
20
;
private
static
final
int
SECRET_KEY_LENGTH
=
32
;
/**
* 生成App_Id
* @return 随机生成的八位数
*/
public
static
Long
generateAppId
()
{
Random
rand
=
new
Random
();
String
digits
=
DIGITAL
;
String
code
=
""
;
for
(
int
i
=
0
;
i
<
8
;
i
++)
{
code
+=
digits
.
charAt
(
rand
.
nextInt
(
digits
.
length
()));
}
return
Long
.
parseLong
(
code
);
}
/**
* 生成Api key
* @return ApiKey
*/
public
static
String
generateApiKey
()
{
Random
random
=
new
Random
();
StringBuilder
sb
=
new
StringBuilder
(
KEY_LENGTH
);
for
(
int
i
=
0
;
i
<
KEY_LENGTH
;
i
++)
{
int
index
=
(
int
)
(
random
.
nextFloat
()
*
CHARACTERS
.
length
());
sb
.
append
(
CHARACTERS
.
charAt
(
index
));
}
return
sb
.
toString
();
}
/**
* 生成Secret Key
* @return SecretKey
*/
public
static
String
generateSecretKey
()
{
try
{
SecureRandom
random
=
SecureRandom
.
getInstance
(
"SHA1PRNG"
);
StringBuilder
sb
=
new
StringBuilder
(
SECRET_KEY_LENGTH
);
for
(
int
i
=
0
;
i
<
SECRET_KEY_LENGTH
;
i
++)
{
int
index
=
(
int
)
(
random
.
nextFloat
()
*
CHARACTERS
.
length
());
sb
.
append
(
CHARACTERS
.
charAt
(
index
));
}
return
sb
.
toString
();
}
catch
(
NoSuchAlgorithmException
e
)
{
// 理论上,SHA1PRNG 不应该抛出 NoSuchAlgorithmException,但为了完整性,我们仍然捕获它
return
""
;
}
}
}
application-webadmin/src/main/java/com/yice/webadmin/app/vo/ApiManageVo.java
View file @
2a1e163c
...
...
@@ -50,6 +50,6 @@ public class ApiManageVo extends BaseVo {
/**
* 应用描述。
*/
@ApiModelProperty
(
value
=
"
desc
"
)
private
String
desc
;
@ApiModelProperty
(
value
=
"
remark
"
)
private
String
remark
;
}
application-webadmin/src/main/java/com/yice/webadmin/app/vo/ModelInstanceVo.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
vo
;
import
com.yice.common.core.base.vo.BaseVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* 知识图谱管理VO视图对象。
*
* @author linking
* @date 2023-04-13
*/
@ApiModel
(
value
=
"ModelInstanceVO视图对象"
)
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ModelInstanceVo
extends
BaseVo
{
/**
* 部署ID。
*/
@ApiModelProperty
(
value
=
"部署ID"
)
private
Long
deployId
;
/**
* 模型ID,外键。
*/
@ApiModelProperty
(
value
=
"模型ID,外键"
)
private
Long
modelId
;
/**
* 版本ID,外键。
*/
@ApiModelProperty
(
value
=
"版本ID,外键"
)
private
Long
versionId
;
/**
* 模型版本名称。
*/
@ApiModelProperty
(
value
=
"模型版本名称"
)
private
String
versionName
;
/**
* 部署状态。
*/
@ApiModelProperty
(
value
=
"部署状态"
)
private
Integer
deployStatus
;
}
application-webadmin/src/main/java/com/yice/webadmin/app/vo/ModelServiceVo.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
vo
;
import
com.yice.common.core.base.vo.BaseVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* 知识图谱管理VO视图对象。
*
* @author linking
* @date 2023-04-13
*/
@ApiModel
(
value
=
"ModelServiceVO视图对象"
)
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ModelServiceVo
extends
BaseVo
{
/**
* 服务ID。
*/
@ApiModelProperty
(
value
=
"服务ID"
)
private
Long
serviceId
;
/**
* 模型实例ID,外键。
*/
@ApiModelProperty
(
value
=
"模型实例ID,外键"
)
private
Long
modelId
;
/**
* 服务名称。
*/
@ApiModelProperty
(
value
=
"服务名称"
)
private
String
serviceName
;
/**
* 服务版本。
*/
@ApiModelProperty
(
value
=
"服务版本"
)
private
Integer
serviceVersion
;
/**
* 资源信息。
*/
@ApiModelProperty
(
value
=
"资源信息"
)
private
String
resourceInfo
;
/**
* 服务描述。
*/
@ApiModelProperty
(
value
=
"服务描述"
)
private
String
remark
;
}
application-webadmin/src/main/java/com/yice/webadmin/app/vo/PluginConfigVo.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
vo
;
import
com.yice.common.core.base.vo.BaseVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.math.BigDecimal
;
/**
* 知识图谱管理VO视图对象。
*
* @author linking
* @date 2023-04-13
*/
@ApiModel
(
value
=
"PluginConfigVO视图对象"
)
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
PluginConfigVo
extends
BaseVo
{
/**
* 编排配置表ID。
*/
@ApiModelProperty
(
value
=
"编排配置表ID"
)
private
Long
configId
;
/**
* 模型服务ID,外键。
*/
@ApiModelProperty
(
value
=
"模型服务ID,外键"
)
private
Long
serviceId
;
/**
* 应用ID,外键。
*/
@ApiModelProperty
(
value
=
"应用ID,外键"
)
private
Long
apiId
;
/**
* 温度,保留两位小数。
*/
@ApiModelProperty
(
value
=
"温度,保留两位小数"
)
private
Double
temperature
;
/**
* 多样性,保留两位小数。
*/
@ApiModelProperty
(
value
=
"多样性,保留两位小数"
)
private
BigDecimal
diversity
;
/**
* 重复惩罚。
*/
@ApiModelProperty
(
value
=
"重复惩罚"
)
private
BigDecimal
duplicatePenalty
;
/**
* 提示词。
*/
@ApiModelProperty
(
value
=
"提示词"
)
private
String
prompt
;
/**
* 插件编排知识库ID,外键。
*/
@ApiModelProperty
(
value
=
"插件编排知识库ID,外键"
)
private
Long
pluginKnowledgeId
;
/**
* 最长上下文。
*/
@ApiModelProperty
(
value
=
"最长上下文"
)
private
Integer
maxLengthContext
;
/**
* 开场白。
*/
@ApiModelProperty
(
value
=
"开场白"
)
private
String
openWords
;
/**
* 备注。
*/
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
}
application-webadmin/src/main/java/com/yice/webadmin/app/vo/PluginManageVo.java
0 → 100644
View file @
2a1e163c
package
com
.
yice
.
webadmin
.
app
.
vo
;
import
com.yice.common.core.base.vo.BaseVo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* 知识图谱管理VO视图对象。
*
* @author linking
* @date 2023-04-13
*/
@ApiModel
(
value
=
"PluginManageVO视图对象"
)
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
PluginManageVo
extends
BaseVo
{
/**
* 插件编排ID,主键。
*/
@ApiModelProperty
(
value
=
"插件编排ID,主键"
)
private
Long
pluginId
;
/**
* 场景类型:1、对话类场景;2、生成类场景。
*/
@ApiModelProperty
(
value
=
"场景类型:1、对话类场景;2、生成类场景"
)
private
Integer
sceneType
;
/**
* 插件编排名称。
*/
@ApiModelProperty
(
value
=
"插件编排名称"
)
private
String
pluginName
;
/**
* 服务状态:1、编辑中;2、已上线;3、已下线。
*/
@ApiModelProperty
(
value
=
"服务状态:1、编辑中;2、已上线;3、已下线"
)
private
Integer
status
;
/**
* 备注。
*/
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
}
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