@ -28,7 +28,14 @@ public interface AggregatorCapable extends PlatformAdapter {
@@ -28,7 +28,14 @@ public interface AggregatorCapable extends PlatformAdapter {
@Override
boolean supports ( ChannelAccount account , Capability capability ) ;
/** 子渠道。 */
/ * *
* 子店铺信息 。
*
* < p > 前四个字段用于构造 { @code ChannelAccount } ( { @code platformCode + externalStoreId } )
* 与路由 ; 其余字段是各平台店铺列表接口的原始信息 , 按需取用 。 < / p >
*
* < p > 不支持的字段为 null ; 平台特有的其余字段放 { @link # attributes ( ) } , 键名与平台一致 。 < / p >
* /
final class SubChannel {
private final int platformCode ;
@ -36,11 +43,54 @@ public interface AggregatorCapable extends PlatformAdapter {
@@ -36,11 +43,54 @@ public interface AggregatorCapable extends PlatformAdapter {
private final Platform platform ;
private final String name ;
/** 平台卖家 ID:领星 SC 的 {@code seller_id}、VC 的 {@code seller_id}。 */
private final String sellerId ;
/** 账号名:领星 {@code account_name}。 */
private final String accountName ;
/** 店铺授权状态原值:领星 0 暂停 / 1 正常 / 2 授权异常 / -1 删除。 */
private final Integer status ;
/** 站点简称:领星 {@code region},如 na / eu。 */
private final String region ;
/** 站点名称:领星 {@code region_name},如 北美洲。 */
private final String regionName ;
/** 商城所在国家名称:领星 SC 的 {@code country}。 */
private final String country ;
/** 市场 ID:领星 SC 的 {@code marketplace_id}。 */
private final String marketplaceId ;
/** 站点 ID:领星 {@code mid}。 */
private final Integer marketplaceNum ;
/** 平台特有字段。 */
private final java . util . Map < String , Object > attributes ;
public SubChannel ( int platformCode , String externalStoreId , Platform platform , String name ) {
this ( platformCode , externalStoreId , platform , name ,
null , null , null , null , null , null , null , null ,
java . util . Collections . < String , Object > emptyMap ( ) ) ;
}
private SubChannel ( int platformCode , String externalStoreId , Platform platform , String name ,
String sellerId , String accountName , Integer status ,
String region , String regionName , String country ,
String marketplaceId , Integer marketplaceNum ,
java . util . Map < String , Object > attributes ) {
this . platformCode = platformCode ;
this . externalStoreId = externalStoreId ;
this . platform = platform ;
this . name = name ;
this . sellerId = sellerId ;
this . accountName = accountName ;
this . status = status ;
this . region = region ;
this . regionName = regionName ;
this . country = country ;
this . marketplaceId = marketplaceId ;
this . marketplaceNum = marketplaceNum ;
this . attributes = java . util . Collections . unmodifiableMap (
new java . util . LinkedHashMap < String , Object > ( attributes ) ) ;
}
public static Builder builder ( ) {
return new Builder ( ) ;
}
public int platformCode ( ) {
@ -58,5 +108,131 @@ public interface AggregatorCapable extends PlatformAdapter {
@@ -58,5 +108,131 @@ public interface AggregatorCapable extends PlatformAdapter {
public String name ( ) {
return name ;
}
public String sellerId ( ) {
return sellerId ;
}
public String accountName ( ) {
return accountName ;
}
public Integer status ( ) {
return status ;
}
public String region ( ) {
return region ;
}
public String regionName ( ) {
return regionName ;
}
public String country ( ) {
return country ;
}
public String marketplaceId ( ) {
return marketplaceId ;
}
public Integer marketplaceNum ( ) {
return marketplaceNum ;
}
public java . util . Map < String , Object > attributes ( ) {
return attributes ;
}
public static final class Builder {
private int platformCode ;
private String externalStoreId ;
private Platform platform ;
private String name ;
private String sellerId ;
private String accountName ;
private Integer status ;
private String region ;
private String regionName ;
private String country ;
private String marketplaceId ;
private Integer marketplaceNum ;
private java . util . Map < String , Object > attributes =
java . util . Collections . emptyMap ( ) ;
public Builder platformCode ( int platformCode ) {
this . platformCode = platformCode ;
return this ;
}
public Builder externalStoreId ( String externalStoreId ) {
this . externalStoreId = externalStoreId ;
return this ;
}
public Builder platform ( Platform platform ) {
this . platform = platform ;
return this ;
}
public Builder name ( String name ) {
this . name = name ;
return this ;
}
public Builder sellerId ( String sellerId ) {
this . sellerId = sellerId ;
return this ;
}
public Builder accountName ( String accountName ) {
this . accountName = accountName ;
return this ;
}
public Builder status ( Integer status ) {
this . status = status ;
return this ;
}
public Builder region ( String region ) {
this . region = region ;
return this ;
}
public Builder regionName ( String regionName ) {
this . regionName = regionName ;
return this ;
}
public Builder country ( String country ) {
this . country = country ;
return this ;
}
public Builder marketplaceId ( String marketplaceId ) {
this . marketplaceId = marketplaceId ;
return this ;
}
public Builder marketplaceNum ( Integer marketplaceNum ) {
this . marketplaceNum = marketplaceNum ;
return this ;
}
public Builder attributes ( java . util . Map < String , Object > attributes ) {
this . attributes = attributes = = null
? java . util . Collections . < String , Object > emptyMap ( ) : attributes ;
return this ;
}
public SubChannel build ( ) {
return new SubChannel ( platformCode , externalStoreId , platform , name ,
sellerId , accountName , status , region , regionName , country ,
marketplaceId , marketplaceNum , attributes ) ;
}
}
}
}