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
0d79b105
Commit
0d79b105
authored
Apr 30, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 数据库列表按修改时间倒序
parent
936fde5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
+30
-8
AgentApplicationServiceImpl.java
...plication/aggregate/impl/AgentApplicationServiceImpl.java
+17
-8
DatabaseUtilTest.java
src/test/java/cn/com/poc/utils/DatabaseUtilTest.java
+13
-0
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationServiceImpl.java
View file @
0d79b105
...
...
@@ -649,23 +649,29 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
HttpServletResponse
httpServletResponse
)
throws
Exception
{
if
(
stream
)
{
SSEUtil
sseUtil
=
new
SSEUtil
(
httpServletResponse
);
if
(
CollectionUtils
.
isNotEmpty
(
dbChainResults
))
{
if
(
ObjectUtil
.
isNotNull
(
functionResult
)
&&
StringUtils
.
isNotBlank
(
functionResult
.
getFunctionName
()
))
{
LargeModelDemandResult
result
=
new
LargeModelDemandResult
();
result
.
setCode
(
"0"
);
result
.
setDbChainResult
(
dbChainResults
);
ToolFunction
toolFunction
=
functionResultConvertToolFunction
(
functionResult
);
result
.
setFunction
(
toolFunction
);
result
.
setDbChainResult
(
null
);
result
.
setKnowledgeContentResult
(
null
);
sseUtil
.
send
(
JsonUtils
.
serialize
(
result
));
}
if
(
CollectionUtils
.
isNotEmpty
(
knowledgeResult
))
{
if
(
CollectionUtils
.
isNotEmpty
(
dbChainResults
))
{
LargeModelDemandResult
result
=
new
LargeModelDemandResult
();
result
.
setCode
(
"0"
);
result
.
setKnowledgeContentResult
(
knowledgeResult
);
result
.
setFunction
(
null
);
result
.
setDbChainResult
(
dbChainResults
);
result
.
setKnowledgeContentResult
(
null
);
sseUtil
.
send
(
JsonUtils
.
serialize
(
result
));
}
if
(
ObjectUtil
.
isNotNull
(
functionResult
)
&&
StringUtils
.
isNotBlank
(
functionResult
.
getFunctionName
()
))
{
if
(
CollectionUtils
.
isNotEmpty
(
knowledgeResult
))
{
LargeModelDemandResult
result
=
new
LargeModelDemandResult
();
result
.
setCode
(
"0"
);
ToolFunction
toolFunction
=
functionResultConvertToolFunction
(
functionResult
);
result
.
setFunction
(
toolFunction
);
result
.
setFunction
(
null
);
result
.
setDbChainResult
(
null
);
result
.
setKnowledgeContentResult
(
knowledgeResult
);
sseUtil
.
send
(
JsonUtils
.
serialize
(
result
));
}
BufferedReader
bufferedReader
=
invokeLLMStream
(
model
,
messageArray
,
topP
);
...
...
@@ -931,7 +937,10 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
sseUtil
.
complete
();
throw
ex
;
}
sseUtil
.
send
(
res
);
result
.
setFunction
(
null
);
result
.
setDbChainResult
(
null
);
result
.
setKnowledgeContentResult
(
null
);
sseUtil
.
send
(
JsonUtils
.
serialize
(
result
));
if
(
StringUtils
.
isNotEmpty
(
result
.
getMessage
()))
{
output
.
append
(
result
.
getMessage
());
}
...
...
src/test/java/cn/com/poc/utils/DatabaseUtilTest.java
View file @
0d79b105
package
cn
.
com
.
poc
.
utils
;
import
cn.com.poc.common.utils.DatabaseUtil
;
import
cn.com.poc.common.utils.JsonUtils
;
import
cn.com.poc.thirdparty.resource.demand.ai.entity.largemodel.LargeModelDemandResult
;
import
cn.com.yict.framemax.core.spring.SingleContextInitializer
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
...
...
@@ -40,4 +42,15 @@ public class DatabaseUtilTest {
DatabaseUtil
.
getTableInfo
(
host
,
port
,
username
,
password
,
database
);
}
@Test
public
void
test
(){
LargeModelDemandResult
result
=
new
LargeModelDemandResult
();
result
.
setCode
(
"0"
);
result
.
setFunction
(
null
);
result
.
setDbChainResult
(
null
);
// result.setKnowledgeContentResult(null);
System
.
out
.
println
(
JsonUtils
.
serialize
(
result
));
}
}
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