package com.dora.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 工作流视频播放DTO
 */
@Data
@Schema(description = "工作流视频播放")
public class WorkflowVideoPlayDto {

    @Data
    @Schema(description = "获取工作流视频播放凭证请求")
    public static class GetPlayAuthRequest {
        @Schema(description = "工作流ID")
        private Long workflowId;

        @Schema(description = "播放凭证过期时间（秒）", example = "3600")
        private Long authInfoTimeout;
    }

    @Data
    @Schema(description = "播放凭证响应")
    public static class PlayAuthResponse {
        @Schema(description = "播放凭证")
        private String playAuth;

        @Schema(description = "请求ID")
        private String requestId;

        @Schema(description = "视频元信息")
        private VideoMeta videoMeta;

        @Schema(description = "用户权限信息")
        private UserPermissionInfo userPermission;
    }

    @Data
    @Schema(description = "视频元信息")
    public static class VideoMeta {
        @Schema(description = "阿里云VOD视频ID")
        private String vodVideoId;

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

        @Schema(description = "视频时长(秒)")
        private Float duration;

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

        @Schema(description = "视频状态")
        private String status;

        @Schema(description = "文件大小")
        private Long size;
    }

    @Data
    @Schema(description = "用户权限信息")
    public static class UserPermissionInfo {
        @Schema(description = "用户角色")
        private Integer userRole;

        @Schema(description = "用户角色名称")
        private String userRoleName;

        @Schema(description = "工作流要求的最低级别")
        private Integer requiredLevel;

        @Schema(description = "是否有播放权限")
        private Boolean hasPermission;

        @Schema(description = "权限检查时间")
        private LocalDateTime checkTime;
    }
}