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-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("cms_case")
@Schema(name = "CmsCase对象", description = "客户案例")
public class CmsCase implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "案例ID")
    @TableId(value = "case_id", type = IdType.AUTO)
    private Integer caseId;

    @Schema(description = "案例名称")
    private String caseName;

    @Schema(description = "封面图")
    private String cover;

    @Schema(description = "简介")
    private String summary;

    @Schema(description = "案例详情")
    private String content;

    @Schema(description = "所属行业")
    private String industry;

    @Schema(description = "客户名称")
    private String customer;

    @Schema(description = "使用产品")
    private String productUsed;

    @Schema(description = "状态: 1已发布 0已下线")
    private Integer status;

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

    @Schema(description = "浏览量")
    private Integer views;

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

    @Schema(description = "案例分类ID（关联 cms_navigation.navigation_id，model=case）")
    private Integer categoryId;

    @Schema(description = "案例分类名称（冗余存储，便于列表展示）")
    private String categoryName;

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