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

import com.baomidou.mybatisplus.annotation.TableName;
import com.jeesharp.framework.mybatis.core.dataobject.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * C 端客户端版本发布实体，映射表 {@code cfg_client_app_version}；供小程序/App 检查更新与更新日志列表。
 *
 * @author jeesharp
 * @since 2026-05-13
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("cfg_client_app_version")
@Schema(description = "C端客户端版本发布")
public class CfgClientAppVersion extends BaseEntity<CfgClientAppVersion> {

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

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

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

    /**
     * 版本类型
     *
     * @see com.jeesharp.business.modules.setting.enums.ClientAppVersionTypeEnum
     */
    @Schema(description = "版本类型：1-正式版 2-测试版")
    private Integer versionType;

    /**
     * 更新策略
     *
     * @see com.jeesharp.business.modules.setting.enums.ClientAppVersionUpdateStrategyEnum
     */
    @Schema(description = "更新策略：1-强制更新 2-可选更新")
    private Integer updateType;

    @Schema(description = "适用端 JSON 数组，空数组表示全端")
    private String platformsJson;

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

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

    @Schema(description = "更新说明 JSON")
    private String updateContentJson;

    /**
     * 发布状态
     *
     * @see com.jeesharp.business.modules.setting.enums.ClientAppVersionStatusEnum
     */
    @Schema(description = "状态：0-草稿 1-已发布 2-已下线")
    private Integer status;
}
