package com.abbidot.baselibrary.network.exception

import androidx.annotation.IntDef

@IntDef(
    ErrorCode.OK,
    ErrorCode.UNAUTHORIZED,
    ErrorCode.CUSTOM_FIRST,
    ErrorCode.VALUE_IS_NULL,
    ErrorCode.DEVICE_RENEWAL,
    ErrorCode.TOKEN_OVERDUE,
    ErrorCode.USER_PASSWORD_ERROR,
    ErrorCode.VERIFY_CODE_ERROR,
    ErrorCode.VERIFY_CODE_EXPIRE,
    ErrorCode.REGISTER_FAIL,
    ErrorCode.USER_NO_EXIST,
    ErrorCode.USER_HAS_EXIST,
    ErrorCode.EMAIL_FORMAT_ERROR,
    ErrorCode.NO_SHARE_MYSELF,
    ErrorCode.DEVICE_HAS_BOUND,
    ErrorCode.DEVICE_HAS_BIND,
    ErrorCode.DEVICE_NOT_EXIST
)
@Retention(AnnotationRetention.SOURCE)
annotation class ErrorCode {
    companion object {
        const val OK = 200
        const val ERROR = 500
        const val UNAUTHORIZED = 401
        const val CUSTOM_FIRST = 600
        const val VALUE_IS_NULL = CUSTOM_FIRST + 1

        //505-注册成功  507-登录成功
        //设备已过期,请续费
        const val DEVICE_RENEWAL = 501

        //TOKEN失效或者过期
        const val TOKEN_OVERDUE = 502

        //503-用户名或密码错误
        const val USER_PASSWORD_ERROR = 503

        //504-验证码错误
        const val VERIFY_CODE_ERROR = 504

        //511-验证码已过期
        const val VERIFY_CODE_EXPIRE = 511

        //506-注册失败
        const val REGISTER_FAIL = 506

        //508-用户不存在
        const val USER_NO_EXIST = 508

        //509-用户已存在
        const val USER_HAS_EXIST = 509

        // 510-邮箱格式不对
        const val EMAIL_FORMAT_ERROR = 510

        //不能分享给自己
        const val NO_SHARE_MYSELF = 512

        //513 当前用户已经绑定该设备
        const val DEVICE_HAS_BOUND = 513

        //514 设备已经存在,已绑定
        const val DEVICE_HAS_BIND = 514

        //515 设备未存在
        const val DEVICE_NOT_EXIST = 515

        //信用卡支付成功
        const val CREDIT_CARD_PAY_SUCCESS = 1

        //信用卡支付失败
        const val CREDIT_CARD_PAY_FAIL = 2
    }
}