package com.chushang.system.entity.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;
import com.chushang.common.core.web.EnumUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * by zhaowenyuan create 2022/5/19 18:20
 */
@Getter
@AllArgsConstructor
public enum LoginStatusEnum implements IEnum<Integer> {
    LOGIN_SUCCESS(0, "登录成功"),
    LOGOUT_SUCCESS(1, "退出成功"),
    REGISTER_SUCCESS(2, "注册成功"),
    LOGIN_FAIL_STATUS(6, "注销失败"),
    ACCOUNT_EMPTY(3, "登录用户不存在"),
    ACCOUNT_STATUS_ERROR(4, "用户已停用，请联系管理员"),
    ACCOUNT_PASS_ERROR(5,  "用户密码错误"),
    ACCOUNT_TYPE_ERROR(7,  "非平台账号登录"),
    ;

    @JsonValue
    @EnumValue
    private final Integer code;
    private final String desc;

    @Override
    public Integer getValue() {
        return this.code;
    }
}
