新增1688店铺解绑spi
parent
2a7efea444
commit
01ed6e46ff
@ -0,0 +1,13 @@
|
|||||||
|
package com.ms.biz.dto.openspi.request;
|
||||||
|
|
||||||
|
import com.doudian.open.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class QuerySupplyPlatformBindNameParam {
|
||||||
|
@SerializedName("shop_id")
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
@SerializedName("supply_platform_type")
|
||||||
|
private Long supplyPlatformType;
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.ms.biz.dto.openspi.request;
|
||||||
|
|
||||||
|
import com.doudian.open.core.DoudianOpSpiRequest;
|
||||||
|
import com.doudian.open.core.DoudianOpSpiResponse;
|
||||||
|
import com.ms.biz.dto.openspi.response.QuerySupplyPlatformAuthResponse;
|
||||||
|
|
||||||
|
public class QuerySupplyPlatformBindNameRequest extends DoudianOpSpiRequest<QuerySupplyPlatformBindNameParam> {
|
||||||
|
@Override
|
||||||
|
public Class<? extends DoudianOpSpiResponse<?>> getResponseClass() {
|
||||||
|
return QuerySupplyPlatformAuthResponse.class;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.ms.biz.dto.openspi.request;
|
||||||
|
|
||||||
|
import com.doudian.open.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UnbindParam {
|
||||||
|
@SerializedName("shop_id")
|
||||||
|
private Long shopId;
|
||||||
|
|
||||||
|
@SerializedName("supply_platform_type")
|
||||||
|
private Long supplyPlatformType;
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
package com.ms.biz.dto.openspi.request;
|
||||||
|
|
||||||
|
import com.doudian.open.core.DoudianOpSpiRequest;
|
||||||
|
import com.doudian.open.core.DoudianOpSpiResponse;
|
||||||
|
import com.ms.biz.dto.openspi.response.UnbindResponse;
|
||||||
|
|
||||||
|
public class UnbindRequest extends DoudianOpSpiRequest<UnbindParam> {
|
||||||
|
@Override
|
||||||
|
public Class<? extends DoudianOpSpiResponse<?>> getResponseClass() {
|
||||||
|
return UnbindResponse.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.ms.biz.dto.openspi.response;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.annotation.JSONField;
|
||||||
|
import com.doudian.open.gson.annotations.SerializedName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class QuerySupplyPlatformBindNameData {
|
||||||
|
@JSONField(name = "bind_name")
|
||||||
|
@SerializedName("bind_name")
|
||||||
|
private String bindName;
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
package com.ms.biz.dto.openspi.response;
|
||||||
|
|
||||||
|
import com.doudian.open.core.DoudianOpSpiResponse;
|
||||||
|
|
||||||
|
public class QuerySupplyPlatformBindNameResponse extends DoudianOpSpiResponse<QuerySupplyPlatformBindNameData> {
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.ms.biz.dto.openspi.response;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UnbindData {
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
package com.ms.biz.dto.openspi.response;
|
||||||
|
|
||||||
|
import com.doudian.open.core.DoudianOpSpiResponse;
|
||||||
|
|
||||||
|
public class UnbindResponse extends DoudianOpSpiResponse<UnbindData> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.ms.biz.spi.callback;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jinritemai.cloud.base.api.BaseRequest;
|
||||||
|
import com.jinritemai.cloud.base.api.BaseResponse;
|
||||||
|
import com.jinritemai.cloud.base.api.ExtensionService;
|
||||||
|
import com.jinritemai.cloud.base.api.ExtensionServiceHandler;
|
||||||
|
import com.ms.biz.common.SPIBaseService;
|
||||||
|
import com.ms.biz.dto.openspi.request.QuerySupplyPlatformBindNameParam;
|
||||||
|
import com.ms.biz.dto.openspi.response.QuerySupplyPlatformBindNameData;
|
||||||
|
import com.ms.biz.service.ShopService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@ExtensionService("querySupplyPlatformBindName")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QuerySupplyPlatformBindNameService extends SPIBaseService implements ExtensionServiceHandler<QuerySupplyPlatformBindNameParam, JSONObject> {
|
||||||
|
private ShopService shopService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaseResponse<JSONObject> handle(BaseRequest<QuerySupplyPlatformBindNameParam> req) {
|
||||||
|
try {
|
||||||
|
QuerySupplyPlatformBindNameParam param = req.getData();
|
||||||
|
QuerySupplyPlatformBindNameData data = new QuerySupplyPlatformBindNameData();
|
||||||
|
shopService.querySupplyPlatformBindName(param, data);
|
||||||
|
return BaseResponse.<JSONObject>builder().success(true).message("success").code("0").data(JSON.parseObject(JSON.toJSONString(data))).build();
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
return BaseResponse.<JSONObject>builder().success(true).message(e.getMessage()).code("100003").build();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
log.error("querySupplyPlatformBindName error", e);
|
||||||
|
return BaseResponse.<JSONObject>builder().success(true).message("系统异常").code("100003").build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package com.ms.biz.spi.callback;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jinritemai.cloud.base.api.BaseRequest;
|
||||||
|
import com.jinritemai.cloud.base.api.BaseResponse;
|
||||||
|
import com.jinritemai.cloud.base.api.ExtensionService;
|
||||||
|
import com.jinritemai.cloud.base.api.ExtensionServiceHandler;
|
||||||
|
import com.ms.biz.common.SPIBaseService;
|
||||||
|
import com.ms.biz.dto.openspi.request.QuerySupplyPlatformBindNameParam;
|
||||||
|
import com.ms.biz.dto.openspi.request.UnbindParam;
|
||||||
|
import com.ms.biz.dto.openspi.response.QuerySupplyPlatformBindNameData;
|
||||||
|
import com.ms.biz.dto.openspi.response.UnbindData;
|
||||||
|
import com.ms.biz.service.ShopService;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@ExtensionService("unbind")
|
||||||
|
@Slf4j
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UnbindService extends SPIBaseService implements ExtensionServiceHandler<UnbindParam, JSONObject> {
|
||||||
|
private ShopService shopService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaseResponse<JSONObject> handle(BaseRequest<UnbindParam> req) {
|
||||||
|
try {
|
||||||
|
UnbindParam param = req.getData();
|
||||||
|
UnbindData data = new UnbindData();
|
||||||
|
shopService.unbind(param);
|
||||||
|
return BaseResponse.<JSONObject>builder().success(true).message("success").code("0").data(JSON.parseObject(JSON.toJSONString(data))).build();
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
return BaseResponse.<JSONObject>builder().success(true).message(e.getMessage()).code("100003").build();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
log.error("querySupplyPlatformBindName error", e);
|
||||||
|
return BaseResponse.<JSONObject>builder().success(true).message("系统异常").code("100003").build();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue