package io.hmit.modules.meeting.entity;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.annotation.TableName;
import io.hmit.common.entity.BaseEntity;
import io.hmit.modules.meeting.dto.MeetingDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.List;

/**
 * 参会人员
 *
 * @author zsh 408538940@qq.com
 * @since 1.0.0 2020-12-29
 */
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("wl_meeting_staff")
public class WlMeetingStaffEntity extends BaseEntity {
	private static final long serialVersionUID = 1L;

    /**
     * 会议id
     */
	private Long meetingId;
    /**
     * 参会人员id
     */
	private Long userId;
    /**
     * 短信发送状态
     */
	private Integer messageState;
    /**
     * 报名状态
     */
	private Integer registrationState;
    /**
     * 报名时间
     */
	private Date registrationDate;
    /**
     * 更新时间
     */
	private Date updateDate;

	public WlMeetingStaffEntity assembleWlMeetingStaff(Long meetingId,Long userId,Integer registrationState){
		WlMeetingStaffEntity wlMeetingStaffEntity = new WlMeetingStaffEntity();

		wlMeetingStaffEntity.setMeetingId(meetingId);
		wlMeetingStaffEntity.setUserId(userId);
		wlMeetingStaffEntity.setRegistrationState(2);
		wlMeetingStaffEntity.setUpdateDate(new DateTime());
		if (registrationState != null){
			wlMeetingStaffEntity.setRegistrationState(registrationState);
			wlMeetingStaffEntity.setRegistrationDate(new DateTime());
		}
		return wlMeetingStaffEntity;
	}
}
