package com.ruoyi.system.user.domain.enums;

import com.ruoyi.common.constants.ServiceCode;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum UserAuthType {
    
    REAL_NAME("1", "实名", ServiceCode.USER_NOT_REAL_NAME),
    DRIVER("2", "驾驶证", ServiceCode.USER_NOT_DRIVER);

    private final String code;
    private final String name;
    private final Integer errorCode;    // 错误码

    public static UserAuthType getByCode(String code) {
        for (UserAuthType type : UserAuthType.values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
