package com.linkwechat.wecom.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linkwechat.common.core.domain.BaseEntity;
import com.linkwechat.common.utils.SnowFlakeUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.experimental.SuperBuilder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * @Author: Robin
 * @Description:
 * @Date: create in 2020/9/21 0021 23:56
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel
@Data
@TableName("we_group_member")
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
public class WeGroupMember extends BaseEntity{
    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty(value = "企业id")
    @TableField(value = "corp_id")
    private String corpId;

    @ApiModelProperty(value = "群聊id")
    @NotBlank(message = "群聊id不能为空")
    @TableField(value = "chat_id")
    private String chatId;

    @TableField(exist = false)
    private String memberName;

    @ApiModelProperty(value = "加入时间")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @TableField(value = "join_time")
    private Date joinTime;

    /**入群方式: 1 - 由成员邀请入群（直接邀请入群) ;   2 - 由成员邀请入群（通过邀请链接入群）;  3 - 通过扫描群二维码入群 */
    @ApiModelProperty(value = "入群方式: 1 - 由成员邀请入群（直接邀请入群) ;   2 - 由成员邀请入群（通过邀请链接入群）;  3 - 通过扫描群二维码入群")
    @TableField(value = "join_scene")
    private Integer joinScene;

    @ApiModelProperty(value = "成员类型:1 - 企业成员;2 - 外部联系人")
    @TableField(value="type")
    private Integer type;

    @ApiModelProperty(value = "群成员id")
    @TableField(value="user_id")
    private String userId;

    @ApiModelProperty(value = "外部联系人在微信开放平台的唯一身份标识")
    @TableField(value="union_id")
    private String unionId;

}
