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
c042bad4
Commit
c042bad4
authored
Oct 25, 2024
by
jennie chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改部分细节
parent
9c34cbfd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
AgentApplicationInfoConvert.java
...gent_application/convert/AgentApplicationInfoConvert.java
+3
-2
BizAgentApplicationPublishConvert.java
...pplication/convert/BizAgentApplicationPublishConvert.java
+13
-10
No files found.
src/main/java/cn/com/poc/agent_application/convert/AgentApplicationInfoConvert.java
View file @
c042bad4
...
@@ -142,7 +142,8 @@ public class AgentApplicationInfoConvert {
...
@@ -142,7 +142,8 @@ public class AgentApplicationInfoConvert {
Variable
variable
=
new
Variable
();
Variable
variable
=
new
Variable
();
String
input
=
variableStructure
[
i
];
String
input
=
variableStructure
[
i
];
// 定义正则表达式模式
// 定义正则表达式模式
Pattern
pattern
=
Pattern
.
compile
(
"(key|default):([^,]+)"
);
String
regex
=
"\"key\":\"(.*?)\",\"default\":\"(.*?)\""
;
Pattern
pattern
=
Pattern
.
compile
(
regex
);
Matcher
matcher
=
pattern
.
matcher
(
input
);
Matcher
matcher
=
pattern
.
matcher
(
input
);
if
(
matcher
.
find
())
{
if
(
matcher
.
find
())
{
variable
.
setKey
(
matcher
.
group
(
1
));
variable
.
setKey
(
matcher
.
group
(
1
));
...
@@ -202,7 +203,7 @@ public class AgentApplicationInfoConvert {
...
@@ -202,7 +203,7 @@ public class AgentApplicationInfoConvert {
for
(
int
i
=
0
;
i
<
variables
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
variables
.
size
();
i
++)
{
String
key
=
variables
.
get
(
i
).
getKey
();
String
key
=
variables
.
get
(
i
).
getKey
();
String
variableDefault
=
variables
.
get
(
i
).
getVariableDefault
();
String
variableDefault
=
variables
.
get
(
i
).
getVariableDefault
();
result
[
i
]
=
"
key:"
+
key
+
","
+
"default:"
+
variableDefault
;
result
[
i
]
=
"
\"key\":\""
+
key
+
"\","
+
"\"default\":\""
+
variableDefault
+
"\""
;
}
}
entity
.
setVariableStructure
(
result
);
entity
.
setVariableStructure
(
result
);
}
}
...
...
src/main/java/cn/com/poc/agent_application/convert/BizAgentApplicationPublishConvert.java
View file @
c042bad4
...
@@ -124,11 +124,13 @@ public class BizAgentApplicationPublishConvert {
...
@@ -124,11 +124,13 @@ public class BizAgentApplicationPublishConvert {
commConfig
.
setContinuousQuestionTurn
(
entity
.
getContinuousQuestionTurn
());
commConfig
.
setContinuousQuestionTurn
(
entity
.
getContinuousQuestionTurn
());
List
<
Variable
>
variables
=
new
ArrayList
<>();
List
<
Variable
>
variables
=
new
ArrayList
<>();
String
[]
variableStructure
=
entity
.
getVariableStructure
();
String
[]
variableStructure
=
entity
.
getVariableStructure
();
if
(
variableStructure
!=
null
){
for
(
int
i
=
0
;
i
<
variableStructure
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
variableStructure
.
length
;
i
++)
{
Variable
variable
=
new
Variable
();
Variable
variable
=
new
Variable
();
String
input
=
variableStructure
[
i
];
String
input
=
variableStructure
[
i
];
// 定义正则表达式模式
// 定义正则表达式模式
Pattern
pattern
=
Pattern
.
compile
(
"(key|default):([^,]+)"
);
String
regex
=
"\"key\":\"(.*?)\",\"default\":\"(.*?)\""
;
Pattern
pattern
=
Pattern
.
compile
(
regex
);
Matcher
matcher
=
pattern
.
matcher
(
input
);
Matcher
matcher
=
pattern
.
matcher
(
input
);
if
(
matcher
.
find
())
{
if
(
matcher
.
find
())
{
variable
.
setKey
(
matcher
.
group
(
1
));
variable
.
setKey
(
matcher
.
group
(
1
));
...
@@ -136,6 +138,7 @@ public class BizAgentApplicationPublishConvert {
...
@@ -136,6 +138,7 @@ public class BizAgentApplicationPublishConvert {
variables
.
add
(
variable
);
variables
.
add
(
variable
);
}
}
}
}
}
commConfig
.
setVariableStructure
(
variables
);
commConfig
.
setVariableStructure
(
variables
);
commConfig
.
setIsLongMemory
(
entity
.
getIsLongMemory
());
commConfig
.
setIsLongMemory
(
entity
.
getIsLongMemory
());
...
...
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