package com.cool.store.enums;

/**
 * @author zhangchenbiao
 * @FileName: JoinInterviewStatusEnum
 * @Description:
 * @date 2024-03-20 11:05
 */
public enum JoinInterviewStatusEnum {

    NO_JOIN(0, "未参加"),
    LINE_JOIN(1,"加盟商先进入"),
    INTERVIEW_JOIN(2,"面试官先进入"),
    JOIN(3,"双方都参加");

    private Integer code;

    private String message;

    JoinInterviewStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static Integer getJoinInterviewStatus(Integer joinInterviewStatus, InterviewUserTypeEnum userType){
        if(NO_JOIN.getCode().equals(joinInterviewStatus)){
            return InterviewUserTypeEnum.LINE.equals(userType) ? LINE_JOIN.getCode() : INTERVIEW_JOIN.getCode();
        }
        if(LINE_JOIN.getCode().equals(joinInterviewStatus)){
            return InterviewUserTypeEnum.LINE.equals(userType) ? LINE_JOIN.getCode() : JOIN.getCode();
        }
        if(INTERVIEW_JOIN.getCode().equals(joinInterviewStatus)){
            return InterviewUserTypeEnum.LINE.equals(userType) ? JOIN.getCode() : INTERVIEW_JOIN.getCode();
        }
        return JOIN.getCode();
    }
}
