提交 e0713cda authored 作者: YunaiV's avatar YunaiV

后端:pingxx 回调接口,增加错误日志

上级 14c98ef1
......@@ -85,4 +85,12 @@ public class CommonResult<T> implements Serializable {
return !isSuccess();
}
@Override
public String toString() {
return "CommonResult{" +
"code=" + code +
", message='" + message + '\'' +
", data=" + data +
'}';
}
}
......@@ -9,6 +9,8 @@ import cn.iocoder.mall.pay.api.constant.PayChannelEnum;
import cn.iocoder.mall.pay.api.dto.PayTransactionSubmitDTO;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
......@@ -20,6 +22,8 @@ import java.io.IOException;
@RequestMapping("users/transaction") // TODO 芋艿,理论来说,是用户无关的。这里先酱紫先~
public class PayTransactionController {
private Logger logger = LoggerFactory.getLogger(getClass());
@Reference(validation = "true")
private PayTransactionService payService;
......@@ -58,6 +62,10 @@ public class PayTransactionController {
// bodyObj.put("webhookId", bodyObj.remove("id"));
// String body = bodyObj.toString();
CommonResult<Boolean> result = payService.updateTransactionPaySuccess(PayChannelEnum.PINGXX.getId(), sb.toString());
if (result.isError()) {
logger.error("[pingxxSuccess][message({}) result({})]", sb, result);
return "failure";
}
return result.isSuccess() ? "success" : "failure";
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论