package com.reptileclient.jlifeapp.result;

/**
 * Created with IntelliJ IDEA.
 * User: ABC
 * Date: 2018/5/23
 * Time: 3:15 PM
 *
 * @author fuxubing
 */
public enum ResponseInfoEnum implements ResponseInfoInterface {

    SUCCESS(200, "ok", "成功"),
    /**
     * 40000
     * The first number "4" is a tag, Means front-end not need processing logic.
     * The middle 2 numbers are the business module code, The "00" meaning the user manager module.
     * The last 2 numbers are the error code.
     */

    ERROR(400, "Error!", "错误!"),
    PASSWORD_INCORRECT(400, "Incorrect password!", "密码不正确!"),
    PHONE_IS_NULL(400, "Phone is null!", "手机号不能为空!"),
    PASSWORD_IS_NULL(400, "Password is null!", "密码不能为空!"),
    TOKEN_INCORRECT_OR_HAS_EXPIRED(60001, "The token is incorrect or has expired!", "token不正确或者已过期!");

    private int code;
    private String message;
    private String messageToUser;

    ResponseInfoEnum(int code, String message, String messageToUser) {
        this.code = code;
        this.message = message;
        this.messageToUser = messageToUser;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public String getMessageToUser() {
        return messageToUser;
    }


}
