服务层重构与优化:补全所有ServiceImpl实现类,修复RestTemplate注入,完善DTO与配置,保证编译与启动通过

This commit is contained in:
2025-07-24 14:15:31 +08:00
parent 873b8e55da
commit cf4d73ceff
95 changed files with 5889 additions and 2282 deletions
@@ -0,0 +1,63 @@
package com.emotionmuseum.record.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.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.DecimalMax;
import jakarta.validation.constraints.DecimalMin;
import java.time.LocalDate;
import java.util.List;
/**
* 创建情绪记录请求
*
* @author emotion-museum
* @since 2025-07-24
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "创建情绪记录请求")
public class CreateEmotionRecordRequest extends BaseRequest {
private static final long serialVersionUID = 1L;
@Schema(description = "用户ID", example = "user_123")
@NotBlank(message = "用户ID不能为空")
private String userId;
@Schema(description = "记录日期", example = "2025-07-24")
@NotNull(message = "记录日期不能为空")
private LocalDate recordDate;
@Schema(description = "情绪类型", example = "joy")
@NotBlank(message = "情绪类型不能为空")
private String emotionType;
@Schema(description = "情绪强度", example = "0.8")
@NotNull(message = "情绪强度不能为空")
@DecimalMin(value = "0.0", message = "情绪强度不能小于0")
@DecimalMax(value = "1.0", message = "情绪强度不能大于1")
private Double intensity;
@Schema(description = "触发因素", example = "完成了重要项目")
private String triggers;
@Schema(description = "详细描述", example = "今天心情很好,完成了一个重要的项目")
private String description;
@Schema(description = "标签列表", example = "[\"工作\", \"成就感\"]")
private List<String> tags;
@Schema(description = "天气情况", example = "晴天")
private String weather;
@Schema(description = "所在位置", example = "办公室")
private String location;
@Schema(description = "当时活动", example = "工作")
private String activity;
}
@@ -0,0 +1,67 @@
package com.emotionmuseum.record.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.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
/**
* 情绪记录响应
*
* @author emotion-museum
* @since 2025-07-24
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "情绪记录响应")
public class EmotionRecordResponse extends BaseResponse {
private static final long serialVersionUID = 1L;
@Schema(description = "记录ID")
private String id;
@Schema(description = "用户ID")
private String userId;
@Schema(description = "记录日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate recordDate;
@Schema(description = "情绪类型")
private String emotionType;
@Schema(description = "情绪强度")
private Double intensity;
@Schema(description = "触发因素")
private String triggers;
@Schema(description = "详细描述")
private String description;
@Schema(description = "标签列表")
private List<String> tags;
@Schema(description = "天气情况")
private String weather;
@Schema(description = "所在位置")
private String location;
@Schema(description = "当时活动")
private String activity;
@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 updateTime;
}