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
bb1c1abd
Commit
bb1c1abd
authored
Oct 24, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
4c9b290a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
32 deletions
+17
-32
AgentApplicationInfoServiceImpl.java
...ation/aggregate/impl/AgentApplicationInfoServiceImpl.java
+14
-13
AgentApplicationServiceImpl.java
...oc/expose/aggregate/impl/AgentApplicationServiceImpl.java
+3
-19
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationInfoServiceImpl.java
View file @
bb1c1abd
...
...
@@ -617,9 +617,10 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
int
index
=
0
;
for
(
Message
message
:
messages
)
{
if
(
message
.
getContent
()
instanceof
List
)
{
List
<
HashMap
<
String
,
Object
>>
content
=
(
List
<
HashMap
<
String
,
Object
>>)
message
.
getContent
();
if
(
content
.
get
(
0
).
get
(
"type"
).
equals
(
"text"
))
{
message
.
setContent
(
content
.
get
(
0
).
get
(
"text"
).
toString
());
List
<
HashMap
<
String
,
Object
>>
content
=
(
List
<
HashMap
<
String
,
Object
>>)
message
.
getContent
();
HashMap
<
String
,
Object
>
map
=
content
.
get
(
0
);
if
(
map
.
containsKey
(
"type"
)
&&
map
.
get
(
"type"
).
equals
(
"text"
)
&&
map
.
containsKey
(
"text"
))
{
message
.
setContent
(
map
.
get
(
"text"
).
toString
());
}
}
messageArray
[
index
++]
=
message
;
...
...
@@ -650,7 +651,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
}
BizAgentApplicationMallEntity
mallEntity
=
bizAgentApplicationMallService
.
get
(
id
);
if
(
mallEntity
==
null
)
{
if
(
mallEntity
==
null
)
{
throw
new
BusinessException
(
"应用不存在"
);
}
...
...
@@ -659,23 +660,23 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
collectEntity
.
setAgentId
(
agentId
);
collectEntity
.
setMemberId
(
userBaseEntity
.
getUserId
().
intValue
());
List
<
BizMemberAgentApplicationCollectEntity
>
collectEntities
=
bizMemberAgentApplicationCollectService
.
findByExample
(
collectEntity
,
new
PagingInfo
());
if
(
collectEntities
.
isEmpty
()
||
CommonConstant
.
IsDeleted
.
N
.
equals
(
collectEntities
.
get
(
0
).
getIsCollect
()))
{
//如果没被收藏
if
(
collectEntities
.
isEmpty
()
||
CommonConstant
.
IsDeleted
.
N
.
equals
(
collectEntities
.
get
(
0
).
getIsCollect
()))
{
//如果没被收藏
// 收藏该应用
// 说明从来没收藏过
if
(
collectEntities
.
isEmpty
())
{
if
(
collectEntities
.
isEmpty
())
{
// 在用户收藏表中添加数据
BizMemberAgentApplicationCollectEntity
entity
=
new
BizMemberAgentApplicationCollectEntity
();
entity
.
setIsCollect
(
CommonConstant
.
IsDeleted
.
Y
);
entity
.
setMemberId
(
userBaseEntity
.
getUserId
().
intValue
());
entity
.
setAgentId
(
agentId
);
bizMemberAgentApplicationCollectService
.
save
(
entity
);
}
else
{
// 说明之前收藏过,则只需要做个修改
}
else
{
// 说明之前收藏过,则只需要做个修改
collectEntity
.
setIsCollect
(
CommonConstant
.
IsDeleted
.
Y
);
bizMemberAgentApplicationCollectService
.
update
(
collectEntity
);
}
// 在应用广场的应用中 添加收藏数
mallEntity
.
setCollectNumber
(
mallEntity
.
getCollectNumber
()
+
1
);
}
else
{
}
else
{
// 取消收藏该应用
collectEntities
.
get
(
0
).
setIsCollect
(
CommonConstant
.
IsDeleted
.
N
);
bizMemberAgentApplicationCollectService
.
update
(
collectEntity
);
...
...
@@ -697,24 +698,24 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
collectEntity
.
setAgentId
(
agentId
);
collectEntity
.
setMemberId
(
userBaseEntity
.
getUserId
().
intValue
());
List
<
BizMemberAgentApplicationCollectEntity
>
collectEntities
=
bizMemberAgentApplicationCollectService
.
findByExample
(
collectEntity
,
new
PagingInfo
());
if
(
collectEntities
.
isEmpty
()
||
CommonConstant
.
IsDeleted
.
N
.
equals
(
collectEntities
.
get
(
0
).
getIsCollect
()))
{
//如果没被收藏
if
(
collectEntities
.
isEmpty
()
||
CommonConstant
.
IsDeleted
.
N
.
equals
(
collectEntities
.
get
(
0
).
getIsCollect
()))
{
//如果没被收藏
// 收藏该应用
// 说明从来没收藏过
if
(
collectEntities
.
isEmpty
())
{
if
(
collectEntities
.
isEmpty
())
{
// 在用户收藏表中添加数据
BizMemberAgentApplicationCollectEntity
entity
=
new
BizMemberAgentApplicationCollectEntity
();
entity
.
setIsCollect
(
CommonConstant
.
IsDeleted
.
Y
);
entity
.
setMemberId
(
userBaseEntity
.
getUserId
().
intValue
());
entity
.
setAgentId
(
agentId
);
bizMemberAgentApplicationCollectService
.
save
(
entity
);
}
else
{
// 说明之前收藏过,则只需要做个修改
}
else
{
// 说明之前收藏过,则只需要做个修改
collectEntity
.
setIsCollect
(
CommonConstant
.
IsDeleted
.
Y
);
bizMemberAgentApplicationCollectService
.
update
(
collectEntity
);
}
}
else
{
}
else
{
// 取消收藏该应用
collectEntities
.
get
(
0
).
setIsCollect
(
CommonConstant
.
IsDeleted
.
N
);
bizMemberAgentApplicationCollectService
.
update
(
collectEntities
.
get
(
0
));
bizMemberAgentApplicationCollectService
.
update
(
collectEntities
.
get
(
0
));
}
}
}
src/main/java/cn/com/poc/expose/aggregate/impl/AgentApplicationServiceImpl.java
View file @
bb1c1abd
...
...
@@ -193,13 +193,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
CommonThreadPoolExecutor
.
addTask
(()
->
{
Message
message
=
new
Message
();
message
.
setRole
(
AgentApplicationDialoguesRecordConstants
.
ROLE
.
USER
);
MultiContent
multiContent
=
new
MultiContent
();
multiContent
.
setText
(
"请给我生成一个推荐问题,不超过50字,只需输出问题即可,不要输出额外的内容,不要换行"
);
multiContent
.
setType
(
"text"
);
ArrayList
<
MultiContent
>
multiContents
=
new
ArrayList
<>();
multiContents
.
add
(
multiContent
);
message
.
setContent
(
multiContents
);
message
.
setContent
(
"请给我生成一个推荐问题,不超过50字,只需输出问题即可,不要输出额外的内容,不要换行"
);
Message
[]
messages
=
new
Message
[]{
message
};
LargeModelResponse
largeModelResponse
=
new
LargeModelResponse
();
...
...
@@ -228,23 +222,13 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
if
(
CollectionUtils
.
isNotEmpty
(
recordEntities
))
{
for
(
BizAgentApplicationDialoguesRecordEntity
entity
:
recordEntities
)
{
Message
message
=
new
Message
();
MultiContent
multiContent
=
new
MultiContent
();
multiContent
.
setType
(
"text"
);
multiContent
.
setText
(
entity
.
getContent
());
message
.
setContent
(
new
ArrayList
<
MultiContent
>()
{{
add
(
multiContent
);
}});
message
.
setContent
(
entity
.
getContent
());
message
.
setRole
(
entity
.
getRole
());
messages
.
add
(
message
);
}
}
Message
message
=
new
Message
();
MultiContent
multiContent
=
new
MultiContent
();
multiContent
.
setType
(
"text"
);
multiContent
.
setText
(
input
);
message
.
setContent
(
new
ArrayList
<
MultiContent
>()
{{
add
(
multiContent
);
}});
message
.
setContent
(
input
);
message
.
setRole
(
AgentApplicationDialoguesRecordConstants
.
ROLE
.
USER
);
messages
.
add
(
message
);
logger
.
info
(
"--------- Build Messages dialogsId:{},agentId:{},messages:{}--------------"
,
dialogsId
,
agentId
,
messages
);
...
...
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