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
c964b8c3
Commit
c964b8c3
authored
Nov 04, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:删除【变量】缓存
parent
d7e36140
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
159 additions
and
10 deletions
+159
-10
AgentApplicationInfoServiceImpl.java
...ation/aggregate/impl/AgentApplicationInfoServiceImpl.java
+20
-0
DialogsIdsQueryByAgentIdQuery.sql
...agent_application/query/DialogsIdsQueryByAgentIdQuery.sql
+8
-0
DialogsIdsQueryByAgentIdQueryCondition.java
...ication/query/DialogsIdsQueryByAgentIdQueryCondition.java
+23
-0
DialogsIdsQueryByAgentIdQueryItem.java
..._application/query/DialogsIdsQueryByAgentIdQueryItem.java
+44
-0
AgentApplicationInfoRest.java
.../poc/agent_application/rest/AgentApplicationInfoRest.java
+6
-0
AgentApplicationInfoRestImpl.java
...t_application/rest/impl/AgentApplicationInfoRestImpl.java
+25
-2
BizAgentApplicationDialoguesRecordService.java
...on/service/BizAgentApplicationDialoguesRecordService.java
+3
-2
BizAgentApplicationInfoService.java
...t_application/service/BizAgentApplicationInfoService.java
+4
-0
BizAgentApplicationDialoguesRecordServiceImpl.java
...e/impl/BizAgentApplicationDialoguesRecordServiceImpl.java
+5
-6
BizAgentApplicationInfoServiceImpl.java
...tion/service/impl/BizAgentApplicationInfoServiceImpl.java
+21
-0
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationInfoServiceImpl.java
View file @
c964b8c3
...
@@ -5,8 +5,10 @@ import cn.com.poc.agent_application.constant.AgentApplicationConstants;
...
@@ -5,8 +5,10 @@ import cn.com.poc.agent_application.constant.AgentApplicationConstants;
import
cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants
;
import
cn.com.poc.agent_application.constant.AgentApplicationDialoguesRecordConstants
;
import
cn.com.poc.agent_application.constant.AgentApplicationGCConfigConstants
;
import
cn.com.poc.agent_application.constant.AgentApplicationGCConfigConstants
;
import
cn.com.poc.agent_application.entity.*
;
import
cn.com.poc.agent_application.entity.*
;
import
cn.com.poc.agent_application.query.DialogsIdsQueryByAgentIdQueryItem
;
import
cn.com.poc.agent_application.service.*
;
import
cn.com.poc.agent_application.service.*
;
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.utils.BlContext
;
import
cn.com.poc.common.utils.BlContext
;
import
cn.com.poc.common.utils.JsonUtils
;
import
cn.com.poc.common.utils.JsonUtils
;
import
cn.com.poc.knowledge.entity.BizKnowledgeDocumentEntity
;
import
cn.com.poc.knowledge.entity.BizKnowledgeDocumentEntity
;
...
@@ -27,6 +29,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.function.LargeModelFunctionEnum;
...
@@ -27,6 +29,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.function.LargeModelFunctionEnum;
import
cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.GetLongMemory
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.GetLongMemory
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.LongMemoryEntity
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.LongMemoryEntity
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.value_memory.GetValueMemory
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.value_memory.GetValueMemory
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.value_memory.SetValueMemoryConstants
;
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
cn.com.yict.framemax.data.model.PagingInfo
;
...
@@ -86,6 +89,12 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -86,6 +89,12 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
@Resource
@Resource
private
BizMemberAgentApplicationCollectService
bizMemberAgentApplicationCollectService
;
private
BizMemberAgentApplicationCollectService
bizMemberAgentApplicationCollectService
;
@Resource
private
BizAgentApplicationDialoguesRecordService
bizAgentApplicationDialoguesRecordService
;
@Resource
private
RedisService
redisService
;
@Override
@Override
public
boolean
updateAndPublish
(
BizAgentApplicationInfoEntity
bizAgentApplicationInfoEntity
)
throws
Exception
{
public
boolean
updateAndPublish
(
BizAgentApplicationInfoEntity
bizAgentApplicationInfoEntity
)
throws
Exception
{
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
...
@@ -103,6 +112,17 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -103,6 +112,17 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
BizAgentApplicationPublishEntity
publishEntity
=
new
BizAgentApplicationPublishEntity
();
BizAgentApplicationPublishEntity
publishEntity
=
new
BizAgentApplicationPublishEntity
();
BeanUtil
.
copyProperties
(
bizAgentApplicationInfoEntity
,
publishEntity
);
BeanUtil
.
copyProperties
(
bizAgentApplicationInfoEntity
,
publishEntity
);
bizAgentApplicationPublishService
.
save
(
publishEntity
);
bizAgentApplicationPublishService
.
save
(
publishEntity
);
//【变量】结构改变,删除会话缓存
List
<
DialogsIdsQueryByAgentIdQueryItem
>
items
=
bizAgentApplicationDialoguesRecordService
.
queryDialogsIds
(
bizAgentApplicationInfoEntity
.
getAgentId
());
if
(
CollectionUtils
.
isNotEmpty
(
items
))
{
logger
.
info
(
"variables structure cache remove,items:{}"
,
items
);
for
(
DialogsIdsQueryByAgentIdQueryItem
item
:
items
)
{
String
contentKey
=
SetValueMemoryConstants
.
REDIS_PREFIX
+
item
.
getDialogsId
()
+
":"
;
redisService
.
delByPre
(
contentKey
);
}
}
return
true
;
return
true
;
}
}
...
...
src/main/java/cn/com/poc/agent_application/query/DialogsIdsQueryByAgentIdQuery.sql
0 → 100644
View file @
c964b8c3
select
distinct
agent_id
,
dialogs_id
from
biz_agent_application_dialogues_record
where
is_deleted
=
'N'
<<
and
agent_id
=
:
agentId
>>
group
by
dialogs_id
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/DialogsIdsQueryByAgentIdQueryCondition.java
0 → 100644
View file @
c964b8c3
package
cn
.
com
.
poc
.
agent_application
.
query
;
import
java.io.Serializable
;
/**
* Query Condition class for DialogsIdsQueryByAgentIdQuery
*/
public
class
DialogsIdsQueryByAgentIdQueryCondition
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
java
.
lang
.
String
agentId
;
public
java
.
lang
.
String
getAgentId
(){
return
this
.
agentId
;
}
public
void
setAgentId
(
java
.
lang
.
String
agentId
){
this
.
agentId
=
agentId
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/query/DialogsIdsQueryByAgentIdQueryItem.java
0 → 100644
View file @
c964b8c3
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 DialogsIdsQueryByAgentIdQuery
*/
@Entity
public
class
DialogsIdsQueryByAgentIdQueryItem
extends
BaseItemClass
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/** 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
;
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/rest/AgentApplicationInfoRest.java
View file @
c964b8c3
package
cn
.
com
.
poc
.
agent_application
.
rest
;
package
cn
.
com
.
poc
.
agent_application
.
rest
;
import
cn.com.poc.agent_application.dto.*
;
import
cn.com.poc.agent_application.dto.*
;
import
cn.com.poc.agent_application.entity.Variable
;
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
;
...
@@ -16,6 +17,11 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -16,6 +17,11 @@ import javax.servlet.http.HttpServletResponse;
@Permission
(
value
=
Access
.
Safety
)
@Permission
(
value
=
Access
.
Safety
)
public
interface
AgentApplicationInfoRest
extends
BaseRest
{
public
interface
AgentApplicationInfoRest
extends
BaseRest
{
/**
* 保存应用变量结构
*/
AgentApplicationInfoDto
saveVariableStructure
(
@RequestParam
String
agentId
,
@RequestBody
List
<
Variable
>
variableStructure
);
/**
/**
* 获取应用详情
* 获取应用详情
*/
*/
...
...
src/main/java/cn/com/poc/agent_application/rest/impl/AgentApplicationInfoRestImpl.java
View file @
c964b8c3
...
@@ -17,6 +17,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.Tool;
...
@@ -17,6 +17,7 @@ import cn.com.poc.thirdparty.resource.demand.ai.entity.dialogue.Tool;
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.resource.demand.ai.function.long_memory.SetLongMemoryConstants
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.long_memory.SetLongMemoryConstants
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.value_memory.GetValueMemory
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.value_memory.GetValueMemory
;
import
cn.com.poc.thirdparty.resource.demand.ai.function.value_memory.SetValueMemoryConstants
;
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
cn.hutool.core.collection.ListUtil
;
...
@@ -64,6 +65,16 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -64,6 +65,16 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
@Resource
@Resource
private
BizAgentApplicationMallService
bizAgentApplicationMallService
;
private
BizAgentApplicationMallService
bizAgentApplicationMallService
;
@Override
public
AgentApplicationInfoDto
saveVariableStructure
(
String
agentId
,
List
<
Variable
>
variableStructure
)
{
Assert
.
notNull
(
agentId
,
"agentId不能为空"
);
BizAgentApplicationInfoEntity
bizAgentApplicationInfoEntity
=
bizAgentApplicationInfoService
.
saveVariableStructure
(
agentId
,
variableStructure
);
if
(
bizAgentApplicationInfoEntity
==
null
)
{
throw
new
BusinessException
(
"应用不存在"
);
}
return
AgentApplicationInfoConvert
.
entityToDto
(
bizAgentApplicationInfoEntity
);
}
public
List
<
AgentApplicationInfoDto
>
getListByMember
(
AgentApplicationInfoSearchDto
dto
,
PagingInfo
pagingInfo
)
throws
Exception
{
public
List
<
AgentApplicationInfoDto
>
getListByMember
(
AgentApplicationInfoSearchDto
dto
,
PagingInfo
pagingInfo
)
throws
Exception
{
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
Long
userId
=
userBaseEntity
.
getUserId
();
Long
userId
=
userBaseEntity
.
getUserId
();
...
@@ -138,6 +149,16 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -138,6 +149,16 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
Long
userId
=
userBaseEntity
.
getUserId
();
Long
userId
=
userBaseEntity
.
getUserId
();
dto
.
getBaseInfo
().
setMemberId
(
userId
.
intValue
());
dto
.
getBaseInfo
().
setMemberId
(
userId
.
intValue
());
BizAgentApplicationInfoEntity
entity
=
AgentApplicationInfoConvert
.
dtoToEntity
(
dto
);
BizAgentApplicationInfoEntity
entity
=
AgentApplicationInfoConvert
.
dtoToEntity
(
dto
);
// 如果存在agentId,则判断变量结构是否有变化,如果有变化,则删除redis中的数据
if
(
StringUtils
.
isNotBlank
(
entity
.
getAgentId
()))
{
BizAgentApplicationInfoEntity
infoEntity
=
bizAgentApplicationInfoService
.
getByAgentId
(
entity
.
getAgentId
());
if
(
infoEntity
.
getVariableStructure
()
!=
null
||
!
infoEntity
.
getVariableStructure
().
equals
(
entity
.
getVariableStructure
()))
{
String
contentKey
=
SetValueMemoryConstants
.
REDIS_PREFIX
+
dto
.
getBaseInfo
().
getAgentId
()
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
();
redisService
.
del
(
contentKey
);
}
}
return
AgentApplicationInfoConvert
.
entityToDto
(
StringUtils
.
isEmpty
(
entity
.
getAgentId
())
?
return
AgentApplicationInfoConvert
.
entityToDto
(
StringUtils
.
isEmpty
(
entity
.
getAgentId
())
?
bizAgentApplicationInfoService
.
save
(
entity
)
:
bizAgentApplicationInfoService
.
update
(
entity
));
bizAgentApplicationInfoService
.
save
(
entity
)
:
bizAgentApplicationInfoService
.
update
(
entity
));
}
}
...
@@ -217,8 +238,8 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -217,8 +238,8 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
//初始化变量函数
//初始化变量函数
Map
<
Object
,
Object
>
map
=
GetValueMemory
.
get
(
agentId
);
Map
<
Object
,
Object
>
map
=
GetValueMemory
.
get
(
agentId
);
List
<
Variable
>
variableStructure
=
infoEntity
.
getVariableStructure
();
if
(
MapUtils
.
isEmpty
(
map
))
{
if
(
MapUtils
.
isEmpty
(
map
))
{
List
<
Variable
>
variableStructure
=
infoEntity
.
getVariableStructure
();
for
(
Variable
variable
:
variableStructure
)
{
for
(
Variable
variable
:
variableStructure
)
{
String
key
=
variable
.
getKey
();
String
key
=
variable
.
getKey
();
String
variableDefault
=
variable
.
getVariableDefault
();
String
variableDefault
=
variable
.
getVariableDefault
();
...
@@ -228,6 +249,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -228,6 +249,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
LargeModelFunctionEnum
.
valueOf
(
functionName
).
getFunction
().
doFunction
(
jsonObject
.
toJSONString
(),
agentId
);
LargeModelFunctionEnum
.
valueOf
(
functionName
).
getFunction
().
doFunction
(
jsonObject
.
toJSONString
(),
agentId
);
}
}
}
}
}
}
//开启长期记忆
//开启长期记忆
if
(
CommonConstant
.
YOrN
.
Y
.
equals
(
infoEntity
.
getIsLongMemory
()))
{
if
(
CommonConstant
.
YOrN
.
Y
.
equals
(
infoEntity
.
getIsLongMemory
()))
{
...
@@ -247,7 +269,8 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -247,7 +269,8 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
agentApplicationInfoService
.
callAgentApplication
(
agentId
,
model
,
infoEntity
.
getUnitIds
()
agentApplicationInfoService
.
callAgentApplication
(
agentId
,
model
,
infoEntity
.
getUnitIds
()
,
agentSystem
,
kdIds
.
toArray
(
new
Integer
[
0
]),
infoEntity
.
getCommunicationTurn
(),
topP
,
temperature
,
agentSystem
,
kdIds
.
toArray
(
new
Integer
[
0
]),
infoEntity
.
getCommunicationTurn
(),
topP
,
temperature
,
dto
.
getMessages
(),
tools
,
httpServletResponse
);
,
dto
.
getMessages
(),
tools
,
httpServletResponse
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
httpServletResponse
.
setContentType
(
"text/event-stream"
);
httpServletResponse
.
setContentType
(
"text/event-stream"
);
PrintWriter
writer
=
httpServletResponse
.
getWriter
();
PrintWriter
writer
=
httpServletResponse
.
getWriter
();
writer
.
write
(
"data: {\"code\":-1,\"message\":\""
+
e
.
getLocalizedMessage
()
+
"\"} \n\n"
);
writer
.
write
(
"data: {\"code\":-1,\"message\":\""
+
e
.
getLocalizedMessage
()
+
"\"} \n\n"
);
...
...
src/main/java/cn/com/poc/agent_application/service/BizAgentApplicationDialoguesRecordService.java
View file @
c964b8c3
package
cn
.
com
.
poc
.
agent_application
.
service
;
package
cn
.
com
.
poc
.
agent_application
.
service
;
import
cn.com.poc.agent_application.query.AgentApplicationDialoguesRecordQueryItem
;
import
cn.com.poc.agent_application.query.AgentApplicationDialoguesRecordQueryItem
;
import
cn.com.poc.agent_application.query.DialogsIdsQueryByAgentIdQueryItem
;
import
cn.com.poc.agent_application.query.MemberDialoguesQueryItem
;
import
cn.com.poc.agent_application.query.MemberDialoguesQueryItem
;
import
cn.com.yict.framemax.core.service.BaseService
;
import
cn.com.yict.framemax.core.service.BaseService
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationDialoguesRecordEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationDialoguesRecordEntity
;
...
@@ -20,9 +21,9 @@ public interface BizAgentApplicationDialoguesRecordService extends BaseService {
...
@@ -20,9 +21,9 @@ public interface BizAgentApplicationDialoguesRecordService extends BaseService {
BizAgentApplicationDialoguesRecordEntity
update
(
BizAgentApplicationDialoguesRecordEntity
entity
)
throws
Exception
;
BizAgentApplicationDialoguesRecordEntity
update
(
BizAgentApplicationDialoguesRecordEntity
entity
)
throws
Exception
;
void
deletedById
(
java
.
lang
.
Long
id
)
;
void
deletedById
(
java
.
lang
.
Long
id
);
List
<
BizAgentApplicationDialoguesRecordEntity
>
getRecord
(
String
agentId
,
Integer
turn
);
List
<
DialogsIdsQueryByAgentIdQueryItem
>
queryDialogsIds
(
String
agentId
);
/**
/**
* 获取用户的对话【组】
* 获取用户的对话【组】
...
...
src/main/java/cn/com/poc/agent_application/service/BizAgentApplicationInfoService.java
View file @
c964b8c3
package
cn
.
com
.
poc
.
agent_application
.
service
;
package
cn
.
com
.
poc
.
agent_application
.
service
;
import
cn.com.poc.agent_application.dto.AgentApplicationInfoDto
;
import
cn.com.poc.agent_application.entity.Variable
;
import
cn.com.poc.agent_application.query.AgentApplicationInfoQueryCondition
;
import
cn.com.poc.agent_application.query.AgentApplicationInfoQueryCondition
;
import
cn.com.yict.framemax.core.service.BaseService
;
import
cn.com.yict.framemax.core.service.BaseService
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationInfoEntity
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationInfoEntity
;
...
@@ -26,4 +28,6 @@ public interface BizAgentApplicationInfoService extends BaseService {
...
@@ -26,4 +28,6 @@ public interface BizAgentApplicationInfoService extends BaseService {
boolean
publish
(
String
agentId
)
throws
Exception
;
boolean
publish
(
String
agentId
)
throws
Exception
;
boolean
unPublish
(
String
agentId
);
boolean
unPublish
(
String
agentId
);
BizAgentApplicationInfoEntity
saveVariableStructure
(
String
agentId
,
List
<
Variable
>
variableStructure
);
}
}
\ No newline at end of file
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationDialoguesRecordServiceImpl.java
View file @
c964b8c3
package
cn
.
com
.
poc
.
agent_application
.
service
.
impl
;
package
cn
.
com
.
poc
.
agent_application
.
service
.
impl
;
import
cn.com.poc.agent_application.query.AgentApplicationDialoguesRecordQueryCondition
;
import
cn.com.poc.agent_application.query.*
;
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
;
import
cn.com.poc.common.constant.CommonConstant
;
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.BizAgentApplicationDialoguesRecordService
;
import
cn.com.poc.agent_application.service.BizAgentApplicationDialoguesRecordService
;
...
@@ -135,8 +132,10 @@ public class BizAgentApplicationDialoguesRecordServiceImpl extends BaseServiceIm
...
@@ -135,8 +132,10 @@ public class BizAgentApplicationDialoguesRecordServiceImpl extends BaseServiceIm
}
}
@Override
@Override
public
List
<
BizAgentApplicationDialoguesRecordEntity
>
getRecord
(
String
agentId
,
Integer
turn
)
{
public
List
<
DialogsIdsQueryByAgentIdQueryItem
>
queryDialogsIds
(
String
agentId
)
{
return
null
;
DialogsIdsQueryByAgentIdQueryCondition
condition
=
new
DialogsIdsQueryByAgentIdQueryCondition
();
condition
.
setAgentId
(
agentId
);
return
this
.
sqlDao
.
query
(
condition
,
DialogsIdsQueryByAgentIdQueryItem
.
class
);
}
}
@Override
@Override
...
...
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationInfoServiceImpl.java
View file @
c964b8c3
package
cn
.
com
.
poc
.
agent_application
.
service
.
impl
;
package
cn
.
com
.
poc
.
agent_application
.
service
.
impl
;
import
cn.com.poc.agent_application.constant.AgentApplicationConstants
;
import
cn.com.poc.agent_application.constant.AgentApplicationConstants
;
import
cn.com.poc.agent_application.entity.Variable
;
import
cn.com.poc.agent_application.query.AgentApplicationInfoQueryCondition
;
import
cn.com.poc.agent_application.query.AgentApplicationInfoQueryCondition
;
import
cn.com.poc.agent_application.query.AgentApplicationInfoQueryItem
;
import
cn.com.poc.agent_application.query.AgentApplicationInfoQueryItem
;
import
cn.com.poc.common.constant.CommonConstant
;
import
cn.com.poc.common.constant.CommonConstant
;
...
@@ -160,6 +161,26 @@ public class BizAgentApplicationInfoServiceImpl extends BaseServiceImpl
...
@@ -160,6 +161,26 @@ public class BizAgentApplicationInfoServiceImpl extends BaseServiceImpl
return
true
;
return
true
;
}
}
@Override
public
BizAgentApplicationInfoEntity
saveVariableStructure
(
String
agentId
,
List
<
Variable
>
variableStructure
)
{
Assert
.
notNull
(
agentId
);
BizAgentApplicationInfoModel
model
=
new
BizAgentApplicationInfoModel
();
model
.
setAgentId
(
agentId
);
model
.
setIsDeleted
(
CommonConstant
.
IsDeleted
.
N
);
List
<
BizAgentApplicationInfoModel
>
models
=
this
.
repository
.
findByExample
(
model
);
if
(
CollectionUtils
.
isEmpty
(
models
))
{
return
null
;
}
BizAgentApplicationInfoModel
updateModel
=
models
.
get
(
0
);
String
variableStructureStr
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
variableStructure
))
{
variableStructureStr
=
JsonUtils
.
serialize
(
variableStructure
);
}
updateModel
.
setVariableStructure
(
variableStructureStr
);
BizAgentApplicationInfoModel
saveModel
=
this
.
repository
.
save
(
updateModel
);
return
AgentApplicationInfoConvert
.
modelToEntity
(
saveModel
);
}
/**
/**
* 参数验证和转换 Entity To Model
* 参数验证和转换 Entity To Model
*
*
...
...
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