package com.xindazhou.business.controller.admin.version.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Schema(description = "管理后台 - 版本管理新增/修改 Request VO")
@Data
public class VersionSaveReqVO {

    @Schema(description = "版本ID", example = "1")
    private Long id;

    @Schema(description = "平台类型：1-安卓，2-鸿蒙，3-iOS", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "平台类型不能为空")
    private Integer platform;

    @Schema(description = "版本号（内部版本号）", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
    @NotNull(message = "版本号不能为空")
    private Integer versionCode;

    @Schema(description = "版本名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1.0.0")
    @NotBlank(message = "版本名称不能为空")
    private String versionName;

    @Schema(description = "版本描述", example = "首个正式版本")
    private String versionDesc;

    @Schema(description = "下载地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://example.com/app-v1.0.0.apk")
    @NotBlank(message = "下载地址不能为空")
    private String downloadUrl;

    @Schema(description = "包大小（字节）", example = "50000000")
    private Long packageSize;

    @Schema(description = "是否强制更新", example = "false")
    private Boolean forceUpdate;

    @Schema(description = "更新日志", example = "1. 修复了已知问题\n2. 优化了用户体验")
    private String updateLog;

    @Schema(description = "状态：0-启用，1-禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
    @NotNull(message = "状态不能为空")
    private Integer status;

    @Schema(description = "发布时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publishTime;

}

