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
cab016c0
Commit
cab016c0
authored
Jul 30, 2025
by
R10
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
法律文书ai写作
parent
2908e0d9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
312 additions
and
89 deletions
+312
-89
AiLawDialoguesDto.java
src/main/java/cn/com/poc/law/dto/AiLawDialoguesDto.java
+26
-0
LegalRest.java
src/main/java/cn/com/poc/law/rest/LegalRest.java
+2
-1
LegalRestImpl.java
src/main/java/cn/com/poc/law/rest/impl/LegalRestImpl.java
+5
-3
AiLawService.java
src/main/java/cn/com/poc/law/service/AiLawService.java
+3
-1
AiLawServiceImpl.java
...in/java/cn/com/poc/law/service/impl/AiLawServiceImpl.java
+276
-84
No files found.
src/main/java/cn/com/poc/law/dto/AiLawDialoguesDto.java
View file @
cab016c0
...
@@ -33,6 +33,16 @@ public class AiLawDialoguesDto {
...
@@ -33,6 +33,16 @@ public class AiLawDialoguesDto {
*/
*/
private
Integer
[]
databaseIds
;
private
Integer
[]
databaseIds
;
/**
* 是否开启联网检索
*/
private
boolean
enableSearchEngine
;
/**
* 是否开启思考模式
*/
private
boolean
enableDeepThinking
;
public
String
getDialoguesId
()
{
public
String
getDialoguesId
()
{
return
dialoguesId
;
return
dialoguesId
;
}
}
...
@@ -72,4 +82,20 @@ public class AiLawDialoguesDto {
...
@@ -72,4 +82,20 @@ public class AiLawDialoguesDto {
public
void
setDatabaseIds
(
Integer
[]
databaseIds
)
{
public
void
setDatabaseIds
(
Integer
[]
databaseIds
)
{
this
.
databaseIds
=
databaseIds
;
this
.
databaseIds
=
databaseIds
;
}
}
public
boolean
getEnableSearchEngine
()
{
return
enableSearchEngine
;
}
public
void
setEnableSearchEngine
(
boolean
enableSearchEngine
)
{
this
.
enableSearchEngine
=
enableSearchEngine
;
}
public
boolean
getEnableDeepThinking
()
{
return
enableDeepThinking
;
}
public
void
setEnableDeepThinking
(
boolean
enableDeepThinking
)
{
this
.
enableDeepThinking
=
enableDeepThinking
;
}
}
}
src/main/java/cn/com/poc/law/rest/LegalRest.java
View file @
cab016c0
package
cn
.
com
.
poc
.
law
.
rest
;
package
cn
.
com
.
poc
.
law
.
rest
;
import
cn.com.poc.ai_finance.dto.AiFinanceDialoguesDto
;
import
cn.com.poc.ai_finance.dto.AiFinanceDialoguesDto
;
import
cn.com.poc.law.dto.AiLawDialoguesDto
;
import
cn.com.poc.law.dto.LegalFileDto
;
import
cn.com.poc.law.dto.LegalFileDto
;
import
cn.com.yict.framemax.core.rest.BaseRest
;
import
cn.com.yict.framemax.core.rest.BaseRest
;
import
cn.com.yict.framemax.web.permission.Access
;
import
cn.com.yict.framemax.web.permission.Access
;
...
@@ -25,7 +26,7 @@ public interface LegalRest extends BaseRest {
...
@@ -25,7 +26,7 @@ public interface LegalRest extends BaseRest {
/**
/**
* ai对话
* ai对话
*/
*/
void
call
(
@RequestBody
Ai
Finance
DialoguesDto
dto
)
throws
Exception
;
void
call
(
@RequestBody
Ai
Law
DialoguesDto
dto
)
throws
Exception
;
}
}
src/main/java/cn/com/poc/law/rest/impl/LegalRestImpl.java
View file @
cab016c0
...
@@ -4,8 +4,10 @@ import cn.com.poc.ai_finance.aggregate.AiFinanceService;
...
@@ -4,8 +4,10 @@ import cn.com.poc.ai_finance.aggregate.AiFinanceService;
import
cn.com.poc.ai_finance.dto.AiFinanceDialoguesDto
;
import
cn.com.poc.ai_finance.dto.AiFinanceDialoguesDto
;
import
cn.com.poc.common.utils.Assert
;
import
cn.com.poc.common.utils.Assert
;
import
cn.com.poc.common.utils.BlContext
;
import
cn.com.poc.common.utils.BlContext
;
import
cn.com.poc.law.dto.AiLawDialoguesDto
;
import
cn.com.poc.law.dto.LegalFileDto
;
import
cn.com.poc.law.dto.LegalFileDto
;
import
cn.com.poc.law.rest.LegalRest
;
import
cn.com.poc.law.rest.LegalRest
;
import
cn.com.poc.law.service.AiLawService
;
import
cn.com.poc.support.security.oauth.entity.UserBaseEntity
;
import
cn.com.poc.support.security.oauth.entity.UserBaseEntity
;
import
cn.com.poc.thirdparty.resource.demand.ai.aggregate.LegalService
;
import
cn.com.poc.thirdparty.resource.demand.ai.aggregate.LegalService
;
import
cn.com.poc.thirdparty.resource.demand.ai.entity.legal.LegalFileResponse
;
import
cn.com.poc.thirdparty.resource.demand.ai.entity.legal.LegalFileResponse
;
...
@@ -43,10 +45,10 @@ public class LegalRestImpl implements LegalRest {
...
@@ -43,10 +45,10 @@ public class LegalRestImpl implements LegalRest {
}
}
@Resource
@Resource
private
Ai
FinanceService
aiFinance
Service
;
private
Ai
LawService
aiLaw
Service
;
@Override
@Override
public
void
call
(
Ai
Finance
DialoguesDto
dto
)
throws
Exception
{
public
void
call
(
Ai
Law
DialoguesDto
dto
)
throws
Exception
{
cn
.
hutool
.
core
.
lang
.
Assert
.
notNull
(
dto
.
getDialoguesId
(),
"对话id不能为空"
);
cn
.
hutool
.
core
.
lang
.
Assert
.
notNull
(
dto
.
getDialoguesId
(),
"对话id不能为空"
);
cn
.
hutool
.
core
.
lang
.
Assert
.
notNull
(
dto
.
getInput
(),
"问题不能为空"
);
cn
.
hutool
.
core
.
lang
.
Assert
.
notNull
(
dto
.
getInput
(),
"问题不能为空"
);
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
UserBaseEntity
userBaseEntity
=
BlContext
.
getCurrentUserNotException
();
...
@@ -54,6 +56,6 @@ public class LegalRestImpl implements LegalRest {
...
@@ -54,6 +56,6 @@ public class LegalRestImpl implements LegalRest {
throw
new
BusinessException
(
"用户未登录"
);
throw
new
BusinessException
(
"用户未登录"
);
}
}
ai
FinanceService
.
call
(
dto
.
getDialoguesId
(),
dto
.
getInput
(),
dto
.
getFileUrl
(),
dto
.
getKnowledgeIds
(),
dto
.
getDatabaseIds
(),
userBaseEntity
.
getUserId
());
ai
LawService
.
call
(
dto
.
getDialoguesId
(),
dto
.
getInput
(),
dto
.
getEnableSearchEngine
(),
dto
.
getEnableDeepThinking
(),
dto
.
getFileUrl
(),
dto
.
getKnowledgeIds
(),
dto
.
getDatabaseIds
(),
userBaseEntity
.
getUserId
());
}
}
}
}
src/main/java/cn/com/poc/law/service/AiLawService.java
View file @
cab016c0
...
@@ -14,10 +14,12 @@ public interface AiLawService {
...
@@ -14,10 +14,12 @@ public interface AiLawService {
* @param dialoguesId 对话id
* @param dialoguesId 对话id
* @param input 问题
* @param input 问题
* @param fileUrl 文件地址
* @param fileUrl 文件地址
* @param enableSearchEngine 是否开启联网检索
* @param enableDeepThinking 是否开启思考模式
* @param knowledgeIds 知识库ids
* @param knowledgeIds 知识库ids
* @param databaseIds 数据库ids
* @param databaseIds 数据库ids
* @param userId 用户id
* @param userId 用户id
*/
*/
void
call
(
String
dialoguesId
,
String
input
,
String
fileUrl
,
Integer
[]
knowledgeIds
,
Integer
[]
databaseIds
,
Long
userId
)
throws
Exception
;
void
call
(
String
dialoguesId
,
String
input
,
boolean
enableSearchEngine
,
boolean
enableDeepThinking
,
String
fileUrl
,
Integer
[]
knowledgeIds
,
Integer
[]
databaseIds
,
Long
userId
)
throws
Exception
;
}
}
src/main/java/cn/com/poc/law/service/impl/AiLawServiceImpl.java
View file @
cab016c0
This diff is collapsed.
Click to expand it.
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