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

This commit is contained in:
YunaiV 2019-04-21 20:12:10 +08:00
parent 14c98ef1c7
commit e0713cda1f
2 changed files with 17 additions and 1 deletions

View File

@ -85,4 +85,12 @@ public class CommonResult<T> implements Serializable {
return !isSuccess(); return !isSuccess();
} }
} @Override
public String toString() {
return "CommonResult{" +
"code=" + code +
", message='" + message + '\'' +
", data=" + data +
'}';
}
}

View File

@ -9,6 +9,8 @@ import cn.iocoder.mall.pay.api.constant.PayChannelEnum;
import cn.iocoder.mall.pay.api.dto.PayTransactionSubmitDTO; import cn.iocoder.mall.pay.api.dto.PayTransactionSubmitDTO;
import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder; import cn.iocoder.mall.user.sdk.context.UserSecurityContextHolder;
import com.alibaba.dubbo.config.annotation.Reference; import com.alibaba.dubbo.config.annotation.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -20,6 +22,8 @@ import java.io.IOException;
@RequestMapping("users/transaction") // TODO 芋艿理论来说是用户无关的这里先酱紫先~ @RequestMapping("users/transaction") // TODO 芋艿理论来说是用户无关的这里先酱紫先~
public class PayTransactionController { public class PayTransactionController {
private Logger logger = LoggerFactory.getLogger(getClass());
@Reference(validation = "true") @Reference(validation = "true")
private PayTransactionService payService; private PayTransactionService payService;
@ -58,6 +62,10 @@ public class PayTransactionController {
// bodyObj.put("webhookId", bodyObj.remove("id")); // bodyObj.put("webhookId", bodyObj.remove("id"));
// String body = bodyObj.toString(); // String body = bodyObj.toString();
CommonResult<Boolean> result = payService.updateTransactionPaySuccess(PayChannelEnum.PINGXX.getId(), sb.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"; return result.isSuccess() ? "success" : "failure";
} }