package com.gxwebsoft.app.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 应用版本发布记录
 *
 * @author 科技小王子
 * @since 2026-03-28 21:29:44
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Schema(name = "AppVersion对象", description = "应用版本发布记录")
public class AppVersion implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "自增ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "关联应用ID")
    private Long websiteId;

    @Schema(description = "版本号，如 1.0.0")
    private String versionNo;

    @Schema(description = "版本名称")
    private String versionName;

    @Schema(description = "版本更新说明")
    private String changelog;

    @Schema(description = "安装包地址")
    private String packageUrl;

    @Schema(description = "包大小(字节)")
    private Long packageSize;

    @Schema(description = "包MD5/SHA256")
    private String packageHash;

    @Schema(description = "环境: development/staging/production")
    private String env;

    @Schema(description = "状态 0=构建中 1=已发布 2=已回滚 3=构建失败")
    private Integer status;

    @Schema(description = "是否为当前版本")
    private Boolean isCurrent;

    @Schema(description = "发布人用户ID")
    private Long publishBy;

    @Schema(description = "发布时间")
    private LocalDateTime publishTime;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "排序(数字越小越靠前)")
    private Integer sortNumber;

    @Schema(description = "用户ID")
    private Integer userId;

    @Schema(description = "租户id")
    private Integer tenantId;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

}
