feat(auth): 优化注册功能并添加注册异常处理
- 新增 RegistrationException 类用于处理注册相关的异常 - 在全局异常处理器中添加 RegistrationException 的处理逻辑 - 修改用户服务中的注册逻辑,当用户名或邮箱已存在时抛出 RegistrationException - 更新注册码实体类,将日期时间字段改为字符串类型 - 调整注册码生成和验证逻辑,使用字符串格式的日期时间
This commit is contained in:
@@ -7,7 +7,6 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("registration_codes")
|
||||
@@ -24,11 +23,51 @@ public class RegistrationCode implements Serializable {
|
||||
private String code;
|
||||
|
||||
@Schema(description = "过期时间", name = "expiryTime")
|
||||
private LocalDateTime expiryTime;
|
||||
private String expiryTime;
|
||||
|
||||
@Schema(description = "创建者", name = "createdBy")
|
||||
private String createdBy;
|
||||
|
||||
@Schema(description = "创建时间", name = "createdAt")
|
||||
private LocalDateTime createdAt;
|
||||
private String createdAt;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getExpiryTime() {
|
||||
return expiryTime;
|
||||
}
|
||||
|
||||
public void setExpiryTime(String expiryTime) {
|
||||
this.expiryTime = expiryTime;
|
||||
}
|
||||
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public String getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(String createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user