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:
Zhou Weidong committed 2026-10-17 02:24:25 +08:00
1 parent efe8af6c9b
commit 5f9483a86c
140 files changed
+1357 -19

No files matched your search

@@ -2,6 +2,7 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@@ -10,19 +11,31 @@ import java.time.LocalDateTime;
@Data
public class BannerRespVO {
@Schema(description = "轮播图 ID")
private Long id;
@Schema(description = "图片地址")
private String imageUrl;
@Schema(description = "展示位置")
private String position;
@Schema(description = "展示位置文本")
private String positionText;
@Schema(description = "跳转类型")
private String linkType;
@Schema(description = "跳转类型文本")
private String linkTypeText;
@Schema(description = "跳转目标")
private String linkValue;
/** 跳转目标的展示文案,如短剧名称 */
@Schema(description = "跳转目标文案")
private String linkText;
@Schema(description = "排序")
private Integer sort;
@Schema(description = "状态")
private Integer status;
@Schema(description = "状态文本")
private String statusText;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新时间")
private LocalDateTime updatedAt;
}
@@ -2,23 +2,30 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class BannerSaveReqVO {
@jakarta.validation.constraints.NotBlank(message = "请上传轮播图片")
@Schema(description = "轮播图片地址")
private String imageUrl;
/** HOME_TOP / DISCOVER */
@Schema(description = "展示位置")
private String position;
/** NONE / DRAMA / URL */
@Schema(description = "跳转类型")
private String linkType;
/** 剧集 ID 或跳转地址 */
@Schema(description = "跳转目标")
private String linkValue;
@Schema(description = "排序")
private Integer sort;
@Schema(description = "状态")
private Integer status;
}
@@ -2,15 +2,21 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class DramaCategoryRespVO {
@Schema(description = "分类 ID")
private Long id;
@Schema(description = "分类名称")
private String name;
@Schema(description = "排序")
private Integer sort;
@Schema(description = "状态")
private Integer status;
/** 该类型下的短剧数量 */
@Schema(description = "短剧数量")
private Integer dramaCount;
}
@@ -2,6 +2,7 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
@@ -9,8 +10,11 @@ import lombok.Data;
public class DramaCategorySaveReqVO {
@NotBlank(message = "请填写类型名称")
@Schema(description = "类型名称")
private String name;
@Schema(description = "排序")
private Integer sort;
@Schema(description = "状态")
private Integer status;
}
@@ -2,6 +2,7 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fruitshorts.common.pojo.PageParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -11,9 +12,13 @@ import lombok.EqualsAndHashCode;
public class DramaPageReqVO extends PageParam {
/** 标题关键字 */
@Schema(description = "标题关键字")
private String keyword;
@Schema(description = "状态")
private String status;
@Schema(description = "分类 ID")
private Long categoryId;
/** 是否只看热门 */
@Schema(description = "是否热门")
private Boolean isHot;
}
@@ -2,6 +2,7 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
@@ -13,33 +14,55 @@ import java.time.LocalDateTime;
@Data
public class DramaRespVO {
@Schema(description = "短剧 ID")
private Long id;
@Schema(description = "编码")
private String code;
@Schema(description = "标题")
private String title;
@Schema(description = "副标题")
private String subtitle;
@Schema(description = "分类 ID")
private Long categoryId;
@Schema(description = "分类名称")
private String category;
@Schema(description = "题材")
private String genre;
@Schema(description = "简介")
private String description;
@Schema(description = "封面地址")
private String cover;
/** 整剧预告片地址 */
@Schema(description = "预告片地址")
private String trailerUrl;
@Schema(description = "语言")
private String language;
@Schema(description = "总集数")
private Integer episodes;
@Schema(description = "免费集数")
private Integer freeEpisodes;
@Schema(description = "解锁金币")
private Integer unlockCoin;
@Schema(description = "是否热门")
private Boolean isHot;
@Schema(description = "状态")
private String status;
@Schema(description = "状态文本")
private String statusText;
@Schema(description = "播放量")
private Long views;
@Schema(description = "排序")
private Integer sort;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "发布时间")
private LocalDateTime publishAt;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间")
private LocalDateTime createdAt;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "更新时间")
private LocalDateTime updatedAt;
}
@@ -2,6 +2,7 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
@@ -9,19 +10,31 @@ import lombok.Data;
public class DramaSaveReqVO {
@NotBlank(message = "请填写短剧名称")
@Schema(description = "短剧名称")
private String title;
@Schema(description = "副标题")
private String subtitle;
@Schema(description = "分类 ID")
private Long categoryId;
@Schema(description = "题材")
private String genre;
@Schema(description = "简介")
private String description;
@Schema(description = "封面地址")
private String cover;
/** 整剧预告片地址(复用已有的 drama.trailer_url 列) */
@Schema(description = "预告片地址")
private String trailerUrl;
@Schema(description = "语言")
private String language;
@Schema(description = "免费集数")
private Integer freeEpisodes;
@Schema(description = "解锁金币")
private Integer unlockCoin;
/** 是否热门 */
@Schema(description = "是否热门")
private Boolean isHot;
@Schema(description = "排序")
private Integer sort;
}
@@ -2,11 +2,13 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class DramaStatusReqVO {
/** 驳回原因,其他动作可空 */
@Schema(description = "驳回原因")
private String reason;
}
@@ -2,24 +2,39 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Data
public class EpisodeRespVO {
@Schema(description = "剧集 ID")
private Long id;
@Schema(description = "短剧 ID")
private Long dramaId;
@Schema(description = "集号")
private Integer number;
@Schema(description = "标题")
private String title;
/** 展示用时长,mm:ss */
@Schema(description = "展示时长(mm:ss)")
private String duration;
@Schema(description = "时长(秒)")
private Integer durationSec;
@Schema(description = "封面地址")
private String cover;
@Schema(description = "视频地址")
private String videoUrl;
@Schema(description = "是否免费")
private Boolean isFree;
@Schema(description = "解锁金币")
private Integer unlockCoin;
@Schema(description = "状态")
private String status;
@Schema(description = "状态文本")
private String statusText;
@Schema(description = "播放量")
private Long views;
@Schema(description = "排序")
private Integer sort;
}
@@ -2,6 +2,7 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@@ -9,17 +10,27 @@ import lombok.Data;
public class EpisodeSaveReqVO {
@NotNull(message = "请选择所属短剧")
@Schema(description = "短剧 ID")
private Long dramaId;
@NotNull(message = "请填写集号")
@Schema(description = "集号")
private Integer number;
@Schema(description = "标题")
private String title;
@Schema(description = "时长(秒)")
private Integer durationSec;
@Schema(description = "封面地址")
private String cover;
@Schema(description = "视频地址")
private String videoUrl;
@Schema(description = "是否免费")
private Boolean isFree;
@Schema(description = "解锁金币")
private Integer unlockCoin;
@Schema(description = "状态")
private String status;
@Schema(description = "排序")
private Integer sort;
}
@@ -2,6 +2,7 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
@@ -11,5 +12,6 @@ import java.util.List;
public class EpisodeSortReqVO {
@NotEmpty(message = "请提供排序后的剧集 ID 列表")
@Schema(description = "排序后的剧集 ID 列表")
private List<Long> ids;
}
@@ -2,6 +2,7 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@@ -10,24 +11,36 @@ import java.util.List;
@Data
public class PriceRespVO {
@Schema(description = "短剧 ID")
private Long dramaId;
@Schema(description = "免费集数")
private Integer freeEpisodes;
@Schema(description = "解锁金币")
private Integer unlockCoin;
/** 该剧剧集总数 */
@Schema(description = "剧集总数")
private Integer episodeCount;
/** 本次实际发生变化的剧集数 */
@Schema(description = "本次变更剧集数")
private Integer changedCount;
/** 剧集明细:后台定价页要按集展示当前价格与免费状态 */
@Schema(description = "剧集明细")
private List<DramaEpisodePriceVO> episodes;
@Data
public static class DramaEpisodePriceVO {
@Schema(description = "剧集 ID")
private Long episodeId;
@Schema(description = "集号")
private Integer number;
@Schema(description = "标题")
private String title;
@Schema(description = "是否免费")
private Boolean free;
@Schema(description = "解锁金币")
private Integer unlockCoin;
/** 试看秒数,0 = 不限制 */
@Schema(description = "试看秒数")
private Integer previewSeconds;
}
}
@@ -2,6 +2,7 @@
package com.fruitshorts.content.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@@ -10,21 +11,29 @@ import java.util.List;
@Data
public class PriceSaveReqVO {
@Schema(description = "短剧 ID")
private Long dramaId;
/** 整剧免费集数:前 N 集免费,其余按 unlockCoin 收费 */
@Schema(description = "整剧免费集数")
private Integer freeEpisodes;
/** 整剧默认解锁金币(逐集未单独指定时生效) */
@Schema(description = "整剧默认解锁金币")
private Integer unlockCoin;
/** 逐集覆盖,可空;列表里的集优先于整剧默认值 */
@Schema(description = "逐集覆盖配置")
private List<EpisodePrice> episodes;
@Data
public static class EpisodePrice {
@Schema(description = "剧集 ID")
private Long episodeId;
/** 1 免费 / 0 收费 */
@Schema(description = "是否免费")
private Integer isFree;
@Schema(description = "解锁金币")
private Integer unlockCoin;
/** 试看秒数:0 = 不限制(复用 drama_episode.preview_seconds,播放接口已经在下发这个字段) */
@Schema(description = "试看秒数")
private Integer previewSeconds;
}
}