package org.dromara.work.domain.vo;

import org.dromara.system.domain.vo.SysUserVo;
import org.dromara.work.domain.TpMessage;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

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



/**
 * 消息视图对象 tp_message
 *
 * @author Maosw
 * @date 2025-04-18
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = TpMessage.class)
public class TpMessageVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 消息ID
     */
    @ExcelProperty(value = "消息ID")
    private Long id;

    /**
     * 发送者ID
     */
    @ExcelProperty(value = "发送者ID")
    private Long userId;

    /**
     * 接收者ID
     */
    @ExcelProperty(value = "接收者ID")
    private Long toUserId;

    /**
     * 订单ID
     */
    @ExcelProperty(value = "订单ID")
    private Long orderId;

    /**
     * 订单编号
     */
    @ExcelProperty(value = "订单编号")
    private String orderNum;

    /**
     * 作品ID
     */
    @ExcelProperty(value = "作品ID")
    private Long pictureId;

    /**
     * 消息内容
     */
    @ExcelProperty(value = "消息内容")
    private String content;

    /**
     * 消息类型  1-订单消息  2-互动消息
     */
    @ExcelProperty(value = "消息类型  1-订单消息  2-互动消息")
    private Integer type;

    /**
     * 消息状态（1-已发送，2-已读）
     */
    @ExcelProperty(value = "消息状态", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "1=-已发送，2-已读")
    private Integer status;

    /**
     * 创建时间
     */
    @ExcelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;

    /**
     * 发送者用户对象
     */
    private SysUserVo user;

    /**
     * 接收者用户对象
     */
    private SysUserVo toUser;


}
