package com.fdkankan.common.constant;

public enum ServerCode {

	SUCCESS(0, "操作成功"),
	SYSTEM_ERROR(-1, "服务器异常"),
	PARAM_ERROR(-2, "解析请求参数出错"),
	PARAM_REQUIRED(-3, "缺少必要参数:%s"),
	FEIGN_REQUEST_FAILD(-4, "跨服务请求失败"),
	SERVER_CLOSING(-5, "服务正在关闭！"),

	APP_ID_ILLEGAL(3100, "非法的APP ID");

	private Integer code;
	private String message;

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

	public Integer code() {
		return code;
	}

	public String message() {
		return message;
	}

	public String formatMessage(Object... args) {
		return String.format(message, args);
	}
}
