- 重命名并调整 DTO 类结构,将 LoginRequest 和 RegisterRequest 迁移至 request 包- 引入 AuthLoginRequest 和 AuthRegisterRequest 并添加字段验证注解 - 更新 AuthController 使用新的 DTO 并增加 @Valid 参数校验 - 修改 AuthService 接口及实现类,接收 User 实体而非 RegisterRequest - 添加全局异常处理器 GlobalExceptionHandler 处理参数校验和业务异常 - 新增 ErrorCode 枚举统一管理错误码和消息 - 引入 UserConverter 组件用于 DTO 到实体的转换 - 增强用户注册与登录逻辑,完善异常处理和错误提示 - 移除旧的 BadCredentialsException 捕获逻辑 - 调整 pom.xml 添加 spring-boot-starter-validation 和相关依赖 - 更新 User 实体类,添加完整字段映射和角色关联配置 - 新增 UserInfoService 及其实现,提供用户管理和密码设置功能 -优化 UserMapper 查询方法,支持联表查询用户及其角色信息 - 删除无用的 HLSController 控制器 - 完善 ImageController 文件上传逻辑并更新响应结构 - 添加用户名和密码格式验证工具类 PasswordValidate 和 UsernameValidate
90 lines
3.1 KiB
XML
90 lines
3.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<parent>
|
|
<groupId>cn.nopj</groupId>
|
|
<artifactId>chaos_api</artifactId>
|
|
<version>1.0-SNAPSHOT</version>
|
|
</parent>
|
|
|
|
<artifactId>chaos_api_web</artifactId>
|
|
<packaging>jar</packaging>
|
|
<name>chaos_api_web</name>
|
|
<description>Web layer (Controllers, main application)</description>
|
|
|
|
<properties>
|
|
<maven.compiler.source>21</maven.compiler.source>
|
|
<maven.compiler.target>21</maven.compiler.target>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
</properties>
|
|
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>cn.nopj</groupId>
|
|
<artifactId>chaos_api_interface</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>cn.nopj</groupId>
|
|
<artifactId>chaos_api_service</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>cn.nopj</groupId>
|
|
<artifactId>chaos_api_common</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>cn.nopj</groupId>
|
|
<artifactId>chaos_api_data</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-web</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-security</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
|
</dependency>
|
|
<!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt-api -->
|
|
<dependency>
|
|
<groupId>com.auth0</groupId>
|
|
<artifactId>java-jwt</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>ch.qos.logback</groupId>
|
|
<artifactId>logback-classic</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.projectlombok</groupId>
|
|
<artifactId>lombok</artifactId>
|
|
<scope>provided</scope>
|
|
</dependency>
|
|
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
|
|
<executions>
|
|
<execution>
|
|
<goals>
|
|
<goal>repackage</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
|
|
</project> |