feat(dify): 集成 Dify 服务并更新相关配置
- 在 application.yml 中添加 Dify 服务相关配置 - 删除 PageDto 类 - 更新 pom.xml,升级 mybatis-plus 版本并添加 dify-spring-boot-starter 依赖 - 调整 SpringSecurityConfig 中的请求匹配规则
This commit is contained in:
parent
c39927451e
commit
12c53c6a62
13
pom.xml
13
pom.xml
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<version>3.4.4</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.zsc.edu</groupId>
|
||||
@ -28,8 +28,9 @@
|
||||
</scm>
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<mybatis-plus.version>3.5.9</mybatis-plus.version>
|
||||
<mybatis-plus.version>3.5.11</mybatis-plus.version>
|
||||
<mapstruct.version>1.6.2</mapstruct.version>
|
||||
<fastjson.version>2.0.53</fastjson.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- <dependency>-->
|
||||
@ -37,6 +38,12 @@
|
||||
<!-- <artifactId>spring-boot-starter-data-mongodb</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.github.guoshiqiufeng.dify</groupId>
|
||||
<artifactId>dify-spring-boot-starter</artifactId>
|
||||
<version>0.9.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
@ -150,7 +157,7 @@
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>2.0.21</version>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
@ -81,6 +81,7 @@ public class SpringSecurityConfig {
|
||||
.requestMatchers(HttpMethod.GET, "/api/rest/user/menu","/api/rest/user/register","/api/rest/user/send-email").permitAll()
|
||||
.requestMatchers(HttpMethod.POST, "/api/rest/user/login","/api/rest/user/register").permitAll()
|
||||
.requestMatchers("/api/rest/user/me").permitAll()
|
||||
.requestMatchers("/v1/**").permitAll()
|
||||
.requestMatchers("/api/**").authenticated()
|
||||
)
|
||||
// 不用注解,直接通过判断路径实现动态访问权限
|
||||
@ -137,7 +138,7 @@ public class SpringSecurityConfig {
|
||||
.rememberMe(rememberMe -> rememberMe
|
||||
.userDetailsService(userDetailsService)
|
||||
.tokenRepository(persistentTokenRepository()))
|
||||
.csrf(csrf -> csrf.ignoringRequestMatchers("/api/internal/**", "/api/rest/user/logout","/api/rest/user/register"))
|
||||
.csrf(csrf -> csrf.ignoringRequestMatchers("v1/**","/api/internal/**", "/api/rest/user/logout","/api/rest/user/register"))
|
||||
.sessionManagement(session -> session
|
||||
.maximumSessions(3)
|
||||
.sessionRegistry(sessionRegistry)
|
||||
|
@ -1,24 +0,0 @@
|
||||
package com.zsc.edu.dify.modules.message.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhuang
|
||||
*/
|
||||
@Data
|
||||
public class PageDto<T> {
|
||||
/**
|
||||
* 总条数
|
||||
*/
|
||||
private Long total;
|
||||
/**
|
||||
* 总页数
|
||||
*/
|
||||
private Integer pages;
|
||||
/**
|
||||
* 集合
|
||||
*/
|
||||
private List<T> list;
|
||||
}
|
@ -5,10 +5,10 @@ import java.util.function.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 树操作方法工具类
|
||||
* @Copyright: Copyright (c) 赵侠客
|
||||
* @Date: 2024-07-22 10:42
|
||||
* @Version: 1.0
|
||||
* @ Description: 树操作方法工具类
|
||||
* @ Copyright: Copyright (c) 赵侠客
|
||||
* @ Date: 2024-07-22 10:42
|
||||
* @ Version: 1.0
|
||||
*/
|
||||
public class TreeUtil {
|
||||
/**
|
||||
|
@ -3,4 +3,12 @@ spring:
|
||||
active: dev
|
||||
docker:
|
||||
compose:
|
||||
enabled: false
|
||||
enabled: false
|
||||
|
||||
dify:
|
||||
url: http://47.112.173.8:6800/ # 请替换为实际的 Dify 服务地址
|
||||
server:
|
||||
email: vertoryao@outlook.com # 请替换为实际的 Dify 服务邮箱,若不需要调用 server相关接口可不填
|
||||
password: admin123 # 请替换为实际的 Dify 服务密码,若不需要调用 server相关接口可不填
|
||||
dataset:
|
||||
api-key: dataset-kN5WTJ8jR877YfN1A34JceVg # 请替换为实际的知识库api-key, 若不需要调用知识库可不填
|
@ -37,9 +37,7 @@
|
||||
<result column="address" jdbcType="VARCHAR" property="address"/>
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, username, password, email, phone, create_time
|
||||
</sql>
|
||||
<sql id="Base_Column_List">id, username, password, email, phone, create_time</sql>
|
||||
|
||||
<select id="selectByUsername" parameterType="java.lang.String" resultMap="UserMap">
|
||||
select su.*, sr.name as role_name, sr.data_scope, sd.name as dept_name from sys_user su
|
||||
|
Loading…
Reference in New Issue
Block a user