diff --git a/urbanLifelineServ/ai/pom.xml b/urbanLifelineServ/ai/pom.xml
index 215d1d7c..d0fa3cc4 100644
--- a/urbanLifelineServ/ai/pom.xml
+++ b/urbanLifelineServ/ai/pom.xml
@@ -67,6 +67,21 @@
org.apache.dubbo
dubbo-spring-boot-starter
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+ com.alibaba.nacos
+ nacos-logback-adapter-12
+
+
+ com.alibaba.nacos
+ logback-adapter
+
+
+
org.mybatis.spring.boot
mybatis-spring-boot-starter
diff --git a/urbanLifelineServ/ai/src/main/java/org/xyzh/ai/controller/AgentController.java b/urbanLifelineServ/ai/src/main/java/org/xyzh/ai/controller/AgentController.java
index af1a0c73..88363b36 100644
--- a/urbanLifelineServ/ai/src/main/java/org/xyzh/ai/controller/AgentController.java
+++ b/urbanLifelineServ/ai/src/main/java/org/xyzh/ai/controller/AgentController.java
@@ -40,7 +40,7 @@ public class AgentController {
* @since 2025-12-17
*/
@PostMapping
- @PreAuthorize("@ss.hasPermi('ai:agent:create')")
+ @PreAuthorize("hasAuthority('ai:agent:create')")
public ResultDomain createAgent(@RequestBody TbAgent agent) {
log.info("创建智能体: name={}", agent.getName());
// 参数校验
@@ -62,7 +62,7 @@ public class AgentController {
* @since 2025-12-17
*/
@PutMapping
- @PreAuthorize("@ss.hasPermi('ai:agent:update')")
+ @PreAuthorize("hasAuthority('ai:agent:update')")
public ResultDomain updateAgent(@RequestBody TbAgent agent) {
log.info("更新智能体: agentId={}", agent.getAgentId());
// 参数校验
@@ -85,7 +85,7 @@ public class AgentController {
* @since 2025-12-17
*/
@DeleteMapping("/{agentId}")
- @PreAuthorize("@ss.hasPermi('ai:agent:delete')")
+ @PreAuthorize("hasAuthority('ai:agent:delete')")
public ResultDomain deleteAgent(@PathVariable("agentId") @NotNull String agentId) {
log.info("删除智能体: agentId={}", agentId);
TbAgent agent = new TbAgent();
@@ -100,7 +100,7 @@ public class AgentController {
* @since 2025-12-17
*/
@GetMapping("/{agentId}")
- @PreAuthorize("@ss.hasPermi('ai:agent:view')")
+ @PreAuthorize("hasAuthority('ai:agent:view')")
public ResultDomain getAgent(@PathVariable("agentId") @NotNull String agentId) {
log.info("获取智能体: agentId={}", agentId);
ResultDomain agentResult = agentService.selectAgentById(agentId);
@@ -117,7 +117,7 @@ public class AgentController {
* @since 2025-12-17
*/
@PostMapping("/page")
- @PreAuthorize("@ss.hasPermi('ai:agent:view')")
+ @PreAuthorize("hasAuthority('ai:agent:view')")
public ResultDomain getAgentPage(@RequestBody PageRequest pageRequest) {
log.info("分页查询智能体");
// 参数校验(支持嵌套属性路径)
@@ -139,7 +139,7 @@ public class AgentController {
* @since 2025-12-17
*/
@GetMapping("/list")
- @PreAuthorize("@ss.hasPermi('ai:agent:view')")
+ @PreAuthorize("hasAuthority('ai:agent:view')")
public ResultDomain getAgentList(TbAgent tbAgent) {
log.info("获取智能体列表");
return agentService.getAgentList(tbAgent);
diff --git a/urbanLifelineServ/ai/src/main/java/org/xyzh/ai/controller/KnowledgeController.java b/urbanLifelineServ/ai/src/main/java/org/xyzh/ai/controller/KnowledgeController.java
index aa74b770..89dbca07 100644
--- a/urbanLifelineServ/ai/src/main/java/org/xyzh/ai/controller/KnowledgeController.java
+++ b/urbanLifelineServ/ai/src/main/java/org/xyzh/ai/controller/KnowledgeController.java
@@ -54,7 +54,7 @@ public class KnowledgeController {
* @author yslg
* @since 2025-12-18
*/
- @PreAuthorize("@ss.hasPermission('ai:knowledge:create')")
+ @PreAuthorize("hasAuthority('ai:knowledge:create')")
@PostMapping
public ResultDomain createKnowledge(@RequestBody TbKnowledge knowledge) {
ValidationResult result = ValidationUtils.validate(knowledge, Arrays.asList(
@@ -75,7 +75,7 @@ public class KnowledgeController {
* @author yslg
* @since 2025-12-18
*/
- @PreAuthorize("@ss.hasPermission('ai:knowledge:update')")
+ @PreAuthorize("hasAuthority('ai:knowledge:update')")
@PutMapping
public ResultDomain updateKnowledge(@RequestBody @Valid TbKnowledge knowledge) {
ValidationResult result = ValidationUtils.validate(knowledge, Arrays.asList(
@@ -97,7 +97,7 @@ public class KnowledgeController {
* @author yslg
* @since 2025-12-18
*/
- @PreAuthorize("@ss.hasPermission('ai:knowledge:delete')")
+ @PreAuthorize("hasAuthority('ai:knowledge:delete')")
@DeleteMapping("/{knowledgeId}")
public ResultDomain deleteKnowledge(@PathVariable("knowledgeId") @NotBlank String knowledgeId) {
logger.info("删除知识库: knowledgeId={}", knowledgeId);
@@ -110,7 +110,7 @@ public class KnowledgeController {
* @author yslg
* @since 2025-12-18
*/
- @PreAuthorize("@ss.hasPermission('ai:knowledge:view')")
+ @PreAuthorize("hasAuthority('ai:knowledge:view')")
@GetMapping("/{knowledgeId}")
public ResultDomain getKnowledge(@PathVariable("knowledgeId") @NotBlank String knowledgeId) {
logger.info("获取知识库: knowledgeId={}", knowledgeId);
@@ -123,7 +123,7 @@ public class KnowledgeController {
* @author yslg
* @since 2025-12-18
*/
- @PreAuthorize("@ss.hasPermission('ai:knowledge:view')")
+ @PreAuthorize("hasAuthority('ai:knowledge:view')")
@PostMapping("/list")
public ResultDomain listKnowledges(@RequestBody(required = false) TbKnowledge filter) {
logger.info("查询知识库列表");
@@ -136,7 +136,7 @@ public class KnowledgeController {
* @author yslg
* @since 2025-12-18
*/
- @PreAuthorize("@ss.hasPermission('ai:knowledge:view')")
+ @PreAuthorize("hasAuthority('ai:knowledge:view')")
@PostMapping("/page")
public ResultDomain pageKnowledges(@RequestBody @Valid PageRequest pageRequest) {
logger.info("分页查询知识库");
@@ -149,7 +149,7 @@ public class KnowledgeController {
* @author yslg
* @since 2025-12-18
*/
- @PreAuthorize("@ss.hasPermission('ai:knowledge:view')")
+ @PreAuthorize("hasAuthority('ai:knowledge:view')")
@GetMapping("/{knowledgeId}/stats")
public ResultDomain getKnowledgeStats(@PathVariable("knowledgeId") @NotBlank String knowledgeId) {
logger.info("获取知识库统计: knowledgeId={}", knowledgeId);
@@ -164,7 +164,7 @@ public class KnowledgeController {
* @author yslg
* @since 2025-12-18
*/
- @PreAuthorize("@ss.hasPermission('ai:knowledge:file:view')")
+ @PreAuthorize("hasAuthority('ai:knowledge:file:view')")
@GetMapping("/{knowledgeId}/documents")
public ResultDomain