package com.kym.common.constant;

import com.kym.common.exception.BusinessExceptionAssert;
import lombok.Getter;

/**
 * 返回码信息
 *
 * @author skyline
 */
@Getter
public enum ResponseEnum implements BusinessExceptionAssert {
    SUCCESS(200, "ok"),
    FAILED(500, "failed"),

    HTTP_STATUS_200(200, "ok"),
    HTTP_STATUS_202(202, "accepted"),
    HTTP_STATUS_400(400, "request error"),
    HTTP_STATUS_401(401, "no authentication"),
    HTTP_STATUS_403(403, "no authorities"),
    HTTP_STATUS_500(500, "server error"),

    DB_ERROR(999, "数据异常"),
    PARAMS_ERROR(1000, "参数异常"),


    // 微信小程序
    WX_MP_LOGIN_ERROR(301, "微信登录异常"),

    // 微信支付
    WX_PAY_AMOUNT_ERROR(300001,"微信支付金额异常"),

    // 登录 权限
    LOGIN_FAILED(10001, "用户名或密码错误"),
    NO_PERMISSION(10002, "无访问权限");

    private final Integer code;
    private final String message;

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