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
6a12e005
Commit
6a12e005
authored
Nov 26, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 编辑应用-新增音色配置
parent
cdbc964a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
476 additions
and
292 deletions
+476
-292
AgentApplicationInfoConvert.java
...gent_application/convert/AgentApplicationInfoConvert.java
+33
-4
AgentApplicationVoiceConfig.java
...agent_application/domain/AgentApplicationVoiceConfig.java
+30
-0
AgentApplicationInfoDto.java
...om/poc/agent_application/dto/AgentApplicationInfoDto.java
+22
-13
BizAgentApplicationInfoEntity.java
...ent_application/entity/BizAgentApplicationInfoEntity.java
+18
-0
VoiceConfig.java
...java/cn/com/poc/agent_application/entity/VoiceConfig.java
+31
-0
BizAgentApplicationInfoModel.java
...agent_application/model/BizAgentApplicationInfoModel.java
+319
-273
AgentApplicationInfoQuery.sql
...poc/agent_application/query/AgentApplicationInfoQuery.sql
+1
-0
AgentApplicationInfoQueryItem.java
...gent_application/query/AgentApplicationInfoQueryItem.java
+13
-0
BizAgentApplicationInfoServiceImpl.java
...tion/service/impl/BizAgentApplicationInfoServiceImpl.java
+9
-2
No files found.
src/main/java/cn/com/poc/agent_application/convert/AgentApplicationInfoConvert.java
View file @
6a12e005
package
cn
.
com
.
poc
.
agent_application
.
convert
;
import
cn.com.poc.agent_application.domain.AgentApplicationBaseInfo
;
import
cn.com.poc.agent_application.domain.AgentApplicationCommConfig
;
import
cn.com.poc.agent_application.domain.AgentApplicationCommModelConfig
;
import
cn.com.poc.agent_application.domain.AgentApplicationKnowledgeConfig
;
import
cn.com.poc.agent_application.domain.*
;
import
cn.com.poc.agent_application.dto.AgentApplicationInfoDto
;
import
cn.com.poc.agent_application.entity.BizAgentApplicationInfoEntity
;
import
cn.com.poc.agent_application.entity.Variable
;
import
cn.com.poc.agent_application.entity.VoiceConfig
;
import
cn.com.poc.agent_application.model.BizAgentApplicationInfoModel
;
import
cn.com.poc.agent_application.query.AgentApplicationInfoQueryItem
;
import
cn.com.poc.agent_application.query.PublishAgentApplicationQueryItem
;
import
cn.com.poc.common.constant.CommonConstant
;
import
cn.com.poc.common.utils.JsonUtils
;
import
cn.com.poc.expose.dto.SearchAgentApplicationDto
;
import
cn.hutool.core.util.ObjectUtil
;
...
...
@@ -72,6 +71,10 @@ public class AgentApplicationInfoConvert {
if
(
StringUtils
.
isNotBlank
(
model
.
getUnitIds
()))
{
entity
.
setUnitIds
(
JsonUtils
.
deSerialize
(
model
.
getUnitIds
(),
String
[].
class
));
}
if
(
StringUtils
.
isNotBlank
(
model
.
getVoiceConfig
()))
{
VoiceConfig
voiceConfig
=
JsonUtils
.
deSerialize
(
model
.
getVoiceConfig
(),
VoiceConfig
.
class
);
entity
.
setVoiceConfig
(
voiceConfig
);
}
entity
.
setIsDeleted
(
model
.
getIsDeleted
());
entity
.
setCreator
(
model
.
getCreator
());
entity
.
setCreatedTime
(
model
.
getCreatedTime
());
...
...
@@ -114,6 +117,9 @@ public class AgentApplicationInfoConvert {
if
(
ArrayUtils
.
isNotEmpty
(
entity
.
getUnitIds
()))
{
model
.
setUnitIds
(
JsonUtil
.
toJson
(
entity
.
getUnitIds
()));
}
if
(
ObjectUtil
.
isNotEmpty
(
entity
.
getVoiceConfig
()))
{
model
.
setVoiceConfig
(
JsonUtils
.
serialize
(
entity
.
getVoiceConfig
()));
}
model
.
setIsDeleted
(
entity
.
getIsDeleted
());
model
.
setCreator
(
entity
.
getCreator
());
model
.
setCreatedTime
(
entity
.
getCreatedTime
());
...
...
@@ -154,11 +160,21 @@ public class AgentApplicationInfoConvert {
commModelConfig
.
setTemperature
(
entity
.
getTemperature
());
commModelConfig
.
setCommunicationTurn
(
entity
.
getCommunicationTurn
());
AgentApplicationVoiceConfig
voiceConfig
=
new
AgentApplicationVoiceConfig
();
if
(
ObjectUtil
.
isNotEmpty
(
entity
.
getVoiceConfig
()))
{
voiceConfig
.
setDefaultOpen
(
entity
.
getVoiceConfig
().
getDefaultOpen
());
voiceConfig
.
setTimbreId
(
entity
.
getVoiceConfig
().
getTimbreId
());
}
else
{
voiceConfig
.
setDefaultOpen
(
CommonConstant
.
YOrN
.
N
);
voiceConfig
.
setTimbreId
(
StringUtils
.
EMPTY
);
}
AgentApplicationInfoDto
dto
=
new
AgentApplicationInfoDto
();
dto
.
setBaseInfo
(
baseInfo
);
dto
.
setCommConfig
(
commConfig
);
dto
.
setKnowledgeConfig
(
knowledgeConfig
);
dto
.
setCommModelConfig
(
commModelConfig
);
dto
.
setVoiceConfig
(
voiceConfig
);
dto
.
setUnitIds
(
entity
.
getUnitIds
());
dto
.
setCreator
(
entity
.
getCreator
());
dto
.
setCreatedTime
(
entity
.
getCreatedTime
());
...
...
@@ -204,6 +220,16 @@ public class AgentApplicationInfoConvert {
entity
.
setCommunicationTurn
(
dto
.
getCommModelConfig
().
getCommunicationTurn
());
}
VoiceConfig
voiceConfig
=
new
VoiceConfig
();
if
(
ObjectUtil
.
isNotEmpty
(
dto
.
getVoiceConfig
()))
{
voiceConfig
.
setDefaultOpen
(
dto
.
getVoiceConfig
().
getDefaultOpen
());
voiceConfig
.
setTimbreId
(
dto
.
getVoiceConfig
().
getTimbreId
());
}
else
{
voiceConfig
.
setDefaultOpen
(
CommonConstant
.
YOrN
.
N
);
voiceConfig
.
setTimbreId
(
StringUtils
.
EMPTY
);
}
entity
.
setVoiceConfig
(
voiceConfig
);
entity
.
setUnitIds
(
dto
.
getUnitIds
());
entity
.
setCreator
(
dto
.
getCreator
());
entity
.
setCreatedTime
(
dto
.
getCreatedTime
());
...
...
@@ -248,6 +274,9 @@ public class AgentApplicationInfoConvert {
if
(
StringUtils
.
isNotBlank
(
infoQueryItem
.
getUnitIds
()))
{
entity
.
setUnitIds
(
JsonUtils
.
deSerialize
(
infoQueryItem
.
getUnitIds
(),
String
[].
class
));
}
if
(
StringUtils
.
isNotBlank
(
infoQueryItem
.
getVoiceConfig
()))
{
entity
.
setVoiceConfig
(
JsonUtils
.
deSerialize
(
infoQueryItem
.
getVoiceConfig
(),
VoiceConfig
.
class
));
}
entity
.
setIsDeleted
(
infoQueryItem
.
getIsDeleted
());
entity
.
setCreator
(
infoQueryItem
.
getCreator
());
entity
.
setCreatedTime
(
infoQueryItem
.
getCreatedTime
());
...
...
src/main/java/cn/com/poc/agent_application/domain/AgentApplicationVoiceConfig.java
0 → 100644
View file @
6a12e005
package
cn
.
com
.
poc
.
agent_application
.
domain
;
public
class
AgentApplicationVoiceConfig
{
/**
* 是否默认开启 Y-是 N-否
*/
private
String
defaultOpen
;
/**
* 音色ID
*/
private
String
timbreId
;
public
String
getDefaultOpen
()
{
return
defaultOpen
;
}
public
void
setDefaultOpen
(
String
defaultOpen
)
{
this
.
defaultOpen
=
defaultOpen
;
}
public
String
getTimbreId
()
{
return
timbreId
;
}
public
void
setTimbreId
(
String
timbreId
)
{
this
.
timbreId
=
timbreId
;
}
}
src/main/java/cn/com/poc/agent_application/dto/AgentApplicationInfoDto.java
View file @
6a12e005
package
cn
.
com
.
poc
.
agent_application
.
dto
;
import
cn.com.poc.agent_application.domain.AgentApplicationBaseInfo
;
import
cn.com.poc.agent_application.domain.AgentApplicationCommConfig
;
import
cn.com.poc.agent_application.domain.AgentApplicationCommModelConfig
;
import
cn.com.poc.agent_application.domain.AgentApplicationKnowledgeConfig
;
import
cn.com.poc.agent_application.domain.*
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
...
...
@@ -21,6 +18,8 @@ public class AgentApplicationInfoDto implements java.io.Serializable {
private
AgentApplicationCommModelConfig
commModelConfig
;
private
AgentApplicationVoiceConfig
voiceConfig
;
public
AgentApplicationBaseInfo
getBaseInfo
()
{
return
baseInfo
;
}
...
...
@@ -53,6 +52,14 @@ public class AgentApplicationInfoDto implements java.io.Serializable {
this
.
commModelConfig
=
commModelConfig
;
}
public
AgentApplicationVoiceConfig
getVoiceConfig
()
{
return
voiceConfig
;
}
public
void
setVoiceConfig
(
AgentApplicationVoiceConfig
voiceConfig
)
{
this
.
voiceConfig
=
voiceConfig
;
}
/**
* unit_ids
* 组件ID
...
...
@@ -113,7 +120,7 @@ public class AgentApplicationInfoDto implements java.io.Serializable {
/**
* isCollect
* 当前用户是否收藏 1、Y 是 2、N 否
*
*
/
*/
private
String
isCollect
;
public
String
getIsCollect
()
{
...
...
@@ -124,29 +131,31 @@ public class AgentApplicationInfoDto implements java.io.Serializable {
this
.
isCollect
=
isCollect
;
}
/** agent_publish_id
*发布应用的ID
/**
* agent_publish_id
* 发布应用的ID
*/
private
java
.
lang
.
Integer
agentPublishId
;
public
java
.
lang
.
Integer
getAgentPublishId
(){
public
java
.
lang
.
Integer
getAgentPublishId
()
{
return
this
.
agentPublishId
;
}
public
void
setAgentPublishId
(
java
.
lang
.
Integer
agentPublishId
){
public
void
setAgentPublishId
(
java
.
lang
.
Integer
agentPublishId
)
{
this
.
agentPublishId
=
agentPublishId
;
}
/** is_sale
*是否上架应用 1、Y 是 2、N 否
/**
* is_sale
* 是否上架应用 1、Y 是 2、N 否
*/
private
java
.
lang
.
String
isSale
;
public
java
.
lang
.
String
getIsSale
(){
public
java
.
lang
.
String
getIsSale
()
{
return
this
.
isSale
;
}
public
void
setIsSale
(
java
.
lang
.
String
isSale
){
public
void
setIsSale
(
java
.
lang
.
String
isSale
)
{
this
.
isSale
=
isSale
;
}
...
...
src/main/java/cn/com/poc/agent_application/entity/BizAgentApplicationInfoEntity.java
View file @
6a12e005
package
cn
.
com
.
poc
.
agent_application
.
entity
;
import
cn.com.poc.agent_application.domain.AgentApplicationVoiceConfig
;
import
javax.persistence.Column
;
import
java.util.Arrays
;
import
java.util.List
;
...
...
@@ -329,6 +331,22 @@ public class BizAgentApplicationInfoEntity {
this
.
isDocumentParsing
=
isDocumentParsing
;
}
/**
* voice_config
* 声音配置 defaultOpen- 是否默认开启 timbreId-音色
*/
private
VoiceConfig
voiceConfig
;
public
VoiceConfig
getVoiceConfig
()
{
return
voiceConfig
;
}
public
void
setVoiceConfig
(
VoiceConfig
voiceConfig
)
{
this
.
voiceConfig
=
voiceConfig
;
}
/**
* is_deleted
* 是否删除 1、Y 是 2、N 否
...
...
src/main/java/cn/com/poc/agent_application/entity/VoiceConfig.java
0 → 100644
View file @
6a12e005
package
cn
.
com
.
poc
.
agent_application
.
entity
;
public
class
VoiceConfig
{
/**
* 是否默认开启 Y-是 N-否
*/
private
String
defaultOpen
;
/**
* 音色ID
*/
private
String
timbreId
;
public
String
getDefaultOpen
()
{
return
defaultOpen
;
}
public
void
setDefaultOpen
(
String
defaultOpen
)
{
this
.
defaultOpen
=
defaultOpen
;
}
public
String
getTimbreId
()
{
return
timbreId
;
}
public
void
setTimbreId
(
String
timbreId
)
{
this
.
timbreId
=
timbreId
;
}
}
src/main/java/cn/com/poc/agent_application/model/BizAgentApplicationInfoModel.java
View file @
6a12e005
This diff is collapsed.
Click to expand it.
src/main/java/cn/com/poc/agent_application/query/AgentApplicationInfoQuery.sql
View file @
6a12e005
...
...
@@ -22,6 +22,7 @@ select distinct
variable_structure
,
is_long_memory
,
is_document_parsing
,
voice_config
,
is_deleted
,
CREATOR
,
CREATED_TIME
,
...
...
src/main/java/cn/com/poc/agent_application/query/AgentApplicationInfoQueryItem.java
View file @
6a12e005
...
...
@@ -363,6 +363,19 @@ public class AgentApplicationInfoQueryItem extends BaseItemClass implements Seri
this
.
isDocumentParsing
=
isDocumentParsing
;
}
/**
* voice_config
*/
private
java
.
lang
.
String
voiceConfig
;
@Column
(
name
=
"voice_config"
)
public
java
.
lang
.
String
getVoiceConfig
()
{
return
this
.
voiceConfig
;
}
public
void
setVoiceConfig
(
java
.
lang
.
String
voiceConfig
)
{
this
.
voiceConfig
=
voiceConfig
;
}
/**
* is_deleted
...
...
src/main/java/cn/com/poc/agent_application/service/impl/BizAgentApplicationInfoServiceImpl.java
View file @
6a12e005
...
...
@@ -213,8 +213,15 @@ public class BizAgentApplicationInfoServiceImpl extends BaseServiceImpl
if
(
entity
.
getTemperature
()
!=
null
)
{
Assert
.
isTrue
(
entity
.
getTemperature
()
>
0
&&
entity
.
getTemperature
()
<=
1.0
,
"temperature is error,must greater than 0, less than or equal to 1.9"
);
}
if
(
entity
.
getVoiceConfig
()
!=
null
)
{
model
.
setVoiceConfig
(
JsonUtils
.
serialize
(
entity
.
getVoiceConfig
()));
}
if
(
StringUtils
.
isNotBlank
(
entity
.
getIsDocumentParsing
()))
{
model
.
setIsDocumentParsing
(
entity
.
getIsDocumentParsing
());
}
if
(
StringUtils
.
isNotBlank
(
entity
.
getIsLongMemory
()))
{
model
.
setIsLongMemory
(
entity
.
getIsLongMemory
());
}
model
.
setTemperature
(
entity
.
getTemperature
());
model
.
setTopP
(
entity
.
getTopP
());
model
.
setContinuousQuestionStatus
(
entity
.
getContinuousQuestionStatus
());
...
...
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