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
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
poc
poc-api
Commits
84d0d5e2
Commit
84d0d5e2
authored
Oct 09, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 搜索模型信息
parent
ecccb7de
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
157 additions
and
52 deletions
+157
-52
BizAgentApplicationLargeModelListConvert.java
...ion/convert/BizAgentApplicationLargeModelListConvert.java
+17
-13
BizAgentApplicationLargeModelListDto.java
...application/dto/BizAgentApplicationLargeModelListDto.java
+13
-0
BizAgentApplicationLargeModelListEntity.java
...ation/entity/BizAgentApplicationLargeModelListEntity.java
+26
-0
BizAgentApplicationLargeModelListModel.java
...ication/model/BizAgentApplicationLargeModelListModel.java
+71
-33
AgentApplicationInfoRest.java
.../poc/agent_application/rest/AgentApplicationInfoRest.java
+5
-0
AgentApplicationInfoRestImpl.java
...t_application/rest/impl/AgentApplicationInfoRestImpl.java
+25
-6
No files found.
src/main/java/cn/com/poc/agent_application/convert/BizAgentApplicationLargeModelListConvert.java
View file @
84d0d5e2
package
cn
.
com
.
poc
.
agent_application
.
convert
;
package
cn
.
com
.
poc
.
agent_application
.
convert
;
import
cn.com.poc.agent_application.model.BizAgentApplicationLargeModelListModel
;
import
cn.com.poc.agent_application.model.BizAgentApplicationLargeModelListModel
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationLargeModelListEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationLargeModelListEntity
;
...
@@ -7,20 +7,24 @@ import cn.com.poc.agent_application.dto.BizAgentApplicationLargeModelListDto;
...
@@ -7,20 +7,24 @@ import cn.com.poc.agent_application.dto.BizAgentApplicationLargeModelListDto;
public
class
BizAgentApplicationLargeModelListConvert
{
public
class
BizAgentApplicationLargeModelListConvert
{
public
static
BizAgentApplicationLargeModelListEntity
modelToEntity
(
BizAgentApplicationLargeModelListModel
model
){
public
static
BizAgentApplicationLargeModelListEntity
modelToEntity
(
BizAgentApplicationLargeModelListModel
model
)
{
BizAgentApplicationLargeModelListEntity
entity
=
new
BizAgentApplicationLargeModelListEntity
();
BizAgentApplicationLargeModelListEntity
bizAgentApplicationLargeModelListEntity
=
new
BizAgentApplicationLargeModelListEntity
();
entity
.
setId
(
model
.
getId
());
bizAgentApplicationLargeModelListEntity
.
setId
(
model
.
getId
());
entity
.
setModelName
(
model
.
getModelName
());
bizAgentApplicationLargeModelListEntity
.
setModelName
(
model
.
getModelName
());
entity
.
setOwner
(
model
.
getOwner
());
bizAgentApplicationLargeModelListEntity
.
setOwner
(
model
.
getOwner
());
return
entity
;
bizAgentApplicationLargeModelListEntity
.
setIconUrl
(
model
.
getIconUrl
());
bizAgentApplicationLargeModelListEntity
.
setModelNickName
(
model
.
getModelNickName
());
return
bizAgentApplicationLargeModelListEntity
;
}
}
public
static
BizAgentApplicationLargeModelListModel
entityToModel
(
BizAgentApplicationLargeModelListEntity
entity
){
public
static
BizAgentApplicationLargeModelListModel
entityToModel
(
BizAgentApplicationLargeModelListEntity
entity
)
{
BizAgentApplicationLargeModelListModel
model
=
new
BizAgentApplicationLargeModelListModel
();
BizAgentApplicationLargeModelListModel
bizAgentApplicationLargeModelListModel
=
new
BizAgentApplicationLargeModelListModel
();
model
.
setId
(
entity
.
getId
());
bizAgentApplicationLargeModelListModel
.
setId
(
entity
.
getId
());
model
.
setModelName
(
entity
.
getModelName
());
bizAgentApplicationLargeModelListModel
.
setModelName
(
entity
.
getModelName
());
model
.
setOwner
(
entity
.
getOwner
());
bizAgentApplicationLargeModelListModel
.
setOwner
(
entity
.
getOwner
());
return
model
;
bizAgentApplicationLargeModelListModel
.
setIconUrl
(
entity
.
getIconUrl
());
bizAgentApplicationLargeModelListModel
.
setModelNickName
(
entity
.
getModelNickName
());
return
bizAgentApplicationLargeModelListModel
;
}
}
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/dto/BizAgentApplicationLargeModelListDto.java
View file @
84d0d5e2
...
@@ -32,4 +32,17 @@ public class BizAgentApplicationLargeModelListDto {
...
@@ -32,4 +32,17 @@ public class BizAgentApplicationLargeModelListDto {
public
void
setOwner
(
java
.
lang
.
String
owner
)
{
public
void
setOwner
(
java
.
lang
.
String
owner
)
{
this
.
owner
=
owner
;
this
.
owner
=
owner
;
}
}
/**
* icon
*/
private
java
.
lang
.
String
icon
;
public
String
getIcon
()
{
return
icon
;
}
public
void
setIcon
(
String
icon
)
{
this
.
icon
=
icon
;
}
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/entity/BizAgentApplicationLargeModelListEntity.java
View file @
84d0d5e2
...
@@ -40,4 +40,30 @@ public class BizAgentApplicationLargeModelListEntity {
...
@@ -40,4 +40,30 @@ public class BizAgentApplicationLargeModelListEntity {
public
void
setOwner
(
java
.
lang
.
String
owner
){
public
void
setOwner
(
java
.
lang
.
String
owner
){
this
.
owner
=
owner
;
this
.
owner
=
owner
;
}
}
/**
* icon_url
*/
private
String
iconUrl
;
public
String
getIconUrl
()
{
return
iconUrl
;
}
public
void
setIconUrl
(
String
iconUrl
)
{
this
.
iconUrl
=
iconUrl
;
}
/**
* model_nick_name
*/
private
String
modelNickName
;
public
String
getModelNickName
()
{
return
modelNickName
;
}
public
void
setModelNickName
(
String
modelNickName
)
{
this
.
modelNickName
=
modelNickName
;
}
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/model/BizAgentApplicationLargeModelListModel.java
View file @
84d0d5e2
package
cn
.
com
.
poc
.
agent_application
.
model
;
package
cn
.
com
.
poc
.
agent_application
.
model
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
cn.com.yict.framemax.data.model.BaseModelClass
;
import
cn.com.yict.framemax.data.model.BaseModelClass
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicInsert
;
import
org.hibernate.annotations.DynamicUpdate
;
import
org.hibernate.annotations.DynamicUpdate
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.GenerationType
;
...
@@ -22,55 +26,89 @@ import javax.persistence.GenerationType;
...
@@ -22,55 +26,89 @@ import javax.persistence.GenerationType;
public
class
BizAgentApplicationLargeModelListModel
extends
BaseModelClass
implements
Serializable
{
public
class
BizAgentApplicationLargeModelListModel
extends
BaseModelClass
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/**
id
/**
*
* id
*/
*/
private
java
.
lang
.
Integer
id
;
private
java
.
lang
.
Integer
id
;
@Column
(
name
=
"id"
,
length
=
10
)
@Column
(
name
=
"id"
,
length
=
10
)
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@Id
public
java
.
lang
.
Integer
getId
(){
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
public
java
.
lang
.
Integer
getId
()
{
return
this
.
id
;
return
this
.
id
;
}
}
public
void
setId
(
java
.
lang
.
Integer
id
){
public
void
setId
(
java
.
lang
.
Integer
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
super
.
addValidField
(
"id"
);
super
.
addValidField
(
"id"
);
}
}
/** model_name
/**
*模型
* model_name
*/
* 模型
*/
private
java
.
lang
.
String
modelName
;
private
java
.
lang
.
String
modelName
;
@Column
(
name
=
"model_name"
,
length
=
100
)
@Column
(
name
=
"model_name"
,
length
=
100
)
public
java
.
lang
.
String
getModelName
(){
public
java
.
lang
.
String
getModelName
()
{
return
this
.
modelName
;
return
this
.
modelName
;
}
}
public
void
setModelName
(
java
.
lang
.
String
modelName
){
public
void
setModelName
(
java
.
lang
.
String
modelName
)
{
this
.
modelName
=
modelName
;
this
.
modelName
=
modelName
;
super
.
addValidField
(
"modelName"
);
super
.
addValidField
(
"modelName"
);
}
}
/** owner
/**
*模型服务商
* owner
*/
* 模型服务商
*/
private
java
.
lang
.
String
owner
;
private
java
.
lang
.
String
owner
;
@Column
(
name
=
"owner"
,
length
=
100
)
@Column
(
name
=
"owner"
,
length
=
100
)
public
java
.
lang
.
String
getOwner
(){
public
java
.
lang
.
String
getOwner
()
{
return
this
.
owner
;
return
this
.
owner
;
}
}
public
void
setOwner
(
java
.
lang
.
String
owner
){
public
void
setOwner
(
java
.
lang
.
String
owner
)
{
this
.
owner
=
owner
;
this
.
owner
=
owner
;
super
.
addValidField
(
"owner"
);
super
.
addValidField
(
"owner"
);
}
}
/**
* icon_url
* 模型图标
*/
private
java
.
lang
.
String
iconUrl
;
@Column
(
name
=
"icon_url"
,
length
=
150
)
public
java
.
lang
.
String
getIconUrl
()
{
return
this
.
iconUrl
;
}
public
void
setIconUrl
(
java
.
lang
.
String
iconUrl
)
{
this
.
iconUrl
=
iconUrl
;
super
.
addValidField
(
"iconUrl"
);
}
/**
* model_nick_name
*/
private
java
.
lang
.
String
modelNickName
;
@Column
(
name
=
"model_nick_name"
,
length
=
100
)
public
java
.
lang
.
String
getModelNickName
()
{
return
this
.
modelNickName
;
}
public
void
setModelNickName
(
java
.
lang
.
String
modelNickName
)
{
this
.
modelNickName
=
modelNickName
;
super
.
addValidField
(
"modelNickName"
);
}
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/rest/AgentApplicationInfoRest.java
View file @
84d0d5e2
...
@@ -56,6 +56,11 @@ public interface AgentApplicationInfoRest extends BaseRest {
...
@@ -56,6 +56,11 @@ public interface AgentApplicationInfoRest extends BaseRest {
*/
*/
List
<
BizAgentApplicationLargeModelListDto
>
getLargeModelList
()
throws
Exception
;
List
<
BizAgentApplicationLargeModelListDto
>
getLargeModelList
()
throws
Exception
;
/**
* 查询模型信息
*/
BizAgentApplicationLargeModelListDto
getLargeModelInfo
(
@RequestParam
String
query
)
throws
Exception
;
/**
/**
* 角色指令AI生成
* 角色指令AI生成
...
...
src/main/java/cn/com/poc/agent_application/rest/impl/AgentApplicationInfoRestImpl.java
View file @
84d0d5e2
...
@@ -2,11 +2,9 @@ package cn.com.poc.agent_application.rest.impl;
...
@@ -2,11 +2,9 @@ package cn.com.poc.agent_application.rest.impl;
import
cn.com.poc.agent_application.aggregate.AgentApplicationInfoService
;
import
cn.com.poc.agent_application.aggregate.AgentApplicationInfoService
;
import
cn.com.poc.agent_application.convert.AgentApplicationInfoConvert
;
import
cn.com.poc.agent_application.convert.AgentApplicationInfoConvert
;
import
cn.com.poc.agent_application.convert.BizAgentApplicationLargeModelListConvert
;
import
cn.com.poc.agent_application.dto.*
;
import
cn.com.poc.agent_application.dto.*
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationInfoEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationInfoEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationLargeModelListEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationLargeModelListEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationPublishEntity
;
import
cn.com.poc.agent_application.entity.CreateAgentTitleAndDescEntity
;
import
cn.com.poc.agent_application.entity.CreateAgentTitleAndDescEntity
;
import
cn.com.poc.agent_application.query.AgentApplicationInfoQueryCondition
;
import
cn.com.poc.agent_application.query.AgentApplicationInfoQueryCondition
;
import
cn.com.poc.agent_application.rest.AgentApplicationInfoRest
;
import
cn.com.poc.agent_application.rest.AgentApplicationInfoRest
;
...
@@ -14,9 +12,11 @@ import cn.com.poc.agent_application.service.BizAgentApplicationInfoService;
...
@@ -14,9 +12,11 @@ import cn.com.poc.agent_application.service.BizAgentApplicationInfoService;
import
cn.com.poc.agent_application.service.BizAgentApplicationLargeModelListService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationLargeModelListService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationPublishService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationPublishService
;
import
cn.com.poc.common.utils.BlContext
;
import
cn.com.poc.common.utils.BlContext
;
import
cn.com.poc.common.utils.ListUtils
;
import
cn.com.poc.support.security.oauth.entity.UserBaseEntity
;
import
cn.com.poc.support.security.oauth.entity.UserBaseEntity
;
import
cn.com.yict.framemax.core.exception.BusinessException
;
import
cn.com.yict.framemax.core.exception.BusinessException
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
cn.hutool.core.collection.ListUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -24,6 +24,7 @@ import org.springframework.util.Assert;
...
@@ -24,6 +24,7 @@ import org.springframework.util.Assert;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.swing.plaf.ListUI
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.PrintWriter
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -146,19 +147,37 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -146,19 +147,37 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
@Override
@Override
public
List
<
BizAgentApplicationLargeModelListDto
>
getLargeModelList
()
throws
Exception
{
public
List
<
BizAgentApplicationLargeModelListDto
>
getLargeModelList
()
throws
Exception
{
List
<
BizAgentApplicationLargeModelListEntity
>
entities
=
bizAgentApplicationLargeModelListService
.
findByExample
(
new
BizAgentApplicationLargeModelListEntity
(),
null
);
List
<
BizAgentApplicationLargeModelListEntity
>
entities
=
bizAgentApplicationLargeModelListService
.
findByExample
(
new
BizAgentApplicationLargeModelListEntity
(),
null
);
Map
<
String
,
List
<
String
>>
map
=
entities
.
stream
()
Map
<
String
,
List
<
BizAgentApplicationLargeModelListEntity
>>
map
=
entities
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
BizAgentApplicationLargeModelListEntity:
:
getOwner
.
collect
(
Collectors
.
groupingBy
(
BizAgentApplicationLargeModelListEntity:
:
getOwner
));
,
Collectors
.
mapping
(
BizAgentApplicationLargeModelListEntity:
:
getModelName
,
Collectors
.
toList
())));
List
<
BizAgentApplicationLargeModelListDto
>
result
=
new
ArrayList
<>();
List
<
BizAgentApplicationLargeModelListDto
>
result
=
new
ArrayList
<>();
for
(
String
owner
:
map
.
keySet
())
{
for
(
String
owner
:
map
.
keySet
())
{
BizAgentApplicationLargeModelListDto
dto
=
new
BizAgentApplicationLargeModelListDto
();
BizAgentApplicationLargeModelListDto
dto
=
new
BizAgentApplicationLargeModelListDto
();
List
<
BizAgentApplicationLargeModelListEntity
>
modelListEntities
=
map
.
get
(
owner
);
dto
.
setOwner
(
owner
);
dto
.
setOwner
(
owner
);
dto
.
setModels
(
map
.
get
(
owner
));
dto
.
setModels
(
modelListEntities
.
stream
().
map
(
BizAgentApplicationLargeModelListEntity:
:
getModelNickName
).
collect
(
Collectors
.
toList
()));
dto
.
setIcon
(
modelListEntities
.
get
(
0
).
getIconUrl
());
result
.
add
(
dto
);
result
.
add
(
dto
);
}
}
return
result
;
return
result
;
}
}
@Override
public
BizAgentApplicationLargeModelListDto
getLargeModelInfo
(
String
query
)
throws
Exception
{
Assert
.
notNull
(
query
);
BizAgentApplicationLargeModelListEntity
bizAgentApplicationLargeModelListEntity
=
new
BizAgentApplicationLargeModelListEntity
();
bizAgentApplicationLargeModelListEntity
.
setModelNickName
(
query
);
List
<
BizAgentApplicationLargeModelListEntity
>
entities
=
bizAgentApplicationLargeModelListService
.
findByExample
(
bizAgentApplicationLargeModelListEntity
,
null
);
if
(
CollectionUtils
.
isEmpty
(
entities
))
{
throw
new
BusinessException
(
"模型不存在"
);
}
BizAgentApplicationLargeModelListEntity
entity
=
entities
.
get
(
0
);
BizAgentApplicationLargeModelListDto
result
=
new
BizAgentApplicationLargeModelListDto
();
result
.
setModels
(
ListUtil
.
toList
(
entity
.
getModelNickName
()));
result
.
setOwner
(
entity
.
getOwner
());
result
.
setIcon
(
entity
.
getIconUrl
());
return
result
;
}
@Override
@Override
public
void
createAgentSystem
(
AgentApplicationGCDto
dto
,
HttpServletResponse
response
)
throws
Exception
{
public
void
createAgentSystem
(
AgentApplicationGCDto
dto
,
HttpServletResponse
response
)
throws
Exception
{
...
...
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