20240115-ljl-multiPay
ljl 1 year ago
parent 7b4d02da60
commit 1bedd3ad8a

@ -1,5 +1,7 @@
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;
@ -16,18 +18,18 @@ import lombok.extern.slf4j.Slf4j;
@ExtensionService("batchCreate")
@Slf4j
@AllArgsConstructor
public class BatchCreateService extends SPIBaseService implements ExtensionServiceHandler<BatchCreateParam, BatchCreateData> {
public class BatchCreateService extends SPIBaseService implements ExtensionServiceHandler<BatchCreateParam, JSONObject> {
private DistributionOrderService distributionOrderService;
@Override
public BaseResponse<BatchCreateData> handle(BaseRequest<BatchCreateParam> req) {
public BaseResponse<JSONObject> handle(BaseRequest<BatchCreateParam> req) {
try {
BatchCreateParam param = req.getData();
BatchCreateData data = new BatchCreateData();
distributionOrderService.batchCreate(param, data);
return BaseResponse.<BatchCreateData>builder().success(true).message("success").code("0").data(data).build();
return BaseResponse.<JSONObject>builder().success(true).message("success").code("0").data(JSON.parseObject(JSON.toJSONString(data))).build();
} catch (Exception e) {
return BaseResponse.<BatchCreateData>builder().success(true).message(e.getMessage()).code("100003").build();
return BaseResponse.<JSONObject>builder().success(true).message(e.getMessage()).code("100003").build();
}
}
}

@ -1,5 +1,7 @@
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;
@ -16,18 +18,18 @@ import lombok.extern.slf4j.Slf4j;
@ExtensionService("batchPay")
@Slf4j
@AllArgsConstructor
public class BatchPayService extends SPIBaseService implements ExtensionServiceHandler<BatchPayParam, BatchPayData> {
public class BatchPayService extends SPIBaseService implements ExtensionServiceHandler<BatchPayParam, JSONObject> {
private DistributionOrderService distributionOrderService;
@Override
public BaseResponse<BatchPayData> handle(BaseRequest<BatchPayParam> req) {
public BaseResponse<JSONObject> handle(BaseRequest<BatchPayParam> req) {
try {
BatchPayParam param = req.getData();
BatchPayData data = new BatchPayData();
distributionOrderService.batchPay(param, data);
return BaseResponse.<BatchPayData>builder().success(true).message("success").code("0").data(data).build();
return BaseResponse.<JSONObject>builder().success(true).message("success").code("0").data(JSON.parseObject(JSON.toJSONString(data))).build();
} catch (Exception e) {
return BaseResponse.<BatchPayData>builder().success(true).message(e.getMessage()).code("100003").build();
return BaseResponse.<JSONObject>builder().success(true).message(e.getMessage()).code("100003").build();
}
}
}
Loading…
Cancel
Save