feat: 接口字段补 @Schema 中文说明 + 精简冗余字段 + 接入 Prometheus 监控
- 全部 VO 字段补 @Schema(description) 中文说明,在线文档字段可读 - AppEpisodeVO 精简 duration/isFree 冗余字段(保留 durationSec/locked) - framework 引入 actuator + micrometer-registry-prometheus - SecurityConfig 放行 /actuator/prometheus,双服务配置 management 暴露指标 - 新增 deploy/docker-compose.yml + prometheus.yml 监控部署配置
This commit is contained in:
1 parent
efe8af6c9b
commit
5f9483a86c
140 files changed
+1357
-19
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -15,5 +16,6 @@ import lombok.EqualsAndHashCode;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AppUserAdminRespVO extends AppUserRespVO {
|
||||
|
||||
@Schema(description = "自增 ID")
|
||||
private Long id;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/** 后台用户检索条件。 */
|
||||
@@ -9,10 +10,21 @@ import lombok.Data;
|
||||
public class AppUserQueryReqVO {
|
||||
|
||||
/** uid / 昵称 / 手机号 / 邮箱 模糊匹配 */
|
||||
@Schema(description = "关键字(uid/昵称/手机号/邮箱模糊匹配)")
|
||||
private String keyword;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "国家代码")
|
||||
private String countryCode;
|
||||
|
||||
@Schema(description = "注册来源")
|
||||
private String registerSource;
|
||||
|
||||
@Schema(description = "页码")
|
||||
private Integer pageIndex = 1;
|
||||
|
||||
@Schema(description = "每页数量")
|
||||
private Integer pageSize = 10;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -10,21 +11,50 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class AppUserRespVO {
|
||||
|
||||
@Schema(description = "用户UID")
|
||||
private String uid;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像地址")
|
||||
private String avatarUrl;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "国家代码")
|
||||
private String countryCode;
|
||||
|
||||
@Schema(description = "地区代码")
|
||||
private String regionCode;
|
||||
|
||||
@Schema(description = "语言")
|
||||
private String language;
|
||||
|
||||
@Schema(description = "时区")
|
||||
private String timezone;
|
||||
|
||||
@Schema(description = "货币")
|
||||
private String currency;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
/** 脱敏后的手机号/邮箱,用于"我的"页展示 */
|
||||
@Schema(description = "脱敏手机号/邮箱")
|
||||
private String maskedTarget;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "最后登录时间")
|
||||
private LocalDateTime lastLoginAt;
|
||||
|
||||
/** 预留:会员等级与到期(第二阶段) */
|
||||
@Schema(description = "会员等级")
|
||||
private Integer vipLevel;
|
||||
|
||||
@Schema(description = "会员到期时间")
|
||||
private LocalDateTime vipExpireAt;
|
||||
}
|
||||
@@ -2,12 +2,16 @@
|
||||
|
||||
package com.fruitshorts.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/** 申请注销:进入冷静期,期间可撤销。 */
|
||||
@Data
|
||||
public class DeactivateReqVO {
|
||||
|
||||
@Schema(description = "注销原因")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -9,21 +10,34 @@ import lombok.Data;
|
||||
@Data
|
||||
public class LoginReqVO {
|
||||
|
||||
@Schema(description = "登录方式(PHONE/EMAIL)")
|
||||
@NotBlank(message = "请指定登录方式")
|
||||
private String targetType;
|
||||
|
||||
@Schema(description = "手机号或邮箱")
|
||||
@NotBlank(message = "请输入手机号或邮箱")
|
||||
private String target;
|
||||
|
||||
/** 验证码登录 */
|
||||
@Schema(description = "验证码")
|
||||
private String code;
|
||||
|
||||
/** 密码登录 */
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "设备型号")
|
||||
private String deviceModel;
|
||||
|
||||
@Schema(description = "系统版本")
|
||||
private String osVersion;
|
||||
|
||||
@Schema(description = "应用版本")
|
||||
private String appVersion;
|
||||
|
||||
@Schema(description = "平台")
|
||||
private String platform;
|
||||
}
|
||||
@@ -2,12 +2,16 @@
|
||||
|
||||
package com.fruitshorts.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/** 登出。allDevices=true 时吊销该用户全部会话。 */
|
||||
@Data
|
||||
public class LogoutReqVO {
|
||||
|
||||
@Schema(description = "刷新令牌")
|
||||
private String refreshToken;
|
||||
|
||||
@Schema(description = "是否注销所有设备")
|
||||
private Boolean allDevices;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -10,19 +11,24 @@ import lombok.Data;
|
||||
public class OtpSendReqVO {
|
||||
|
||||
/** REGISTER/LOGIN/RESET_PWD/BIND */
|
||||
@Schema(description = "验证码场景")
|
||||
@NotBlank(message = "请指定验证码场景")
|
||||
private String scene;
|
||||
|
||||
/** PHONE/EMAIL */
|
||||
@Schema(description = "验证方式(PHONE/EMAIL)")
|
||||
@NotBlank(message = "请指定验证方式")
|
||||
private String targetType;
|
||||
|
||||
/** E.164 手机号或邮箱 */
|
||||
@Schema(description = "手机号或邮箱")
|
||||
@NotBlank(message = "请输入手机号或邮箱")
|
||||
private String target;
|
||||
|
||||
@Schema(description = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
/** 预留:图形验证码票据,触发频控阈值后必填 */
|
||||
@Schema(description = "图形验证码票据")
|
||||
private String captchaTicket;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
@@ -10,11 +11,24 @@ import java.time.LocalDate;
|
||||
@Data
|
||||
public class ProfileUpdateReqVO {
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像地址")
|
||||
private String avatarUrl;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private String gender;
|
||||
|
||||
@Schema(description = "生日")
|
||||
private LocalDate birthday;
|
||||
|
||||
@Schema(description = "语言")
|
||||
private String language;
|
||||
|
||||
@Schema(description = "时区")
|
||||
private String timezone;
|
||||
|
||||
@Schema(description = "地区代码")
|
||||
private String regionCode;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -9,6 +10,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class RefreshReqVO {
|
||||
|
||||
@Schema(description = "刷新令牌")
|
||||
@NotBlank(message = "缺少 refreshToken")
|
||||
private String refreshToken;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -9,29 +10,48 @@ import lombok.Data;
|
||||
@Data
|
||||
public class RegisterReqVO {
|
||||
|
||||
@Schema(description = "注册方式(PHONE/EMAIL)")
|
||||
@NotBlank(message = "请指定注册方式")
|
||||
private String targetType;
|
||||
|
||||
@Schema(description = "手机号或邮箱")
|
||||
@NotBlank(message = "请输入手机号或邮箱")
|
||||
private String target;
|
||||
|
||||
@Schema(description = "验证码")
|
||||
@NotBlank(message = "请输入验证码")
|
||||
private String code;
|
||||
|
||||
/** 可选:同时设置密码,之后可用密码登录 */
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "国家代码")
|
||||
private String countryCode;
|
||||
|
||||
@Schema(description = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "设备型号")
|
||||
private String deviceModel;
|
||||
|
||||
@Schema(description = "系统版本")
|
||||
private String osVersion;
|
||||
|
||||
@Schema(description = "应用版本")
|
||||
private String appVersion;
|
||||
|
||||
@Schema(description = "平台")
|
||||
private String platform;
|
||||
|
||||
/** 协议版本,注册即视为同意最新版隐私政策与用户协议 */
|
||||
@Schema(description = "协议版本")
|
||||
private String agreementVersion;
|
||||
|
||||
/** 预留:营销与个性化广告同意,未同意不影响注册 */
|
||||
@Schema(description = "营销广告同意")
|
||||
private Boolean marketingConsent;
|
||||
}
|
||||
@@ -2,19 +2,31 @@
|
||||
|
||||
package com.fruitshorts.user.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/** 登录/刷新返回的令牌与用户摘要。 */
|
||||
@Data
|
||||
public class TokenRespVO {
|
||||
|
||||
@Schema(description = "访问令牌")
|
||||
private String accessToken;
|
||||
|
||||
/** 不透明随机串,只在客户端保存,服务端只存哈希 */
|
||||
@Schema(description = "刷新令牌")
|
||||
private String refreshToken;
|
||||
|
||||
/** access token 剩余有效期(秒) */
|
||||
@Schema(description = "访问令牌剩余有效期(秒)")
|
||||
private long expiresIn;
|
||||
|
||||
@Schema(description = "令牌类型")
|
||||
private String tokenType = "Bearer";
|
||||
|
||||
@Schema(description = "用户信息")
|
||||
private AppUserRespVO user;
|
||||
|
||||
/** 本次登录是否新建了账号(验证码登录可能顺带注册) */
|
||||
@Schema(description = "是否新建账号")
|
||||
private boolean newUser;
|
||||
}
|
||||
Reference in new issue
Block a user