package com.gxwebsoft.cms.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 轮播项(组内单张图)
 *
 * @author WorkBuddy
 * @since 2026-07-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("cms_banner_item")
@Schema(name = "CmsBannerItem对象", description = "轮播项(组内单张图)")
public class CmsBannerItem implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "轮播项ID")
    @TableId(value = "item_id", type = IdType.AUTO)
    private Integer itemId;

    @Schema(description = "所属轮播组ID")
    private Integer groupId;

    @Schema(description = "图片地址")
    private String image;

    @Schema(description = "单图标题(alt/无障碍)")
    private String title;

    @Schema(description = "单图副标题")
    private String subtitle;

    @Schema(description = "跳转类型: 0无 1外链 2文章 3产品")
    private Integer linkType;

    @Schema(description = "外链地址")
    private String linkUrl;

    @Schema(description = "跳转目标ID(文章/产品)")
    private Integer linkTargetId;

    @Schema(description = "组内排序(越小越靠前)")
    @JsonProperty("sortNum")
    @JSONField(name = "sortNum")
    private Integer sortNumber;

    @Schema(description = "是否删除: 0否 1是")
    @TableLogic
    private Integer deleted;

    @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;
}
