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
d4089246
Commit
d4089246
authored
Nov 01, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 对话记录添加应用头像,应用标题
parent
7876e3fa
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
215 additions
and
13 deletions
+215
-13
AgentApplicationDialoguesRecordQuery.sql
...pplication/query/AgentApplicationDialoguesRecordQuery.sql
+15
-0
AgentApplicationDialoguesRecordQueryCondition.java
.../query/AgentApplicationDialoguesRecordQueryCondition.java
+23
-0
AgentApplicationDialoguesRecordQueryItem.java
...ation/query/AgentApplicationDialoguesRecordQueryItem.java
+128
-0
BizAgentApplicationDialoguesRecordService.java
...on/service/BizAgentApplicationDialoguesRecordService.java
+6
-0
BizAgentApplicationDialoguesRecordServiceImpl.java
...e/impl/BizAgentApplicationDialoguesRecordServiceImpl.java
+10
-1
DialoguesContextDto.java
src/main/java/cn/com/poc/expose/dto/DialoguesContextDto.java
+25
-0
AgentApplicationRestImpl.java
...cn/com/poc/expose/rest/impl/AgentApplicationRestImpl.java
+8
-12
No files found.
src/main/java/cn/com/poc/agent_application/query/AgentApplicationDialoguesRecordQuery.sql
0 → 100644
View file @
d4089246
select
baadr
.
role
,
baadr
.
agent_id
,
baadr
.
dialogs_id
,
baadr
.
member_id
,
baadr
.
content
,
baadr
.
`timestamp`
,
baap
.
agent_avatar
,
baap
.
agent_title
from
biz_agent_application_dialogues_record
baadr
left
join
biz_agent_application_publish
baap
on
baadr
.
agent_id
=
baap
.
agent_id
and
baap
.
is_deleted
=
'N'
where
baadr
.
is_deleted
=
'N'
<<
and
baadr
.
dialogs_id
=
:
dialogueId
>>
order
by
baadr
.
`timestamp`
desc
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/AgentApplicationDialoguesRecordQueryCondition.java
0 → 100644
View file @
d4089246
package
cn
.
com
.
poc
.
agent_application
.
query
;
import
java.io.Serializable
;
/**
* Query Condition class for AgentApplicationDialoguesRecordQuery
*/
public
class
AgentApplicationDialoguesRecordQueryCondition
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
java
.
lang
.
String
dialogueId
;
public
java
.
lang
.
String
getDialogueId
(){
return
this
.
dialogueId
;
}
public
void
setDialogueId
(
java
.
lang
.
String
dialogueId
){
this
.
dialogueId
=
dialogueId
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/AgentApplicationDialoguesRecordQueryItem.java
0 → 100644
View file @
d4089246
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 AgentApplicationDialoguesRecordQuery
*/
@Entity
public
class
AgentApplicationDialoguesRecordQueryItem
extends
BaseItemClass
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** role
*role
*/
private
java
.
lang
.
String
role
;
@Column
(
name
=
"role"
)
public
java
.
lang
.
String
getRole
(){
return
this
.
role
;
}
public
void
setRole
(
java
.
lang
.
String
role
){
this
.
role
=
role
;
}
/** 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
;
}
/** dialogs_id
*dialogs_id
*/
private
java
.
lang
.
String
dialogsId
;
@Column
(
name
=
"dialogs_id"
)
public
java
.
lang
.
String
getDialogsId
(){
return
this
.
dialogsId
;
}
public
void
setDialogsId
(
java
.
lang
.
String
dialogsId
){
this
.
dialogsId
=
dialogsId
;
}
/** member_id
*member_id
*/
private
java
.
lang
.
Long
memberId
;
@Column
(
name
=
"member_id"
)
public
java
.
lang
.
Long
getMemberId
(){
return
this
.
memberId
;
}
public
void
setMemberId
(
java
.
lang
.
Long
memberId
){
this
.
memberId
=
memberId
;
}
/** content
*content
*/
private
java
.
lang
.
String
content
;
@Column
(
name
=
"content"
)
public
java
.
lang
.
String
getContent
(){
return
this
.
content
;
}
public
void
setContent
(
java
.
lang
.
String
content
){
this
.
content
=
content
;
}
/** timestamp
*timestamp
*/
private
java
.
lang
.
Long
timestamp
;
@Column
(
name
=
"timestamp"
)
public
java
.
lang
.
Long
getTimestamp
(){
return
this
.
timestamp
;
}
public
void
setTimestamp
(
java
.
lang
.
Long
timestamp
){
this
.
timestamp
=
timestamp
;
}
/** 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
;
}
/** 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
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/service/BizAgentApplicationDialoguesRecordService.java
View file @
d4089246
package
cn
.
com
.
poc
.
agent_application
.
service
;
import
cn.com.poc.agent_application.query.AgentApplicationDialoguesRecordQueryItem
;
import
cn.com.poc.agent_application.query.MemberDialoguesQueryItem
;
import
cn.com.yict.framemax.core.service.BaseService
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationDialoguesRecordEntity
;
...
...
@@ -36,4 +37,9 @@ public interface BizAgentApplicationDialoguesRecordService extends BaseService {
*/
boolean
batchDeleteByDialogueId
(
List
<
String
>
dialogueIds
);
/**
* 获取对话记录
*/
List
<
AgentApplicationDialoguesRecordQueryItem
>
getDialogueRecord
(
String
dialogueId
,
PagingInfo
pagingInfo
);
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationDialoguesRecordServiceImpl.java
View file @
d4089246
package
cn
.
com
.
poc
.
agent_application
.
service
.
impl
;
import
cn.com.poc.agent_application.query.AgentApplicationDialoguesRecordQueryCondition
;
import
cn.com.poc.agent_application.query.AgentApplicationDialoguesRecordQueryItem
;
import
cn.com.poc.agent_application.query.MemberDialoguesQueryCondition
;
import
cn.com.poc.agent_application.query.MemberDialoguesQueryItem
;
import
cn.com.poc.common.constant.CommonConstant
;
...
...
@@ -63,7 +65,7 @@ public class BizAgentApplicationDialoguesRecordServiceImpl extends BaseServiceIm
model
=
BizAgentApplicationDialoguesRecordConvert
.
entityToModel
(
example
);
}
model
.
setIsDeleted
(
"N"
);
List
<
BizAgentApplicationDialoguesRecordModel
>
models
=
this
.
repository
.
findByExample
(
model
,
"timestamp desc"
,
new
PagingInfo
());
List
<
BizAgentApplicationDialoguesRecordModel
>
models
=
this
.
repository
.
findByExample
(
model
,
"timestamp desc"
,
new
PagingInfo
());
if
(
CollectionUtils
.
isNotEmpty
(
models
))
{
result
=
models
.
stream
().
map
(
BizAgentApplicationDialoguesRecordConvert:
:
modelToEntity
).
collect
(
Collectors
.
toList
());
}
...
...
@@ -163,4 +165,11 @@ public class BizAgentApplicationDialoguesRecordServiceImpl extends BaseServiceIm
this
.
repository
.
saveAll
(
delModels
);
return
true
;
}
@Override
public
List
<
AgentApplicationDialoguesRecordQueryItem
>
getDialogueRecord
(
String
dialogueId
,
PagingInfo
pagingInfo
)
{
AgentApplicationDialoguesRecordQueryCondition
condition
=
new
AgentApplicationDialoguesRecordQueryCondition
();
condition
.
setDialogueId
(
dialogueId
);
return
this
.
sqlDao
.
query
(
condition
,
AgentApplicationDialoguesRecordQueryItem
.
class
,
pagingInfo
);
}
}
\ No newline at end of file
src/main/java/cn/com/poc/expose/dto/DialoguesContextDto.java
View file @
d4089246
...
...
@@ -57,4 +57,29 @@ public class DialoguesContextDto implements Serializable {
this
.
timestamp
=
timestamp
;
}
/**
* 应用名
*/
private
String
agentTitle
;
public
String
getAgentTitle
()
{
return
agentTitle
;
}
public
void
setAgentTitle
(
String
agentTitle
)
{
this
.
agentTitle
=
agentTitle
;
}
/**
* 应用头像
*/
private
String
agentAvatar
;
public
String
getAgentAvatar
()
{
return
agentAvatar
;
}
public
void
setAgentAvatar
(
String
agentAvatar
)
{
this
.
agentAvatar
=
agentAvatar
;
}
}
src/main/java/cn/com/poc/expose/rest/impl/AgentApplicationRestImpl.java
View file @
d4089246
...
...
@@ -8,10 +8,7 @@ import cn.com.poc.agent_application.dto.AgentApplicationInfoSearchDto;
import
cn.com.poc.agent_application.dto.BizAgentApplicationPublishDto
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationDialoguesRecordEntity
;
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.PublishAgentApplicationQueryCondition
;
import
cn.com.poc.agent_application.query.PublishAgentApplicationQueryItem
;
import
cn.com.poc.agent_application.query.*
;
import
cn.com.poc.agent_application.service.BizAgentApplicationDialoguesRecordService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationPublishService
;
import
cn.com.poc.common.constant.CommonConstant
;
...
...
@@ -58,7 +55,7 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
}
@Override
public
List
<
UserCollectDto
>
getCollectedApplications
(
PagingInfo
pagingInfo
)
{
public
List
<
UserCollectDto
>
getCollectedApplications
(
PagingInfo
pagingInfo
)
{
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
if
(
userBaseEntity
==
null
)
{
throw
new
BusinessException
(
"用户未登录"
);
...
...
@@ -200,19 +197,18 @@ public class AgentApplicationRestImpl implements AgentApplicationRest {
}
@Override
public
List
<
DialoguesContextDto
>
getDialogueContext
(
String
dialogueId
)
throws
Exception
{
public
List
<
DialoguesContextDto
>
getDialogueContext
(
String
dialogueId
)
{
Assert
.
notBlank
(
dialogueId
,
"对话ID不能为空"
);
BizAgentApplicationDialoguesRecordEntity
recordEntity
=
new
BizAgentApplicationDialoguesRecordEntity
();
recordEntity
.
setDialogsId
(
dialogueId
);
recordEntity
.
setIsDeleted
(
CommonConstant
.
IsDeleted
.
N
);
List
<
BizAgentApplicationDialoguesRecordEntity
>
entities
=
bizAgentApplicationDialoguesRecordService
.
findByExample
(
recordEntity
,
null
);
if
(
CollectionUtils
.
isNotEmpty
(
entities
))
{
return
entities
.
stream
().
map
(
value
->
{
List
<
AgentApplicationDialoguesRecordQueryItem
>
items
=
bizAgentApplicationDialoguesRecordService
.
getDialogueRecord
(
dialogueId
,
null
);
if
(
CollectionUtils
.
isNotEmpty
(
items
))
{
return
items
.
stream
().
map
(
value
->
{
DialoguesContextDto
dto
=
new
DialoguesContextDto
();
dto
.
setRole
(
value
.
getRole
());
dto
.
setAgentId
(
value
.
getAgentId
());
dto
.
setContent
(
value
.
getContent
());
dto
.
setTimestamp
(
value
.
getTimestamp
());
dto
.
setAgentTitle
(
value
.
getAgentTitle
());
dto
.
setAgentAvatar
(
value
.
getAgentAvatar
());
return
dto
;
}
).
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