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.
69 lines
2.1 KiB
69 lines
2.1 KiB
|
2 weeks ago
|
package common.ecommerce.xincang.dto;
|
||
|
|
|
||
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 信仓报文结构。
|
||
|
|
*
|
||
|
|
* <p>字段名以 Apifox「OMS接口文档V2」为准。信仓全局响应外层统一为
|
||
|
|
* {@code {"rst": ..., "errno": 0, "err": "", "trace_id": "..."}},这里只放登录接口用到的部分。
|
||
|
|
* 字段差异只改本类,不动适配器与领域模型。</p>
|
||
|
|
*/
|
||
|
|
public final class XincangDtos {
|
||
|
|
|
||
|
|
private XincangDtos() {
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 登录响应({@code GET /api.login})。
|
||
|
|
*
|
||
|
|
* <p>注意与业务接口不同:登录的 {@code rst} <b>没有</b> {@code code/msg/data} 包裹,
|
||
|
|
* 而是直接给出客户与 token 字段。</p>
|
||
|
|
*/
|
||
|
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||
|
|
public static final class LoginResponse {
|
||
|
|
|
||
|
|
/** 登录结果;业务失败时可能为 null。 */
|
||
|
|
@JsonProperty("rst")
|
||
|
|
public LoginResult rst;
|
||
|
|
|
||
|
|
/** 0 表示成功。 */
|
||
|
|
@JsonProperty("errno")
|
||
|
|
public Integer errno;
|
||
|
|
|
||
|
|
/** 错误描述;成功时为空串。 */
|
||
|
|
@JsonProperty("err")
|
||
|
|
public String err;
|
||
|
|
|
||
|
|
/** 信仓侧链路号。 */
|
||
|
|
@JsonProperty("trace_id")
|
||
|
|
public String traceId;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 登录结果的 {@code rst} 部分。 */
|
||
|
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||
|
|
public static final class LoginResult {
|
||
|
|
|
||
|
|
/** 客户 id。 */
|
||
|
|
@JsonProperty("id")
|
||
|
|
public String customerId;
|
||
|
|
|
||
|
|
/** 回显的 APIKEY,正常等于登录用的 appkey。 */
|
||
|
|
@JsonProperty("api_client_id")
|
||
|
|
public String apiClientId;
|
||
|
|
|
||
|
|
/** 回显的 APISECRET;不需要也不应落盘,仅用于排障时核对身份。 */
|
||
|
|
@JsonProperty("api_client_secret")
|
||
|
|
public String apiClientSecret;
|
||
|
|
|
||
|
|
/** 过期时间,北京时间 {@code yyyy-MM-dd HH:mm:ss}。 */
|
||
|
|
@JsonProperty("token_expire_time")
|
||
|
|
public String tokenExpireTime;
|
||
|
|
|
||
|
|
/** 令牌本体(形如 {@code {D0A7A4FB-...}})。 */
|
||
|
|
@JsonProperty("token")
|
||
|
|
public String token;
|
||
|
|
}
|
||
|
|
}
|