Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
poc
poc-api
Commits
1366bf51
You need to sign in or sign up before continuing.
Commit
1366bf51
authored
Jan 14, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:Agent应用插件接口
parent
ed72b5c4
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
325 additions
and
9 deletions
+325
-9
BizAgentApplicationPluginConvert.java
...application/convert/BizAgentApplicationPluginConvert.java
+50
-0
AgentPluginQuery.sql
...a/cn/com/poc/agent_application/query/AgentPluginQuery.sql
+20
-0
AgentPluginQueryCondition.java
...oc/agent_application/query/AgentPluginQueryCondition.java
+34
-0
AgentPluginQueryItem.java
...com/poc/agent_application/query/AgentPluginQueryItem.java
+198
-0
BizAgentApplicationPluginRest.java
...agent_application/rest/BizAgentApplicationPluginRest.java
+4
-3
BizAgentApplicationPluginRestImpl.java
...lication/rest/impl/BizAgentApplicationPluginRestImpl.java
+8
-6
BizAgentApplicationPluginService.java
...application/service/BizAgentApplicationPluginService.java
+4
-0
BizAgentApplicationPluginServiceImpl.java
...on/service/impl/BizAgentApplicationPluginServiceImpl.java
+7
-0
No files found.
src/main/java/cn/com/poc/agent_application/convert/BizAgentApplicationPluginConvert.java
View file @
1366bf51
...
...
@@ -4,6 +4,7 @@ import cn.com.poc.agent_application.dto.AgentApplicationPluginClassificationDto;
import
cn.com.poc.agent_application.dto.AgentApplicationPluginDto
;
import
cn.com.poc.agent_application.model.BizAgentApplicationPluginModel
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationPluginEntity
;
import
cn.com.poc.agent_application.query.AgentPluginQueryItem
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -180,6 +181,55 @@ public class BizAgentApplicationPluginConvert {
result
.
add
(
classificationDto
);
}
return
result
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
}
public
static
List
<
AgentApplicationPluginDto
>
itemsToPluginDtos
(
List
<
AgentPluginQueryItem
>
items
,
String
lang
)
{
List
<
AgentApplicationPluginDto
>
result
=
new
ArrayList
<>();
Map
<
String
,
List
<
AgentApplicationPluginDto
.
PluginInfo
>>
pluginInfoMap
=
new
HashMap
<>();
Map
<
String
,
String
>
classificationMap
=
new
HashMap
<>();
for
(
AgentPluginQueryItem
item
:
items
)
{
String
title
=
""
;
String
desc
=
""
;
String
parentClassificationName
=
""
;
switch
(
lang
)
{
case
ZH_CN:
title
=
item
.
getZhCnTitle
();
desc
=
item
.
getZhCnDesc
();
parentClassificationName
=
item
.
getParentZhCnName
();
break
;
case
EN:
title
=
item
.
getEnTitle
();
desc
=
item
.
getEnDesc
();
parentClassificationName
=
item
.
getParentEnName
();
break
;
case
ZH_TW:
title
=
item
.
getZhTwTitle
();
desc
=
item
.
getZhTwDesc
();
parentClassificationName
=
item
.
getParentZhTwName
();
break
;
}
AgentApplicationPluginDto
.
PluginInfo
pluginInfo
=
new
AgentApplicationPluginDto
.
PluginInfo
();
pluginInfo
.
setPoints
(
item
.
getPoints
());
pluginInfo
.
setIcon
(
item
.
getIcon
());
pluginInfo
.
setTitle
(
title
);
pluginInfo
.
setDescription
(
desc
);
pluginInfo
.
setPluginId
(
item
.
getPluginId
());
if
(!
pluginInfoMap
.
containsKey
(
parentClassificationName
))
{
pluginInfoMap
.
put
(
parentClassificationName
,
new
ArrayList
<>());
classificationMap
.
put
(
parentClassificationName
,
item
.
getClassification
());
}
pluginInfoMap
.
get
(
parentClassificationName
).
add
(
pluginInfo
);
}
Set
<
String
>
keySet
=
pluginInfoMap
.
keySet
();
for
(
String
parentClassificationName
:
keySet
)
{
AgentApplicationPluginDto
agentApplicationPluginDto
=
new
AgentApplicationPluginDto
();
agentApplicationPluginDto
.
setClassificationName
(
parentClassificationName
);
agentApplicationPluginDto
.
setPluginInfos
(
pluginInfoMap
.
get
(
parentClassificationName
));
agentApplicationPluginDto
.
setClassification
(
classificationMap
.
get
(
parentClassificationName
));
result
.
add
(
agentApplicationPluginDto
);
}
return
result
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/AgentPluginQuery.sql
0 → 100644
View file @
1366bf51
select
plugin_id
,
points
,
classification
,
icon
,
parent_zh_cn_name
,
parent_zh_tw_name
,
parent_en_name
,
zh_cn_title
,
zh_tw_title
,
en_title
,
zh_cn_desc
,
zh_tw_desc
,
en_desc
from
biz_agent_application_plugin
where
is_deleted
=
'N'
and
classification
!=
'system'
<<
and
plugin_id
in
(:
pluginIds
)
>>
<<
and
classification
=
:
classification
>>
order
by
id
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/AgentPluginQueryCondition.java
0 → 100644
View file @
1366bf51
package
cn
.
com
.
poc
.
agent_application
.
query
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* Query Condition class for AgentPluginQuery
*/
public
class
AgentPluginQueryCondition
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
List
<
String
>
pluginIds
;
public
List
<
String
>
getPluginIds
()
{
return
pluginIds
;
}
public
void
setPluginIds
(
List
<
String
>
pluginIds
)
{
this
.
pluginIds
=
pluginIds
;
}
private
java
.
lang
.
String
classification
;
public
java
.
lang
.
String
getClassification
()
{
return
this
.
classification
;
}
public
void
setClassification
(
java
.
lang
.
String
classification
)
{
this
.
classification
=
classification
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/AgentPluginQueryItem.java
0 → 100644
View file @
1366bf51
package
cn
.
com
.
poc
.
agent_application
.
query
;
import
java.io.Serializable
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
cn.com.yict.framemax.data.model.BaseItemClass
;
/**
* Query Item class for AgentPluginQuery
*/
@Entity
public
class
AgentPluginQueryItem
extends
BaseItemClass
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** plugin_id
*plugin_id
*/
private
java
.
lang
.
String
pluginId
;
@Column
(
name
=
"plugin_id"
)
public
java
.
lang
.
String
getPluginId
(){
return
this
.
pluginId
;
}
public
void
setPluginId
(
java
.
lang
.
String
pluginId
){
this
.
pluginId
=
pluginId
;
}
/** points
*points
*/
private
java
.
lang
.
Double
points
;
@Column
(
name
=
"points"
)
public
java
.
lang
.
Double
getPoints
(){
return
this
.
points
;
}
public
void
setPoints
(
java
.
lang
.
Double
points
){
this
.
points
=
points
;
}
/** classification
*classification
*/
private
java
.
lang
.
String
classification
;
@Column
(
name
=
"classification"
)
public
java
.
lang
.
String
getClassification
(){
return
this
.
classification
;
}
public
void
setClassification
(
java
.
lang
.
String
classification
){
this
.
classification
=
classification
;
}
/** icon
*icon
*/
private
java
.
lang
.
String
icon
;
@Column
(
name
=
"icon"
)
public
java
.
lang
.
String
getIcon
(){
return
this
.
icon
;
}
public
void
setIcon
(
java
.
lang
.
String
icon
){
this
.
icon
=
icon
;
}
/** parent_zh_cn_name
*parent_zh_cn_name
*/
private
java
.
lang
.
String
parentZhCnName
;
@Column
(
name
=
"parent_zh_cn_name"
)
public
java
.
lang
.
String
getParentZhCnName
(){
return
this
.
parentZhCnName
;
}
public
void
setParentZhCnName
(
java
.
lang
.
String
parentZhCnName
){
this
.
parentZhCnName
=
parentZhCnName
;
}
/** parent_zh_tw_name
*parent_zh_tw_name
*/
private
java
.
lang
.
String
parentZhTwName
;
@Column
(
name
=
"parent_zh_tw_name"
)
public
java
.
lang
.
String
getParentZhTwName
(){
return
this
.
parentZhTwName
;
}
public
void
setParentZhTwName
(
java
.
lang
.
String
parentZhTwName
){
this
.
parentZhTwName
=
parentZhTwName
;
}
/** parent_en_name
*parent_en_name
*/
private
java
.
lang
.
String
parentEnName
;
@Column
(
name
=
"parent_en_name"
)
public
java
.
lang
.
String
getParentEnName
(){
return
this
.
parentEnName
;
}
public
void
setParentEnName
(
java
.
lang
.
String
parentEnName
){
this
.
parentEnName
=
parentEnName
;
}
/** zh_cn_title
*zh_cn_title
*/
private
java
.
lang
.
String
zhCnTitle
;
@Column
(
name
=
"zh_cn_title"
)
public
java
.
lang
.
String
getZhCnTitle
(){
return
this
.
zhCnTitle
;
}
public
void
setZhCnTitle
(
java
.
lang
.
String
zhCnTitle
){
this
.
zhCnTitle
=
zhCnTitle
;
}
/** zh_tw_title
*zh_tw_title
*/
private
java
.
lang
.
String
zhTwTitle
;
@Column
(
name
=
"zh_tw_title"
)
public
java
.
lang
.
String
getZhTwTitle
(){
return
this
.
zhTwTitle
;
}
public
void
setZhTwTitle
(
java
.
lang
.
String
zhTwTitle
){
this
.
zhTwTitle
=
zhTwTitle
;
}
/** en_title
*en_title
*/
private
java
.
lang
.
String
enTitle
;
@Column
(
name
=
"en_title"
)
public
java
.
lang
.
String
getEnTitle
(){
return
this
.
enTitle
;
}
public
void
setEnTitle
(
java
.
lang
.
String
enTitle
){
this
.
enTitle
=
enTitle
;
}
/** zh_cn_desc
*zh_cn_desc
*/
private
java
.
lang
.
String
zhCnDesc
;
@Column
(
name
=
"zh_cn_desc"
)
public
java
.
lang
.
String
getZhCnDesc
(){
return
this
.
zhCnDesc
;
}
public
void
setZhCnDesc
(
java
.
lang
.
String
zhCnDesc
){
this
.
zhCnDesc
=
zhCnDesc
;
}
/** zh_tw_desc
*zh_tw_desc
*/
private
java
.
lang
.
String
zhTwDesc
;
@Column
(
name
=
"zh_tw_desc"
)
public
java
.
lang
.
String
getZhTwDesc
(){
return
this
.
zhTwDesc
;
}
public
void
setZhTwDesc
(
java
.
lang
.
String
zhTwDesc
){
this
.
zhTwDesc
=
zhTwDesc
;
}
/** en_desc
*en_desc
*/
private
java
.
lang
.
String
enDesc
;
@Column
(
name
=
"en_desc"
)
public
java
.
lang
.
String
getEnDesc
(){
return
this
.
enDesc
;
}
public
void
setEnDesc
(
java
.
lang
.
String
enDesc
){
this
.
enDesc
=
enDesc
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/rest/BizAgentApplicationPluginRest.java
View file @
1366bf51
...
...
@@ -25,21 +25,22 @@ public interface BizAgentApplicationPluginRest extends BaseRest {
* @return
* @throws Exception
*/
AgentApplicationPluginDto
getByPluginId
(
@RequestParam
String
pluginId
)
;
AgentApplicationPluginDto
getByPluginId
(
@RequestParam
String
pluginId
);
/**
* 获取插件列表
*
* @param classification
* @param pluginIds
* @param pagingInfo
* @return
* @throws Exception
*/
List
<
AgentApplicationPluginDto
>
getList
(
@RequestParam
(
required
=
false
)
String
classification
,
PagingInfo
pagingInfo
)
throws
Exception
;
List
<
AgentApplicationPluginDto
>
getList
(
@RequestParam
(
required
=
false
)
String
classification
,
@RequestParam
(
required
=
false
)
List
<
String
>
pluginIds
,
PagingInfo
pagingInfo
)
throws
Exception
;
/**
* 插件分类列表
*/
List
<
AgentApplicationPluginClassificationDto
>
classificationList
()
;
List
<
AgentApplicationPluginClassificationDto
>
classificationList
();
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/rest/impl/BizAgentApplicationPluginRestImpl.java
View file @
1366bf51
...
...
@@ -4,6 +4,8 @@ import cn.com.poc.agent_application.convert.BizAgentApplicationPluginConvert;
import
cn.com.poc.agent_application.dto.AgentApplicationPluginClassificationDto
;
import
cn.com.poc.agent_application.dto.AgentApplicationPluginDto
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationPluginEntity
;
import
cn.com.poc.agent_application.query.AgentPluginQueryCondition
;
import
cn.com.poc.agent_application.query.AgentPluginQueryItem
;
import
cn.com.poc.agent_application.rest.BizAgentApplicationPluginRest
;
import
cn.com.poc.agent_application.service.BizAgentApplicationPluginService
;
import
cn.com.poc.common.constant.CommonConstant
;
...
...
@@ -33,12 +35,12 @@ public class BizAgentApplicationPluginRestImpl implements BizAgentApplicationPlu
}
@Override
public
List
<
AgentApplicationPluginDto
>
getList
(
String
classification
,
PagingInfo
pagingInfo
)
throws
Exception
{
BizAgentApplicationPluginEntity
bizAgentApplicationPluginEntity
=
new
BizAgentApplicationPluginEntity
();
bizAgentApplicationPluginEntity
.
setClassification
(
classification
);
bizAgentApplicationPluginEntity
.
setIsDeleted
(
CommonConstant
.
IsDeleted
.
N
);
List
<
BizAgentApplicationPluginEntity
>
entities
=
bizAgentApplicationPluginService
.
findByExample
(
bizAgentApplicationPluginEntity
,
pagingInfo
);
return
BizAgentApplicationPluginConvert
.
entitiesToDtos
(
entities
.
stream
().
filter
(
entity
->
!
"system"
.
equals
(
entity
.
getClassification
())).
collect
(
Collectors
.
toList
())
,
BlContext
.
getCurrentLocaleLanguageToLowerCase
());
public
List
<
AgentApplicationPluginDto
>
getList
(
String
classification
,
List
<
String
>
pluginIds
,
PagingInfo
pagingInfo
)
throws
Exception
{
AgentPluginQueryCondition
condition
=
new
AgentPluginQueryCondition
();
condition
.
setPluginIds
(
pluginIds
);
condition
.
setClassification
(
classification
);
List
<
AgentPluginQueryItem
>
agentPluginQueryItems
=
bizAgentApplicationPluginService
.
agentPluginQuery
(
condition
,
pagingInfo
);
return
BizAgentApplicationPluginConvert
.
itemsToPluginDtos
(
agentPluginQueryItems
,
BlContext
.
getCurrentLocaleLanguageToLowerCase
());
}
@Override
...
...
src/main/java/cn/com/poc/agent_application/service/BizAgentApplicationPluginService.java
View file @
1366bf51
package
cn
.
com
.
poc
.
agent_application
.
service
;
import
cn.com.poc.agent_application.query.AgentPluginQueryCondition
;
import
cn.com.poc.agent_application.query.AgentPluginQueryItem
;
import
cn.com.yict.framemax.core.service.BaseService
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationPluginEntity
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
...
...
@@ -20,4 +22,6 @@ public interface BizAgentApplicationPluginService extends BaseService {
BizAgentApplicationPluginEntity
getInfoById
(
java
.
lang
.
String
pluginId
);
List
<
AgentPluginQueryItem
>
agentPluginQuery
(
AgentPluginQueryCondition
condition
,
PagingInfo
pagingInfo
);
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationPluginServiceImpl.java
View file @
1366bf51
package
cn
.
com
.
poc
.
agent_application
.
service
.
impl
;
import
cn.com.poc.agent_application.query.AgentPluginQueryCondition
;
import
cn.com.poc.agent_application.query.AgentPluginQueryItem
;
import
cn.com.poc.common.constant.CommonConstant
;
import
cn.com.yict.framemax.core.service.impl.BaseServiceImpl
;
import
cn.com.poc.agent_application.service.BizAgentApplicationPluginService
;
...
...
@@ -135,4 +137,9 @@ public class BizAgentApplicationPluginServiceImpl extends BaseServiceImpl
}
return
null
;
}
@Override
public
List
<
AgentPluginQueryItem
>
agentPluginQuery
(
AgentPluginQueryCondition
condition
,
PagingInfo
pagingInfo
)
{
return
this
.
sqlDao
.
query
(
condition
,
AgentPluginQueryItem
.
class
,
pagingInfo
);
}
}
\ No newline at end of file
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