All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.com.antcloud.api.common.SDKConstants Maven / Gradle / Ivy

Go to download

Ant Fin Tech API SDK For Java Copyright (c) 2015-present Alipay.com, https://www.alipay.com

The newest version!
/*
 * Copyright (c) 2015-present Alipay.com, https://www.alipay.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.com.antcloud.api.common;

import java.nio.charset.Charset;

/**
 * 常量
 */
public class SDKConstants {

    public static final String BASE_SDK_VERSION_VALUE         = "4.0.8";
    public static final String  DEFAULT_CHARSET               = "UTF-8";
    public static final Charset SIGN_CHARSET                  = Charset.forName("UTF-8");
    public static final String  DEFAULT_SIGN_TYPE             = "HmacSHA1";
    public static final String  DEFAULT_ENCRYPTION_VERSION    = "1.0";
    public static final String  DEFAULT_SIGN_KEY_VERSION      = "1.0";
    public static final String  SIGN_TYPE_SHA256              = "HmacSHA256";
    public static final String  BASE64URL                     = "antcloud-base64://";
    public static final String  TRUE                          = "true";
    public static final String URI_DELIMITER                 = "/";

    /**
     * 参数key
     */
    public static class ParamKeys {
        public static final String RESPONSE               = "response";
        public static final String REQ_MSG_ID             = "req_msg_id";
        public static final String RESULT_CODE            = "result_code";
        public static final String RESULT_MSG             = "result_msg";
        public static final String RESULT_MSG_PLACEHOLDER = "result_msg_placeholder";
        public static final String RESULT_MSG_ARGS        = "result_msg_args";
        public static final String REQ_BIZ_ID             = "req_biz_id";
        public static final String AUTH_TOKEN             = "auth_token";
        public static final String PROD_CODE              = "prod_code";
        public static final String CHANNEL                = "channel";
        public static final String SIGN_TYPE              = "sign_type";
        public static final String SIGN                   = "sign";
        public static final String REQ_TIME               = "req_time";
        public static final String BASE_SDK_VERSION       = "base_sdk_version";
        public static final String SDK_VERSION            = "sdk_version";
        public static final String METHOD                 = "method";
        public static final String VERSION                = "version";
        public static final String ACCESS_KEY             = "access_key";
        public static final String SECURITY_TOKEN         = "security_token";
        public static final String PRODUCT_INSTANCE_ID    = "product_instance_id";
        public static final String REGION_NAME            = "region_name";
        public static final String INVOKER_USER           = "invoker.user";
        public static final String INTERNAL_API           = "internal_api";
        public static final String CONTENT_TYPE           = "content_type";
        public static final String ENCRYPT                = "encrypt";
        public static final String SYMMETIC_KEY           = "symmetic_key";
        public static final String ENCRYPTION_VERSION     = "encryption_version";
        public static final String SIGN_KEY_VERSION       = "sign_key_version";
        public static final String _PROD_CODE             = "_prod_code";

        /**
         * 适配大安全服务需要的key
         */
        public static final String SECURITY_RESULT_STATUS = "resultStatus";
        public static final String SECURITY_RESPONSE      = "result";
        public static final String SECURITY_RESULT_CODE   = "resultCode";
        public static final String SECURITY_RESULT_MSG    = "resultMessage";
    }

    /**
     * 结果码
     */
    public static class ResultCodes {
        public static final String OK                = "OK";
        public static final String MISSING_PARAMETER = "MISSING_PARAMETER";
        public static final String INVALID_PARAMETER = "INVALID_PARAMETER";
        public static final String TRANSPORT_ERROR   = "TRANSPORT_ERROR";
        public static final String PARSE_URL_ERROR   = "PARSE_URL_ERROR";
        public static final String RESPONSE_FORMAT_ERROR   = "RESPONSE_FORMAT_ERROR";
        public static final String BAD_SIGNATURE     = "INVALID_RESPONSE_SIGNATURE";
        public static final String UNKNOWN_ERROR     = "UNKNOWN_ERROR";
        public static final String ACCESS_DENIED     = "ACCESS_DENIED";
        public static final String METHOD_NOT_FOUND  = "METHOD_NOT_FOUND";
    }

    /**
     * 国际化网关头文件key
     */
    public static class GlobalHeaderKeys {
        public static final String GLOBAL_HEADER_PRODUCT_INSTANCE_ID = "X-AntCloud-Product-Instance-Id";
        public static final String GLOBAL_HEADER_REQ_MSG_ID = "X-AntCloud-Req-Msg-Id";
        public static final String GLOBAL_HEADER_METHOD = "X-AntCloud-Method";
        public static final String GLOBAL_HEADER_ACCESS_KEY = "X-AntCloud-Access-Key";
        public static final String GLOBAL_HEADER_SIGN = "X-AntCloud-Sign";
        public static final String GLOBAL_HEADER_SIGN_TYPE = "X-AntCloud-Sign-Type";
        public static final String GLOBAL_HEADER_CHARSET = "X-AntCloud-Charset";
        public static final String GLOBAL_HEADER_API_VERSION = "X-AntCloud-Api-Version";
        public static final String GLOBAL_HEADER_SDK_VERSION = "X-AntCloud-SDK-Version";
        public static final String GLOBAL_HEADER_REQ_TIME = "X-AntCloud-Req-Time";
        public static final String GLOBAL_HEADER_REQUEST_TIME = "Request-Time";
        public static final String GLOBAL_HEADER_AUTH_TOKEN = "X-AntCloud-Auth-Token";
        public static final String GLOBAL_HEADER_REGION_NAME = "X-AntCloud-Region-Name";
        public static final String GLOBAL_HEADER_REQ_BIZ_ID = "X-AntCloud-Req-Biz-Id";
        public static final String GLOBAL_HEADER_PROD_CODE = "X-AntCloud-Prod-Code";
        public static final String GLOBAL_HEADER_CHANNEL = "X-AntCloud-Channel";
        public static final String GLOBAL_HEADER_BASE_SDK_VERSION = "X-AntCloud-Base-SDK-Version";
        //国际化sla能力码
        public static final String GLOBAL_HEAGLOBAL_HEADER__PROD_CODE = "X-AntCloud-_Prod-Code";


        //客户透传的压测标,和国内格式统一
        //public static final String GLOBAL_HEADER_LOAD_TEST_MARK = "x-antchain-load-test-mark";
        public static final String GLOBAL_HEADER_LOAD_TEST_MARK = "loadTestMode";

        public static final String GLOBAL_HEADER_LOAD_TEST_UID = "x-antchain-load-test-uid";

        //客户透传的参数
        public static final String GLOBAL_HEADER_GW_EXT_FLAG = "X-AntCloud-Gw-Ext-Flag";
    }

    /**
     * ResultMsgPlaceholders
     */
    public static class ResultMsgPlaceholders {
        // The system providing the API behaves unexpectedly
        public static final String PROVIDER_UNKNOWN_ERROR = "PROVIDER_UNKNOWN_ERROR";
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy