package com.gxwebsoft.app.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.gxwebsoft.common.core.config.JsonArrayToStringDeserializer;
import com.gxwebsoft.common.core.config.JsonStringToArraySerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

/**
 * 工单回复
 *
 * @author 科技小王子
 * @since 2026-03-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("app_ticket_reply")
@Schema(name = "AppTicketReply对象", description = "工单回复")
public class AppTicketReply implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "回复ID")
    @TableId(value = "reply_id", type = IdType.AUTO)
    private Long replyId;

    @Schema(description = "关联工单ID")
    private Long ticketId;

    @Schema(description = "回复内容")
    private String content;

    @Schema(description = "附件JSON数组")
    @JsonDeserialize(using = JsonArrayToStringDeserializer.class)
    @JsonSerialize(using = JsonStringToArraySerializer.class)
    private String attachments;

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

    @Schema(description = "回复人昵称（冗余）")
    private String userName;

    @Schema(description = "回复人头像（冗余）")
    private String userAvatar;

    @Schema(description = "是否是技术人员/客服: 0否 1是")
    private Integer isStaff;

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

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