package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 评价表（仅用户可发布）
 *
 * @author system
 * @since 2025-01-XX
 */
@Data
@JsonInclude
@TableName("common_rating")
@ApiModel(value = "CommonRating对象", description = "评价表（仅用户可发布）")
public class CommonRating implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "业务类型：1-商铺评价")
    @TableField("business_type")
    private Integer businessType;

    @ApiModelProperty(value = "业务关联ID：1-商铺ID")
    @TableField("business_id")
    private Integer businessId;

    @ApiModelProperty(value = "评价用户ID（仅普通用户）")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty(value = "评价文字内容")
    @TableField("content")
    private String content;

    @ApiModelProperty(value = "核心评分（0.0-5.0）")
    @TableField("score")
    private Double score;

    @ApiModelProperty(value = "多维度评分：如{\"口味\":5.0,\"服务\":4.0}")
    @TableField(value = "other_score")
    private String otherScore;

    @ApiModelProperty(value = "评价图片URL，多个逗号分隔")
    @TableField("image_urls")
    private String imageUrls;

    @ApiModelProperty(value = "是否匿名：0-否 1-是")
    @TableField("is_anonymous")
    private Integer isAnonymous;

    @ApiModelProperty(value = "是否展示：0-隐藏 1-展示")
    @TableField("is_show")
    private Integer isShow;

    @ApiModelProperty(value = "审核状态：0-待审核 1-通过 2-驳回")
    @TableField("audit_status")
    private Integer auditStatus;

    @ApiModelProperty(value = "点赞数")
    @TableField("like_count")
    private Integer likeCount;

    @ApiModelProperty(value = "评分1")
    @TableField("score_one")
    private Double scoreOne;

    @ApiModelProperty(value = "评分2")
    @TableField("score_two")
    private Double scoreTwo;

    @ApiModelProperty(value = "评分3")
    @TableField("score_three")
    private Double scoreThree;

    @ApiModelProperty(value = "删除标记, 0:未删除, 1:已删除")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID")
    @TableField("created_user_id")
    private Integer createdUserId;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    @ApiModelProperty(value = "修改人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;

    @ApiModelProperty(value = "审核失败原因")
    @TableField(value = "audit_reason")
    private String auditReason;

    @ApiModelProperty(value = "审核拒绝次数")
    @TableField(value = "reject_num")
    private Integer rejectNum;
}

