package com.jeesharp.business.modules.setting.vo;

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

import java.util.ArrayList;
import java.util.List;

/**
 * C 端版本发布解析后的视图，供移动端网关组装统一响应。
 *
 * @author jeesharp
 * @since 2026-05-13
 */
@Data
@Schema(description = "C端版本发布视图")
public class ClientAppVersionReleaseView {

    @Schema(description = "主键")
    private String id;

    @Schema(description = "展示版本号")
    private String version;

    @Schema(description = "整型版本号")
    private Integer versionCode;

    @Schema(description = "发布时间")
    private String releaseTime;

    @Schema(description = "版本类型：1-正式版 2-测试版")
    private Integer versionType;

    @Schema(description = "更新类型：1-强制更新 2-可选更新")
    private Integer updateType;

    @Schema(description = "更新说明")
    private UpdateContentView updateContent = new UpdateContentView();

    @Schema(description = "下载地址")
    private String downloadUrl;

    @Schema(description = "最低兼容版本号")
    private String minVersion;

    /**
     * 更新说明分组。
     *
     * @author jeesharp
     * @since 2026-05-13
     */
    @Data
    @Schema(description = "更新说明分组")
    public static class UpdateContentView {
        @Schema(description = "新增")
        private List<String> features = new ArrayList<>();
        @Schema(description = "修复")
        private List<String> fixes = new ArrayList<>();
        @Schema(description = "优化")
        private List<String> improvements = new ArrayList<>();
    }
}
