package com.dora.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 用户作品管理 DTO
 */
public class UserContentManageDto {

	@Data
	@Schema(description = "分页查询参数")
	public static class PageQuery {
		@Schema(description = "页码", example = "1")
		@Min(1)
		private Integer page = 1;

		@Schema(description = "每页数量", example = "10")
		@Min(1)
		private Integer size = 10;

		@Schema(description = "审核状态(可选：0待审/1通过/2拒绝)")
		private Integer auditStatus;

		@Schema(description = "关键词(标题/描述)")
		private String keyword;
	}

	@Data
	@Schema(description = "视频更新请求")
	public static class VideoUpdateRequest {
		@Schema(description = "标题")
		private String title;

		@Schema(description = "描述")
		private String description;

		@Schema(description = "封面URL")
		private String coverUrl;

		@Schema(description = "分类")
		private String category;

		@Schema(description = "是否公开(0/1)")
		private Integer isPublic;
	}

	@Data
	@Schema(description = "工作流更新请求")
	public static class WorkflowUpdateRequest {
		@Schema(description = "名称")
		private String name;

		@Schema(description = "描述")
		private String description;

		@Schema(description = "封面URL")
		private String coverUrl;

		@Schema(description = "分类")
		private String category;

		@Schema(description = "是否公开(0/1)")
		private Integer isPublic;

		@Schema(description = "查看权限角色(0-3)")
		private Integer fullAccessRole;

		@Schema(description = "复制权限角色(0-3)")
		private Integer copyAccessRole;

		@Schema(description = "价格")
		private BigDecimal price;

		@Schema(description = "是否免费(0/1)")
		private Integer isFree;

		@Schema(description = "工作流核心逻辑JSON字符串")
		private String data;

		@Schema(description = "工作流依赖文件地址（数据包URL，例如OSS地址）")
		private String dataFileUrl;

		@Schema(description = "关联预览视频ID（阿里云VOD视频ID）")
		private String vodVideoId;

		@Schema(description = "关联预览视频ID（兼容前端字段名，与vodVideoId同步）")
		private String videoId;

		@Schema(description = "详情图集（JSON格式存储多张图片URL）")
		private String detailGallery;
	}

	@Data
	@Schema(description = "课程更新请求")
	public static class CourseUpdateRequest {
		@NotNull
		@Schema(description = "课程ID", example = "1")
		private Long id;

		@Schema(description = "标题")
		private String title;

		@Schema(description = "描述")
		private String description;

		@Schema(description = "封面URL")
		private String coverUrl;

		@Schema(description = "详情图集（JSON格式存储多张图片URL）")
		private String detailGallery;

		@Schema(description = "分类")
		private String category;

		@Schema(description = "是否免费(0/1)")
		private Integer isFree;

		@Schema(description = "访问级别(0-3)")
		private Integer level;
	}

	@Data
	@Schema(description = "我的内容统计响应")
	public static class MyStatsResponse {
		@Schema(description = "我的视频总数")
		private Long videoTotal;
		@Schema(description = "我的视频待审数")
		private Long videoPending;
		@Schema(description = "我的视频通过数")
		private Long videoApproved;
		@Schema(description = "我的视频拒绝数")
		private Long videoRejected;

		@Schema(description = "我的工作流总数")
		private Long workflowTotal;
		@Schema(description = "我的工作流待审数")
		private Long workflowPending;
		@Schema(description = "我的工作流通过数")
		private Long workflowApproved;
		@Schema(description = "我的工作流拒绝数")
		private Long workflowRejected;

		@Schema(description = "我的课程总数")
		private Long courseTotal;
		@Schema(description = "我的课程待审数")
		private Long coursePending;
		@Schema(description = "我的课程通过数")
		private Long courseApproved;
		@Schema(description = "我的课程拒绝数")
		private Long courseRejected;
	}
}

