package com.sonic.common.rpc;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author code
 */
@Getter
@AllArgsConstructor
public enum GlobalResultCode implements ApiResultCode {

    /**
     * 前 4 位为服务id，全局 id 为 "0000"，errorCode 的区间范围在 0000 -> 9999
     */
    SYSTEM_EXCEPTION("00000000", "Internal error, please try again later"),
    INVALID_PARAMS("00000001", "Invalid parameters"),
    NETWORK_FAILURE("00000003", "Network failure"),

    EVENT_HANDLED_TIMEOUT("00000009", "事件处理耗时太长"),
    ;

    /** 全局app默认是0000 **/
    public static final String GLOBAL_APP_ID = "0000";

    private String errorCode;
    private String errorMsg;

    @Override
    public String getAppId() {
        return GLOBAL_APP_ID;
    }
}
