服务层重构与优化:补全所有ServiceImpl实现类,修复RestTemplate注入,完善DTO与配置,保证编译与启动通过
This commit is contained in:
+2
-2
@@ -1,9 +1,9 @@
|
||||
package com.emotionmuseum.user.controller;
|
||||
|
||||
import com.emotionmuseum.common.result.Result;
|
||||
import com.emotionmuseum.user.dto.UserUpdateRequest;
|
||||
import com.emotionmuseum.user.request.UserUpdateRequest;
|
||||
import com.emotionmuseum.user.service.UserService;
|
||||
import com.emotionmuseum.user.vo.UserInfoResponse;
|
||||
import com.emotionmuseum.user.response.UserInfoResponse;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package com.emotionmuseum.user.request;
|
||||
|
||||
import com.emotionmuseum.common.request.BaseRequest;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import jakarta.validation.constraints.Email;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 用户信息更新请求
|
||||
*
|
||||
* @author emotion-museum
|
||||
* @since 2025-07-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "用户信息更新请求")
|
||||
public class UserUpdateRequest extends BaseRequest {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "用户名", example = "新用户名")
|
||||
@Size(min = 2, max = 20, message = "用户名长度必须在2-20位之间")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "邮箱", example = "new@example.com")
|
||||
@Email(message = "邮箱格式不正确")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "手机号", example = "13900139000")
|
||||
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "头像URL", example = "https://example.com/avatar.jpg")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "昵称", example = "新昵称")
|
||||
@Size(min = 1, max = 20, message = "昵称长度必须在1-20位之间")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "生日", example = "1990-01-01")
|
||||
private LocalDate birthDate;
|
||||
|
||||
@Schema(description = "所在地", example = "上海市")
|
||||
@Size(max = 50, message = "所在地长度不能超过50位")
|
||||
private String location;
|
||||
|
||||
@Schema(description = "个人简介", example = "更新后的个人简介")
|
||||
@Size(max = 200, message = "个人简介长度不能超过200位")
|
||||
private String bio;
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
package com.emotionmuseum.user.response;
|
||||
|
||||
import com.emotionmuseum.common.response.BaseResponse;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 用户信息响应
|
||||
*
|
||||
* @author emotion-museum
|
||||
* @since 2025-07-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "用户信息响应")
|
||||
public class UserInfoResponse extends BaseResponse {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "账号")
|
||||
private String account;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "头像URL")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "生日")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate birthDate;
|
||||
|
||||
@Schema(description = "所在地")
|
||||
private String location;
|
||||
|
||||
@Schema(description = "个人简介")
|
||||
private String bio;
|
||||
|
||||
@Schema(description = "会员等级")
|
||||
private String memberLevel;
|
||||
|
||||
@Schema(description = "使用天数")
|
||||
private Integer totalDays;
|
||||
|
||||
@Schema(description = "成长数据")
|
||||
private GrowthStatsVO growthStats;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否已验证")
|
||||
private Integer isVerified;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "最后活跃时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastActiveTime;
|
||||
|
||||
/**
|
||||
* 成长数据VO
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "成长数据")
|
||||
public static class GrowthStatsVO {
|
||||
|
||||
@Schema(description = "自我感知")
|
||||
private BigDecimal selfAwareness;
|
||||
|
||||
@Schema(description = "情绪韧性")
|
||||
private BigDecimal emotionalResilience;
|
||||
|
||||
@Schema(description = "行动力")
|
||||
private BigDecimal actionPower;
|
||||
|
||||
@Schema(description = "共情力")
|
||||
private BigDecimal empathy;
|
||||
|
||||
@Schema(description = "生活热度")
|
||||
private BigDecimal lifeEnthusiasm;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user