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
+4
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.playback.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -9,12 +10,15 @@ import lombok.Data;
|
||||
@Data
|
||||
public class DownloadGrantReqVO {
|
||||
|
||||
@Schema(description = "剧集ID")
|
||||
@NotNull(message = "缺少 episodeId")
|
||||
private Long episodeId;
|
||||
|
||||
/** 期望清晰度,AUTO 表示由客户端按策略决定 */
|
||||
@Schema(description = "期望清晰度,AUTO 表示由客户端按策略决定")
|
||||
private String quality;
|
||||
|
||||
/** 设备标识,绑定授权用;请求头带 X-Device-Id 时可以省略 */
|
||||
@Schema(description = "设备标识,绑定授权用;请求头带 X-Device-Id 时可以省略")
|
||||
private String deviceId;
|
||||
}
|
||||
+33
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.playback.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -10,26 +11,58 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class DownloadLicenseRespVO {
|
||||
|
||||
@Schema(description = "授权ID")
|
||||
private Long licenseId;
|
||||
|
||||
@Schema(description = "短剧ID")
|
||||
private Long dramaId;
|
||||
|
||||
@Schema(description = "短剧标题")
|
||||
private String dramaTitle;
|
||||
|
||||
@Schema(description = "剧集ID")
|
||||
private Long episodeId;
|
||||
|
||||
@Schema(description = "集号")
|
||||
private Integer episodeNo;
|
||||
|
||||
@Schema(description = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
@Schema(description = "清晰度")
|
||||
private String quality;
|
||||
|
||||
/** 签名后的下载地址;过期后需要重新申请 */
|
||||
@Schema(description = "签名后的下载地址;过期后需要重新申请")
|
||||
private String playUrl;
|
||||
|
||||
/** 离线播放校验用 */
|
||||
@Schema(description = "离线播放校验密钥")
|
||||
private String licenseKey;
|
||||
|
||||
/** ACTIVE/EXPIRED/REVOKED */
|
||||
@Schema(description = "状态(ACTIVE/EXPIRED/REVOKED)")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "授权时间")
|
||||
private LocalDateTime grantedAt;
|
||||
|
||||
@Schema(description = "过期时间")
|
||||
private LocalDateTime expireAt;
|
||||
|
||||
/** QUEUED/DOWNLOADING/PAUSED/COMPLETED/FAILED/CANCELED */
|
||||
@Schema(description = "任务状态(QUEUED/DOWNLOADING/PAUSED/COMPLETED/FAILED/CANCELED)")
|
||||
private String taskStatus;
|
||||
|
||||
@Schema(description = "进度百分比")
|
||||
private Integer progressPercent;
|
||||
|
||||
@Schema(description = "已下载字节数")
|
||||
private Long downloadedBytes;
|
||||
|
||||
@Schema(description = "总字节数")
|
||||
private Long totalBytes;
|
||||
|
||||
@Schema(description = "错误信息")
|
||||
private String errorMsg;
|
||||
}
|
||||
+16
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.playback.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@@ -10,16 +11,31 @@ import lombok.Data;
|
||||
@Data
|
||||
public class DownloadPolicyRespVO {
|
||||
|
||||
@Schema(description = "每设备最大授权数")
|
||||
private Integer maxPerDevice;
|
||||
|
||||
@Schema(description = "授权有效期(天)")
|
||||
private Integer licenseDays;
|
||||
|
||||
/** 用户当前的"仅 Wi-Fi 下载"偏好 */
|
||||
@Schema(description = "用户当前的“仅 Wi-Fi 下载”偏好")
|
||||
private Boolean wifiOnly;
|
||||
|
||||
@Schema(description = "最高清晰度")
|
||||
private String maxQuality;
|
||||
|
||||
/** 预留:单设备占用上限(字节),0 表示不限制 */
|
||||
@Schema(description = "单设备占用上限(字节),0 表示不限制")
|
||||
private Long maxStorageBytes;
|
||||
|
||||
/** 当前设备已用授权数 */
|
||||
@Schema(description = "当前设备已用授权数")
|
||||
private Integer used;
|
||||
|
||||
@Schema(description = "剩余授权数")
|
||||
private Integer remaining;
|
||||
|
||||
/** 过期策略说明,用于客户端文案与客服解释 */
|
||||
@Schema(description = "过期策略说明,用于客户端文案与客服解释")
|
||||
private String expirePolicyText;
|
||||
}
|
||||
+12
@@ -2,17 +2,29 @@
|
||||
|
||||
package com.fruitshorts.playback.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/** 上报下载进度,用于断点续传与跨端展示。 */
|
||||
@Data
|
||||
public class DownloadProgressReqVO {
|
||||
|
||||
@Schema(description = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
/** QUEUED/DOWNLOADING/PAUSED/COMPLETED/FAILED/CANCELED */
|
||||
@Schema(description = "状态(QUEUED/DOWNLOADING/PAUSED/COMPLETED/FAILED/CANCELED)")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "进度百分比")
|
||||
private Integer progressPercent;
|
||||
|
||||
@Schema(description = "已下载字节数")
|
||||
private Long downloadedBytes;
|
||||
|
||||
@Schema(description = "总字节数")
|
||||
private Long totalBytes;
|
||||
|
||||
@Schema(description = "错误信息")
|
||||
private String errorMsg;
|
||||
}
|
||||
+10
@@ -2,16 +2,26 @@
|
||||
|
||||
package com.fruitshorts.playback.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/** 后台下载授权检索条件。 */
|
||||
@Data
|
||||
public class DownloadQueryReqVO {
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "设备ID")
|
||||
private String deviceId;
|
||||
|
||||
/** ACTIVE/EXPIRED/REVOKED */
|
||||
@Schema(description = "状态(ACTIVE/EXPIRED/REVOKED)")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "页码")
|
||||
private Integer pageIndex = 1;
|
||||
|
||||
@Schema(description = "每页数量")
|
||||
private Integer pageSize = 10;
|
||||
}
|
||||
+4
@@ -2,12 +2,16 @@
|
||||
|
||||
package com.fruitshorts.playback.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/** 下载偏好设置。 */
|
||||
@Data
|
||||
public class DownloadSettingReqVO {
|
||||
|
||||
@Schema(description = "是否仅 Wi-Fi 下载")
|
||||
private Boolean wifiOnly;
|
||||
|
||||
@Schema(description = "最高清晰度")
|
||||
private String maxQuality;
|
||||
}
|
||||
+2
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.playback.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -9,6 +10,7 @@ import lombok.Data;
|
||||
@Data
|
||||
public class FavoriteToggleReqVO {
|
||||
|
||||
@Schema(description = "短剧ID")
|
||||
@NotNull(message = "缺少 dramaId")
|
||||
private Long dramaId;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.playback.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@@ -10,21 +11,42 @@ import java.util.List;
|
||||
@Data
|
||||
public class PlayRespVO {
|
||||
|
||||
@Schema(description = "剧集ID")
|
||||
private Long episodeId;
|
||||
|
||||
@Schema(description = "短剧ID")
|
||||
private Long dramaId;
|
||||
|
||||
@Schema(description = "集号")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "时长(秒)")
|
||||
private Integer durationSec;
|
||||
|
||||
/** 是否可直接播放 */
|
||||
@Schema(description = "是否可直接播放")
|
||||
private Boolean accessible;
|
||||
|
||||
/** FREE/ENTITLED/TRIAL/COIN_REQUIRED/NO_MEDIA */
|
||||
@Schema(description = "访问类型(FREE/ENTITLED/TRIAL/COIN_REQUIRED/NO_MEDIA)")
|
||||
private String accessType;
|
||||
|
||||
/** 签名后的播放地址,accessible=false 时为空 */
|
||||
@Schema(description = "签名后的播放地址,accessible=false 时为空")
|
||||
private String playUrl;
|
||||
|
||||
/** 可用的清晰度档位 */
|
||||
@Schema(description = "可用的清晰度档位")
|
||||
private List<String> qualities;
|
||||
|
||||
/** 需要多少金币解锁 */
|
||||
@Schema(description = "解锁所需金币数")
|
||||
private Integer unlockCoin;
|
||||
|
||||
/** 试看秒数,0 表示不限制 */
|
||||
@Schema(description = "试看秒数,0 表示不限制")
|
||||
private Integer previewSeconds;
|
||||
}
|
||||
+14
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.playback.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -10,11 +11,24 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
public class ProgressRespVO {
|
||||
|
||||
@Schema(description = "短剧ID")
|
||||
private Long dramaId;
|
||||
|
||||
@Schema(description = "剧集ID")
|
||||
private Long episodeId;
|
||||
|
||||
@Schema(description = "播放位置(毫秒)")
|
||||
private Long positionMs;
|
||||
|
||||
@Schema(description = "时长(毫秒)")
|
||||
private Long durationMs;
|
||||
|
||||
@Schema(description = "是否已看完")
|
||||
private Boolean finished;
|
||||
|
||||
@Schema(description = "播放次数")
|
||||
private Integer playCount;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
+11
@@ -2,6 +2,7 @@
|
||||
|
||||
package com.fruitshorts.playback.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -9,13 +10,23 @@ import lombok.Data;
|
||||
@Data
|
||||
public class ProgressSaveReqVO {
|
||||
|
||||
@Schema(description = "剧集ID")
|
||||
@NotNull(message = "缺少 episodeId")
|
||||
private Long episodeId;
|
||||
|
||||
@Schema(description = "播放位置(毫秒)")
|
||||
private Long positionMs;
|
||||
|
||||
@Schema(description = "时长(毫秒)")
|
||||
private Long durationMs;
|
||||
|
||||
@Schema(description = "是否已看完")
|
||||
private Boolean finished;
|
||||
|
||||
/** HOME/DETAIL/SEARCH/FAVORITE */
|
||||
@Schema(description = "来源(HOME/DETAIL/SEARCH/FAVORITE)")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "设备ID")
|
||||
private String deviceId;
|
||||
}
|
||||
Reference in new issue
Block a user