You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
151 lines
6.1 KiB
151 lines
6.1 KiB
package common.ecommerce.edayun; |
|
|
|
/** |
|
* 易达云(EDAYUN)协议常量。 |
|
* |
|
* <p>端点与路径是<b>协议的一部分</b>,写在代码里,不做成配置表。 |
|
* 运行时不使用 {@link #PR_BASE_URL}:端点由调用方每次经 |
|
* {@code WarehouseConnection} 传入。</p> |
|
* |
|
* <p><b>待补充</b>:目前只搭了模块骨架,接口路径与鉴权方式等文档到位后再填。 |
|
* 下面带 {@code TODO} 的常量是占位,不要直接用于生产。</p> |
|
*/ |
|
public final class EdayunConstants { |
|
|
|
/** 适配器标识。 */ |
|
public static final String ADAPTER_ID = "edayun"; |
|
|
|
/** |
|
* 测试 / 联调环境基址。 |
|
* |
|
* <p><b>TODO 待核对</b>:等易达云提供测试域名后替换。</p> |
|
*/ |
|
public static final String PR_BASE_URL = "https://test.omniselling.com.cn/saas-service/openapi/microService"; |
|
|
|
/** |
|
* 生产环境基址。 |
|
* |
|
* <p><b>TODO 待核对</b>:测试环境是 {@code test.omniselling.com.cn}, |
|
* 生产域名应以正式文档为准。</p> |
|
*/ |
|
public static final String PRODUCTION_BASE_URL = "TODO"; |
|
|
|
/** 获取 token({@code POST /oauth/token})。 */ |
|
public static final String PATH_TOKEN = "/oauth/token"; |
|
|
|
/** 创建产品({@code POST /webApi/skuInfo/v1/createProduct})。 */ |
|
public static final String PATH_PRODUCT_CREATE = "/webApi/skuInfo/v1/createProduct"; |
|
|
|
/** 创建出库单({@code POST /webApi/order/v1/createOrder})。 */ |
|
public static final String PATH_ORDER_CREATE = "/webApi/order/v1/createOrder"; |
|
|
|
/** 查询出库单信息({@code POST /webApi/order/v1/getOrderInfo})。 */ |
|
public static final String PATH_ORDER_GET = "/webApi/order/v1/getOrderInfo"; |
|
|
|
/** 查询出库单面单({@code POST /webApi/order/v1/getOrderLabel})。 */ |
|
public static final String PATH_ORDER_LABEL = "/webApi/order/v1/getOrderLabel"; |
|
|
|
/** 取消前校验状态({@code POST /webApi/order/v1/checkCancelStatus})。 */ |
|
public static final String PATH_ORDER_CHECK_CANCEL = "/webApi/order/v1/checkCancelStatus"; |
|
|
|
/** 取消订单({@code POST /webApi/order/v1/cancelOrder})。 */ |
|
public static final String PATH_ORDER_CANCEL = "/webApi/order/v1/cancelOrder"; |
|
|
|
/** 库存查询({@code POST /webApi/userSkuStock/v1/queryInventory})。 */ |
|
public static final String PATH_INVENTORY = "/webApi/userSkuStock/v1/queryInventory"; |
|
|
|
/** |
|
* 创建 / 编辑自发入库单 |
|
* ({@code POST /webApi/entryInfo/v1/saveEntrySpontaneousOrder})。 |
|
*/ |
|
public static final String PATH_INBOUND_SAVE = "/webApi/entryInfo/v1/saveEntrySpontaneousOrder"; |
|
|
|
/** |
|
* 按 SKU 查询入库单货箱信息(预报上架信息) |
|
* ({@code POST /webApi/entryInfo/v1/selectEntrySkuGoodsDetail})。 |
|
*/ |
|
public static final String PATH_INBOUND_SKU_DETAIL = |
|
"/webApi/entryInfo/v1/selectEntrySkuGoodsDetail"; |
|
|
|
/** 查询交易明细({@code POST /webApi/accountFlow/list})。 */ |
|
public static final String PATH_ACCOUNT_FLOW = "/webApi/accountFlow/list"; |
|
|
|
/** 查询订单费用明细({@code POST /webApi/order/cost/v1/selectOrderCostInfoList})。 */ |
|
public static final String PATH_ORDER_COST = "/webApi/order/cost/v1/selectOrderCostInfoList"; |
|
|
|
/** 查询仓租费用明细({@code POST /webApi/order/cost/v1/selectUserRentDetailList})。 */ |
|
public static final String PATH_RENT_DETAIL = "/webApi/order/cost/v1/selectUserRentDetailList"; |
|
|
|
/** 费用试算 / 预估({@code POST /webApi/estimate/v1/trial})。 */ |
|
public static final String PATH_FEE_ESTIMATE = "/webApi/estimate/v1/trial"; |
|
|
|
/** 物流增值:签收服务。 */ |
|
public static final String ADD_SERVICE_SIGNATURE = "is_signature"; |
|
|
|
/** 物流增值:保价服务。 */ |
|
public static final String ADD_SERVICE_INSURANCE = "is_insurance"; |
|
|
|
/** 提货类型:平台安排车提货。 */ |
|
public static final int PICKUP_TYPE_PICKUP = 1; |
|
|
|
/** 提货类型:仓库自交货。 */ |
|
public static final int PICKUP_TYPE_DROPOFF = 2; |
|
|
|
/** Content-Type。 */ |
|
public static final String CONTENT_TYPE_JSON = "application/json"; |
|
|
|
/** |
|
* 请求头:{@code Authorization}。 |
|
* |
|
* <p>业务接口用它带 token,格式 {@code Bearer <token>}。实测 PR 环境同时接受 |
|
* 单独的小写 {@code token} 头(见 {@link #HEADER_TOKEN}),但文档写的是 |
|
* {@code Authorization},所以以文档为准。</p> |
|
*/ |
|
public static final String HEADER_AUTHORIZATION = "Authorization"; |
|
|
|
/** |
|
* 请求头:{@code token}(小写)。 |
|
* |
|
* <p>实测 PR 环境接受这个头替代 {@code Authorization}。保留常量供探针使用, |
|
* 业务代码请用 {@link #HEADER_AUTHORIZATION}。</p> |
|
*/ |
|
public static final String HEADER_TOKEN = "token"; |
|
|
|
/** 请求头:appKey。 */ |
|
public static final String HEADER_APP_KEY = "appKey"; |
|
|
|
/** 请求头:毫秒时间戳,5 分钟内有效。 */ |
|
public static final String HEADER_TIMESTAMP = "timestamp"; |
|
|
|
/** 请求头:{@code MD5(body + "." + appSecret)}。 */ |
|
public static final String HEADER_SIGN = "sign"; |
|
|
|
/** 业务码:成功。 */ |
|
public static final int CODE_SUCCESS = 200; |
|
/** 业务码:失败(不重试)。 */ |
|
public static final int CODE_FAILED = 500; |
|
/** 业务码:网关无效(可重试)。 */ |
|
public static final int CODE_GATEWAY_INVALID = 503; |
|
/** 业务码:超时(可重试)。 */ |
|
public static final int CODE_TIMEOUT = 504; |
|
|
|
/** |
|
* token 有效期兜底值(秒)。 |
|
* |
|
* <p><b>待联调确认</b>:文档未写明有效期,先按 2 小时;拿到真实响应后改。</p> |
|
*/ |
|
public static final long DEFAULT_TOKEN_TTL_SECONDS = 2 * 60 * 60L; |
|
|
|
/** 提前刷新秒数:避免临界点过期。 */ |
|
public static final long TOKEN_EARLY_REFRESH_SECONDS = 600L; |
|
|
|
/** |
|
* 限流:每秒许可数。 |
|
* |
|
* <p>易达云未公开限流值,先按保守值处理;确认后再调。</p> |
|
*/ |
|
public static final int PERMITS_PER_SECOND = 2; |
|
|
|
private EdayunConstants() { |
|
} |
|
}
|
|
|