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
ed056161
Commit
ed056161
authored
Oct 28, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add interface to get user collect agent application list in index
parent
4a83ac4b
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
299 additions
and
52 deletions
+299
-52
MemberCollectQuery.sql
...cn/com/poc/agent_application/query/MemberCollectQuery.sql
+10
-0
MemberCollectQueryCondition.java
.../agent_application/query/MemberCollectQueryCondition.java
+34
-0
MemberCollectQueryItem.java
...m/poc/agent_application/query/MemberCollectQueryItem.java
+86
-0
BizMemberAgentApplicationCollectService.java
...tion/service/BizMemberAgentApplicationCollectService.java
+8
-3
BizMemberAgentApplicationCollectServiceImpl.java
...ice/impl/BizMemberAgentApplicationCollectServiceImpl.java
+48
-40
AgentApplicationService.java
.../cn/com/poc/expose/aggregate/AgentApplicationService.java
+8
-0
AgentApplicationServiceImpl.java
...oc/expose/aggregate/impl/AgentApplicationServiceImpl.java
+17
-0
UserCollectDto.java
src/main/java/cn/com/poc/expose/dto/UserCollectDto.java
+57
-0
AgentApplicationRest.java
...ain/java/cn/com/poc/expose/rest/AgentApplicationRest.java
+6
-4
AgentApplicationRestImpl.java
...cn/com/poc/expose/rest/impl/AgentApplicationRestImpl.java
+25
-5
No files found.
src/main/java/cn/com/poc/agent_application/query/MemberCollectQuery.sql
0 → 100644
View file @
ed056161
select
baap
.
member_id
as
member_id
,
baap
.
agent_id
as
agent_id
,
baap
.
agent_title
as
agent_title
,
baap
.
agent_desc
as
agent_desc
,
baap
.
agent_avatar
as
agent_avatar
from
biz_member_agent_application_collect
bmaac
left
join
biz_agent_application_publish
baap
on
baap
.
agent_id
=
bmaac
.
agent_id
and
baap
.
is_deleted
=
'N'
where
bmaac
.
is_deleted
=
'N'
<<
and
bmaac
.
is_collect
=
:
isCollect
>>
<<
and
bmaac
.
member_id
=
:
memberId
>>
order
by
baap
.
created_time
desc
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/MemberCollectQueryCondition.java
0 → 100644
View file @
ed056161
package
cn
.
com
.
poc
.
agent_application
.
query
;
import
java.io.Serializable
;
/**
* Query Condition class for MemberCollectQuery
*/
public
class
MemberCollectQueryCondition
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
java
.
lang
.
String
isCollect
;
public
java
.
lang
.
String
getIsCollect
(){
return
this
.
isCollect
;
}
public
void
setIsCollect
(
java
.
lang
.
String
isCollect
){
this
.
isCollect
=
isCollect
;
}
private
java
.
lang
.
Long
memberId
;
public
java
.
lang
.
Long
getMemberId
(){
return
this
.
memberId
;
}
public
void
setMemberId
(
java
.
lang
.
Long
memberId
){
this
.
memberId
=
memberId
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/MemberCollectQueryItem.java
0 → 100644
View file @
ed056161
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 MemberCollectQuery
*/
@Entity
public
class
MemberCollectQueryItem
extends
BaseItemClass
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** member_id
*member_id
*/
private
java
.
lang
.
Integer
memberId
;
@Column
(
name
=
"member_id"
)
public
java
.
lang
.
Integer
getMemberId
(){
return
this
.
memberId
;
}
public
void
setMemberId
(
java
.
lang
.
Integer
memberId
){
this
.
memberId
=
memberId
;
}
/** agent_id
*agent_id
*/
private
java
.
lang
.
String
agentId
;
@Column
(
name
=
"agent_id"
)
public
java
.
lang
.
String
getAgentId
(){
return
this
.
agentId
;
}
public
void
setAgentId
(
java
.
lang
.
String
agentId
){
this
.
agentId
=
agentId
;
}
/** agent_title
*agent_title
*/
private
java
.
lang
.
String
agentTitle
;
@Column
(
name
=
"agent_title"
)
public
java
.
lang
.
String
getAgentTitle
(){
return
this
.
agentTitle
;
}
public
void
setAgentTitle
(
java
.
lang
.
String
agentTitle
){
this
.
agentTitle
=
agentTitle
;
}
/** agent_desc
*agent_desc
*/
private
java
.
lang
.
String
agentDesc
;
@Column
(
name
=
"agent_desc"
)
public
java
.
lang
.
String
getAgentDesc
(){
return
this
.
agentDesc
;
}
public
void
setAgentDesc
(
java
.
lang
.
String
agentDesc
){
this
.
agentDesc
=
agentDesc
;
}
/** agent_avatar
*agent_avatar
*/
private
java
.
lang
.
String
agentAvatar
;
@Column
(
name
=
"agent_avatar"
)
public
java
.
lang
.
String
getAgentAvatar
(){
return
this
.
agentAvatar
;
}
public
void
setAgentAvatar
(
java
.
lang
.
String
agentAvatar
){
this
.
agentAvatar
=
agentAvatar
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/service/BizMemberAgentApplicationCollectService.java
View file @
ed056161
package
cn
.
com
.
poc
.
agent_application
.
service
;
package
cn
.
com
.
poc
.
agent_application
.
service
;
import
cn.com.poc.agent_application.query.MemberCollectQueryCondition
;
import
cn.com.poc.agent_application.query.MemberCollectQueryItem
;
import
cn.com.yict.framemax.core.service.BaseService
;
import
cn.com.yict.framemax.core.service.BaseService
;
import
cn.com.poc.agent_application.entity.BizMemberAgentApplicationCollectEntity
;
import
cn.com.poc.agent_application.entity.BizMemberAgentApplicationCollectEntity
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
java.util.List
;
import
java.util.List
;
public
interface
BizMemberAgentApplicationCollectService
extends
BaseService
{
public
interface
BizMemberAgentApplicationCollectService
extends
BaseService
{
...
@@ -11,12 +14,14 @@ public interface BizMemberAgentApplicationCollectService extends BaseService {
...
@@ -11,12 +14,14 @@ public interface BizMemberAgentApplicationCollectService extends BaseService {
BizMemberAgentApplicationCollectEntity
getByAgentId
(
java
.
lang
.
String
agentId
)
throws
Exception
;
BizMemberAgentApplicationCollectEntity
getByAgentId
(
java
.
lang
.
String
agentId
)
throws
Exception
;
List
<
BizMemberAgentApplicationCollectEntity
>
findByExample
(
BizMemberAgentApplicationCollectEntity
example
,
PagingInfo
pagingInfo
)
throws
Exception
;
List
<
BizMemberAgentApplicationCollectEntity
>
findByExample
(
BizMemberAgentApplicationCollectEntity
example
,
PagingInfo
pagingInfo
)
throws
Exception
;
BizMemberAgentApplicationCollectEntity
save
(
BizMemberAgentApplicationCollectEntity
entity
)
throws
Exception
;
BizMemberAgentApplicationCollectEntity
save
(
BizMemberAgentApplicationCollectEntity
entity
)
throws
Exception
;
BizMemberAgentApplicationCollectEntity
update
(
BizMemberAgentApplicationCollectEntity
entity
)
throws
Exception
;
BizMemberAgentApplicationCollectEntity
update
(
BizMemberAgentApplicationCollectEntity
entity
)
throws
Exception
;
void
deletedById
(
java
.
lang
.
Integer
id
)
throws
Exception
;
void
deletedById
(
java
.
lang
.
Integer
id
)
throws
Exception
;
List
<
MemberCollectQueryItem
>
queryMemberCollect
(
MemberCollectQueryCondition
condition
,
PagingInfo
pagingInfo
)
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/service/impl/BizMemberAgentApplicationCollectServiceImpl.java
View file @
ed056161
package
cn
.
com
.
poc
.
agent_application
.
service
.
impl
;
package
cn
.
com
.
poc
.
agent_application
.
service
.
impl
;
import
cn.com.poc.agent_application.query.MemberCollectQueryCondition
;
import
cn.com.poc.agent_application.query.MemberCollectQueryItem
;
import
cn.com.yict.framemax.core.service.impl.BaseServiceImpl
;
import
cn.com.yict.framemax.core.service.impl.BaseServiceImpl
;
import
cn.com.poc.agent_application.service.BizMemberAgentApplicationCollectService
;
import
cn.com.poc.agent_application.service.BizMemberAgentApplicationCollectService
;
import
cn.com.poc.agent_application.model.BizMemberAgentApplicationCollectModel
;
import
cn.com.poc.agent_application.model.BizMemberAgentApplicationCollectModel
;
...
@@ -10,30 +12,32 @@ import cn.com.yict.framemax.data.model.PagingInfo;
...
@@ -10,30 +12,32 @@ import cn.com.yict.framemax.data.model.PagingInfo;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.List
;
import
java.util.List
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
@Service
@Service
public
class
BizMemberAgentApplicationCollectServiceImpl
extends
BaseServiceImpl
public
class
BizMemberAgentApplicationCollectServiceImpl
extends
BaseServiceImpl
implements
BizMemberAgentApplicationCollectService
{
implements
BizMemberAgentApplicationCollectService
{
@Resource
@Resource
private
BizMemberAgentApplicationCollectRepository
repository
;
private
BizMemberAgentApplicationCollectRepository
repository
;
public
BizMemberAgentApplicationCollectEntity
get
(
java
.
lang
.
Integer
id
)
throws
Exception
{
public
BizMemberAgentApplicationCollectEntity
get
(
java
.
lang
.
Integer
id
)
throws
Exception
{
Assert
.
notNull
(
id
);
Assert
.
notNull
(
id
);
BizMemberAgentApplicationCollectModel
model
=
this
.
repository
.
get
(
id
);
BizMemberAgentApplicationCollectModel
model
=
this
.
repository
.
get
(
id
);
if
(
model
==
null
){
if
(
model
==
null
)
{
return
null
;
return
null
;
}
}
if
(
"Y"
.
equals
(
model
.
getIsDeleted
())){
if
(
"Y"
.
equals
(
model
.
getIsDeleted
()))
{
return
null
;
return
null
;
}
}
return
BizMemberAgentApplicationCollectConvert
.
modelToEntity
(
model
);
return
BizMemberAgentApplicationCollectConvert
.
modelToEntity
(
model
);
}
}
@Override
@Override
public
BizMemberAgentApplicationCollectEntity
getByAgentId
(
String
agentId
)
throws
Exception
{
public
BizMemberAgentApplicationCollectEntity
getByAgentId
(
String
agentId
)
throws
Exception
{
...
@@ -41,66 +45,70 @@ public class BizMemberAgentApplicationCollectServiceImpl extends BaseServiceImpl
...
@@ -41,66 +45,70 @@ public class BizMemberAgentApplicationCollectServiceImpl extends BaseServiceImpl
model
.
setAgentId
(
agentId
);
model
.
setAgentId
(
agentId
);
model
.
setIsDeleted
(
"N"
);
model
.
setIsDeleted
(
"N"
);
List
<
BizMemberAgentApplicationCollectModel
>
models
=
this
.
repository
.
findByExample
(
model
);
List
<
BizMemberAgentApplicationCollectModel
>
models
=
this
.
repository
.
findByExample
(
model
);
if
(!
models
.
isEmpty
())
{
if
(!
models
.
isEmpty
())
{
return
BizMemberAgentApplicationCollectConvert
.
modelToEntity
(
models
.
get
(
0
));
return
BizMemberAgentApplicationCollectConvert
.
modelToEntity
(
models
.
get
(
0
));
}
}
return
null
;
return
null
;
}
}
public
List
<
BizMemberAgentApplicationCollectEntity
>
findByExample
(
BizMemberAgentApplicationCollectEntity
example
,
PagingInfo
pagingInfo
)
throws
Exception
{
public
List
<
BizMemberAgentApplicationCollectEntity
>
findByExample
(
BizMemberAgentApplicationCollectEntity
example
,
PagingInfo
pagingInfo
)
throws
Exception
{
List
<
BizMemberAgentApplicationCollectEntity
>
result
=
new
ArrayList
<
BizMemberAgentApplicationCollectEntity
>();
List
<
BizMemberAgentApplicationCollectEntity
>
result
=
new
ArrayList
<
BizMemberAgentApplicationCollectEntity
>();
BizMemberAgentApplicationCollectModel
model
=
new
BizMemberAgentApplicationCollectModel
();
BizMemberAgentApplicationCollectModel
model
=
new
BizMemberAgentApplicationCollectModel
();
if
(
example
!=
null
){
if
(
example
!=
null
)
{
model
=
BizMemberAgentApplicationCollectConvert
.
entityToModel
(
example
);
model
=
BizMemberAgentApplicationCollectConvert
.
entityToModel
(
example
);
}
}
model
.
setIsDeleted
(
"N"
);
model
.
setIsDeleted
(
"N"
);
List
<
BizMemberAgentApplicationCollectModel
>
models
=
this
.
repository
.
findByExample
(
model
,
pagingInfo
);
List
<
BizMemberAgentApplicationCollectModel
>
models
=
this
.
repository
.
findByExample
(
model
,
pagingInfo
);
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
result
=
models
.
stream
().
map
(
BizMemberAgentApplicationCollectConvert:
:
modelToEntity
).
collect
(
Collectors
.
toList
());
result
=
models
.
stream
().
map
(
BizMemberAgentApplicationCollectConvert:
:
modelToEntity
).
collect
(
Collectors
.
toList
());
}
}
return
result
;
return
result
;
}
}
public
BizMemberAgentApplicationCollectEntity
save
(
BizMemberAgentApplicationCollectEntity
entity
)
throws
Exception
{
public
BizMemberAgentApplicationCollectEntity
save
(
BizMemberAgentApplicationCollectEntity
entity
)
throws
Exception
{
Assert
.
notNull
(
entity
);
Assert
.
notNull
(
entity
);
entity
.
setId
(
null
);
entity
.
setId
(
null
);
entity
.
setIsDeleted
(
"N"
);
entity
.
setIsDeleted
(
"N"
);
BizMemberAgentApplicationCollectModel
model
=
BizMemberAgentApplicationCollectConvert
.
entityToModel
(
entity
);
BizMemberAgentApplicationCollectModel
model
=
BizMemberAgentApplicationCollectConvert
.
entityToModel
(
entity
);
BizMemberAgentApplicationCollectModel
saveModel
=
this
.
repository
.
save
(
model
);
BizMemberAgentApplicationCollectModel
saveModel
=
this
.
repository
.
save
(
model
);
return
BizMemberAgentApplicationCollectConvert
.
modelToEntity
(
saveModel
);
return
BizMemberAgentApplicationCollectConvert
.
modelToEntity
(
saveModel
);
}
}
public
BizMemberAgentApplicationCollectEntity
update
(
BizMemberAgentApplicationCollectEntity
entity
)
throws
Exception
{
public
BizMemberAgentApplicationCollectEntity
update
(
BizMemberAgentApplicationCollectEntity
entity
)
throws
Exception
{
Assert
.
notNull
(
entity
);
Assert
.
notNull
(
entity
);
Assert
.
notNull
(
entity
.
getId
(),
"update pk can not be null"
);
Assert
.
notNull
(
entity
.
getId
(),
"update pk can not be null"
);
BizMemberAgentApplicationCollectModel
model
=
this
.
repository
.
get
(
entity
.
getId
());
BizMemberAgentApplicationCollectModel
model
=
this
.
repository
.
get
(
entity
.
getId
());
if
(
entity
.
getMemberId
()
!=
null
)
{
if
(
entity
.
getMemberId
()
!=
null
)
{
model
.
setMemberId
(
entity
.
getMemberId
());
model
.
setMemberId
(
entity
.
getMemberId
());
}
}
if
(
entity
.
getAgentId
()
!=
null
)
{
if
(
entity
.
getAgentId
()
!=
null
)
{
model
.
setAgentId
(
entity
.
getAgentId
());
model
.
setAgentId
(
entity
.
getAgentId
());
}
}
if
(
entity
.
getIsCollect
()
!=
null
)
{
if
(
entity
.
getIsCollect
()
!=
null
)
{
model
.
setIsCollect
(
entity
.
getIsCollect
());
model
.
setIsCollect
(
entity
.
getIsCollect
());
}
}
if
(
entity
.
getIsDeleted
()
!=
null
)
{
if
(
entity
.
getIsDeleted
()
!=
null
)
{
model
.
setIsDeleted
(
entity
.
getIsDeleted
());
model
.
setIsDeleted
(
entity
.
getIsDeleted
());
}
}
BizMemberAgentApplicationCollectModel
saveModel
=
this
.
repository
.
save
(
model
);
BizMemberAgentApplicationCollectModel
saveModel
=
this
.
repository
.
save
(
model
);
return
BizMemberAgentApplicationCollectConvert
.
modelToEntity
(
saveModel
);
return
BizMemberAgentApplicationCollectConvert
.
modelToEntity
(
saveModel
);
}
}
public
void
deletedById
(
java
.
lang
.
Integer
id
)
throws
Exception
{
public
void
deletedById
(
java
.
lang
.
Integer
id
)
throws
Exception
{
Assert
.
notNull
(
id
);
Assert
.
notNull
(
id
);
BizMemberAgentApplicationCollectModel
model
=
this
.
repository
.
get
(
id
);
BizMemberAgentApplicationCollectModel
model
=
this
.
repository
.
get
(
id
);
if
(
model
!=
null
){
if
(
model
!=
null
)
{
if
(
"N"
.
equals
(
model
.
getIsDeleted
())){
if
(
"N"
.
equals
(
model
.
getIsDeleted
()))
{
model
.
setIsDeleted
(
"Y"
);
model
.
setIsDeleted
(
"Y"
);
this
.
repository
.
save
(
model
);
this
.
repository
.
save
(
model
);
}
}
}
}
}
}
@Override
public
List
<
MemberCollectQueryItem
>
queryMemberCollect
(
MemberCollectQueryCondition
condition
,
PagingInfo
pagingInfo
)
{
return
this
.
sqlDao
.
query
(
condition
,
MemberCollectQueryItem
.
class
,
pagingInfo
);
}
}
}
\ No newline at end of file
src/main/java/cn/com/poc/expose/aggregate/AgentApplicationService.java
View file @
ed056161
package
cn
.
com
.
poc
.
expose
.
aggregate
;
package
cn
.
com
.
poc
.
expose
.
aggregate
;
import
cn.com.poc.agent_application.query.MemberCollectQueryItem
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.List
;
...
@@ -30,4 +33,9 @@ public interface AgentApplicationService {
...
@@ -30,4 +33,9 @@ public interface AgentApplicationService {
*/
*/
void
createRecommendQuestion
()
throws
InterruptedException
;
void
createRecommendQuestion
()
throws
InterruptedException
;
/**
* 【首页】 获取用户已收藏的应用列表
*/
List
<
MemberCollectQueryItem
>
getCollectedApplications
(
Long
memberId
,
PagingInfo
pagingInfo
);
}
}
src/main/java/cn/com/poc/expose/aggregate/impl/AgentApplicationServiceImpl.java
View file @
ed056161
...
@@ -6,9 +6,12 @@ import cn.com.poc.agent_application.constant.AgentApplicationGCConfigConstants;
...
@@ -6,9 +6,12 @@ import cn.com.poc.agent_application.constant.AgentApplicationGCConfigConstants;
import
cn.com.poc.agent_application.entity.BizAgentApplicationDialoguesRecordEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationDialoguesRecordEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationGcConfigEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationGcConfigEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationPublishEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationPublishEntity
;
import
cn.com.poc.agent_application.query.MemberCollectQueryCondition
;
import
cn.com.poc.agent_application.query.MemberCollectQueryItem
;
import
cn.com.poc.agent_application.service.BizAgentApplicationDialoguesRecordService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationDialoguesRecordService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationGcConfigService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationGcConfigService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationPublishService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationPublishService
;
import
cn.com.poc.agent_application.service.BizMemberAgentApplicationCollectService
;
import
cn.com.poc.common.constant.CommonConstant
;
import
cn.com.poc.common.constant.CommonConstant
;
import
cn.com.poc.common.service.RedisService
;
import
cn.com.poc.common.service.RedisService
;
import
cn.com.poc.common.utils.BlContext
;
import
cn.com.poc.common.utils.BlContext
;
...
@@ -25,6 +28,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.entity.largemodel.LargeModelResp
...
@@ -25,6 +28,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.entity.largemodel.LargeModelResp
import
cn.com.poc.thirdparty.resource.demand.ai.function.LargeModelFunctionEnum
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.LargeModelFunctionEnum
;
import
cn.com.poc.thirdparty.service.LLMService
;
import
cn.com.poc.thirdparty.service.LLMService
;
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
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
...
@@ -48,6 +52,10 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
...
@@ -48,6 +52,10 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
final
private
String
AGENT_APPLICATION_RECOMMEND_QUESTIONS
=
"AGENT_APPLICATION_RECOMMEND_QUESTIONS"
;
final
private
String
AGENT_APPLICATION_RECOMMEND_QUESTIONS
=
"AGENT_APPLICATION_RECOMMEND_QUESTIONS"
;
@Resource
private
BizMemberAgentApplicationCollectService
bizMemberAgentApplicationCollectService
;
@Resource
@Resource
private
KnowledgeService
knowledgeService
;
private
KnowledgeService
knowledgeService
;
...
@@ -234,6 +242,15 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
...
@@ -234,6 +242,15 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
redisService
.
lSet
(
AGENT_APPLICATION_RECOMMEND_QUESTIONS
,
questions
);
redisService
.
lSet
(
AGENT_APPLICATION_RECOMMEND_QUESTIONS
,
questions
);
}
}
@Override
public
List
<
MemberCollectQueryItem
>
getCollectedApplications
(
Long
memberId
,
PagingInfo
pagingInfo
)
{
MemberCollectQueryCondition
condition
=
new
MemberCollectQueryCondition
();
condition
.
setMemberId
(
memberId
);
condition
.
setIsCollect
(
CommonConstant
.
YOrN
.
Y
);
List
<
MemberCollectQueryItem
>
memberCollectQueryItems
=
bizMemberAgentApplicationCollectService
.
queryMemberCollect
(
condition
,
pagingInfo
);
return
memberCollectQueryItems
;
}
private
List
<
Message
>
buildMessages
(
String
dialogsId
,
String
agentId
,
Long
userId
,
String
input
)
throws
Exception
{
private
List
<
Message
>
buildMessages
(
String
dialogsId
,
String
agentId
,
Long
userId
,
String
input
)
throws
Exception
{
List
<
Message
>
messages
=
new
ArrayList
<>();
List
<
Message
>
messages
=
new
ArrayList
<>();
BizAgentApplicationDialoguesRecordEntity
recordEntity
=
new
BizAgentApplicationDialoguesRecordEntity
();
BizAgentApplicationDialoguesRecordEntity
recordEntity
=
new
BizAgentApplicationDialoguesRecordEntity
();
...
...
src/main/java/cn/com/poc/expose/dto/UserCollectDto.java
0 → 100644
View file @
ed056161
package
cn
.
com
.
poc
.
expose
.
dto
;
import
java.io.Serializable
;
public
class
UserCollectDto
implements
Serializable
{
/**
* 应用id
*/
private
String
agentId
;
/**
* 应用名称
*/
private
String
agentTitle
;
/**
* 应用描述
*/
private
String
agentDesc
;
/**
* 应用头像
*/
private
String
agentAvatar
;
public
String
getAgentId
()
{
return
agentId
;
}
public
void
setAgentId
(
String
agentId
)
{
this
.
agentId
=
agentId
;
}
public
String
getAgentTitle
()
{
return
agentTitle
;
}
public
void
setAgentTitle
(
String
agentTitle
)
{
this
.
agentTitle
=
agentTitle
;
}
public
String
getAgentDesc
()
{
return
agentDesc
;
}
public
void
setAgentDesc
(
String
agentDesc
)
{
this
.
agentDesc
=
agentDesc
;
}
public
String
getAgentAvatar
()
{
return
agentAvatar
;
}
public
void
setAgentAvatar
(
String
agentAvatar
)
{
this
.
agentAvatar
=
agentAvatar
;
}
}
src/main/java/cn/com/poc/expose/rest/AgentApplicationRest.java
View file @
ed056161
...
@@ -3,10 +3,7 @@ package cn.com.poc.expose.rest;
...
@@ -3,10 +3,7 @@ package cn.com.poc.expose.rest;
import
cn.com.poc.agent_application.dto.AgentApplicationCreateContinueQuesDto
;
import
cn.com.poc.agent_application.dto.AgentApplicationCreateContinueQuesDto
;
import
cn.com.poc.agent_application.dto.AgentApplicationInfoSearchDto
;
import
cn.com.poc.agent_application.dto.AgentApplicationInfoSearchDto
;
import
cn.com.poc.agent_application.dto.BizAgentApplicationPublishDto
;
import
cn.com.poc.agent_application.dto.BizAgentApplicationPublishDto
;
import
cn.com.poc.expose.dto.AgentApplicationDto
;
import
cn.com.poc.expose.dto.*
;
import
cn.com.poc.expose.dto.DialoguesContextDto
;
import
cn.com.poc.expose.dto.SearchAgentApplicationDto
;
import
cn.com.poc.expose.dto.UserDialoguesDto
;
import
cn.com.yict.framemax.core.rest.BaseRest
;
import
cn.com.yict.framemax.core.rest.BaseRest
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
cn.com.yict.framemax.data.model.PagingInfo
;
import
cn.com.yict.framemax.web.permission.Access
;
import
cn.com.yict.framemax.web.permission.Access
;
...
@@ -25,6 +22,11 @@ public interface AgentApplicationRest extends BaseRest {
...
@@ -25,6 +22,11 @@ public interface AgentApplicationRest extends BaseRest {
*/
*/
List
<
String
>
getRecommendQuestions
()
throws
Exception
;
List
<
String
>
getRecommendQuestions
()
throws
Exception
;
/**
* 【首页】获取用户已收藏应用
*/
List
<
UserCollectDto
>
getCollectedApplications
(
PagingInfo
pagingInfo
);
/**
/**
* 创建对话
* 创建对话
*/
*/
...
...
src/main/java/cn/com/poc/expose/rest/impl/AgentApplicationRestImpl.java
View file @
ed056161
...
@@ -8,6 +8,7 @@ import cn.com.poc.agent_application.dto.AgentApplicationInfoSearchDto;
...
@@ -8,6 +8,7 @@ import cn.com.poc.agent_application.dto.AgentApplicationInfoSearchDto;
import
cn.com.poc.agent_application.dto.BizAgentApplicationPublishDto
;
import
cn.com.poc.agent_application.dto.BizAgentApplicationPublishDto
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationDialoguesRecordEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationDialoguesRecordEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationPublishEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationPublishEntity
;
import
cn.com.poc.agent_application.query.MemberCollectQueryItem
;
import
cn.com.poc.agent_application.query.MemberDialoguesQueryItem
;
import
cn.com.poc.agent_application.query.MemberDialoguesQueryItem
;
import
cn.com.poc.agent_application.query.PublishAgentApplicationQueryCondition
;
import
cn.com.poc.agent_application.query.PublishAgentApplicationQueryCondition
;
import
cn.com.poc.agent_application.query.PublishAgentApplicationQueryItem
;
import
cn.com.poc.agent_application.query.PublishAgentApplicationQueryItem
;
...
@@ -19,10 +20,7 @@ import cn.com.poc.common.utils.BlContext;
...
@@ -19,10 +20,7 @@ import cn.com.poc.common.utils.BlContext;
import
cn.com.poc.common.utils.StringUtils
;
import
cn.com.poc.common.utils.StringUtils
;
import
cn.com.poc.common.utils.UUIDTool
;
import
cn.com.poc.common.utils.UUIDTool
;
import
cn.com.poc.expose.aggregate.AgentApplicationService
;
import
cn.com.poc.expose.aggregate.AgentApplicationService
;
import
cn.com.poc.expose.dto.AgentApplicationDto
;
import
cn.com.poc.expose.dto.*
;
import
cn.com.poc.expose.dto.DialoguesContextDto
;
import
cn.com.poc.expose.dto.SearchAgentApplicationDto
;
import
cn.com.poc.expose.dto.UserDialoguesDto
;
import
cn.com.poc.expose.rest.AgentApplicationRest
;
import
cn.com.poc.expose.rest.AgentApplicationRest
;
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
;
...
@@ -59,6 +57,28 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
...
@@ -59,6 +57,28 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
return
agentApplicationService
.
getRecommendQuestions
();
return
agentApplicationService
.
getRecommendQuestions
();
}
}
@Override
public
List
<
UserCollectDto
>
getCollectedApplications
(
PagingInfo
pagingInfo
)
{
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
if
(
userBaseEntity
==
null
)
{
throw
new
BusinessException
(
"用户未登录"
);
}
Long
memberId
=
userBaseEntity
.
getUserId
();
List
<
MemberCollectQueryItem
>
collectedApplications
=
agentApplicationService
.
getCollectedApplications
(
memberId
,
pagingInfo
);
List
<
UserCollectDto
>
result
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
collectedApplications
))
{
for
(
MemberCollectQueryItem
item
:
collectedApplications
)
{
UserCollectDto
collectDto
=
new
UserCollectDto
();
collectDto
.
setAgentId
(
item
.
getAgentId
());
collectDto
.
setAgentTitle
(
item
.
getAgentTitle
());
collectDto
.
setAgentDesc
(
item
.
getAgentDesc
());
collectDto
.
setAgentAvatar
(
item
.
getAgentAvatar
());
result
.
add
(
collectDto
);
}
}
return
result
;
}
@Override
@Override
public
String
createDialogues
()
{
public
String
createDialogues
()
{
return
"DIA_"
+
UUIDTool
.
getUUID
();
return
"DIA_"
+
UUIDTool
.
getUUID
();
...
@@ -152,7 +172,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
...
@@ -152,7 +172,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
result
=
memberDialoguesQueryItems
.
stream
().
map
(
item
->
{
result
=
memberDialoguesQueryItems
.
stream
().
map
(
item
->
{
UserDialoguesDto
userDialoguesDto
=
new
UserDialoguesDto
();
UserDialoguesDto
userDialoguesDto
=
new
UserDialoguesDto
();
userDialoguesDto
.
setDialogsId
(
item
.
getDialogsId
());
userDialoguesDto
.
setDialogsId
(
item
.
getDialogsId
());
String
content
=
item
.
getContent
().
length
()
>
20
?
item
.
getContent
().
substring
(
0
,
20
)
:
item
.
getContent
();
String
content
=
item
.
getContent
().
length
()
>
20
?
item
.
getContent
().
substring
(
0
,
20
)
:
item
.
getContent
();
userDialoguesDto
.
setContent
(
content
);
userDialoguesDto
.
setContent
(
content
);
return
userDialoguesDto
;
return
userDialoguesDto
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
...
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