package com.tourism.webadmin.back.model;

import com.baomidou.mybatisplus.annotation.*;
import com.tourism.webadmin.upms.model.SysUser;
import com.tourism.common.core.annotation.*;
import com.tourism.common.core.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Map;

/**
 * 聊天去聊邀请实体对象。
 *
 * @author 吃饭睡觉
 * @date 2024-09-06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "tour_im_group_invitation")
public class TourImGroupInvitation extends BaseModel {

    /**
     * id。
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 聊天群组id。
     */
    @TableField(value = "group_id")
    private Long groupId;

    /**
     * 邀请人id。
     */
    @TableField(value = "inviter")
    private Long inviter;

    /**
     * 被邀请人id。
     */
    @TableField(value = "invitee")
    private Long invitee;

    /**
     * 邀请状态 1待确认 2同意 3不同意。
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 逻辑删除标记字段(1: 正常 -1: 已删除)。
     */
    @TableLogic
    @TableField(value = "data_state")
    private Integer dataState;

    @RelationDict(
            masterIdField = "groupId",
            slaveModelClass = TourImGroup.class,
            slaveIdField = "id",
            slaveNameField = "groupName")
    @TableField(exist = false)
    private Map<String, Object> groupIdDictMap;

    @RelationDict(
            masterIdField = "inviter",
            slaveModelClass = TourUser.class,
            slaveIdField = "userId",
            slaveNameField = "showName")
    @TableField(exist = false)
    private Map<String, Object> inviterDictMap;

    @RelationDict(
            masterIdField = "invitee",
            slaveModelClass = TourUser.class,
            slaveIdField = "userId",
            slaveNameField = "showName")
    @TableField(exist = false)
    private Map<String, Object> inviteeDictMap;

    @RelationGlobalDict(
            masterIdField = "status",
            dictCode = "GroupInvitationStatus")
    @TableField(exist = false)
    private Map<String, Object> statusDictMap;
}
