use of com.github.liuweijw.business.pay.domain.PaySendRedpack in project fw-cloud-framework by liuweijw.
the class PaySendRedpackController method sendRedpack.
@RequestMapping(value = "/sendRedpack")
public R<Map<String, Object>> sendRedpack(@RequestBody PaySendRedpackReqBean paySendRedpackReqBean) {
PaySendRedpack paySendRedpack = new PaySendRedpack();
WxPaySendRedpackRequestBuilder wxPaySendRedpackRequestBuilder = WxPaySendRedpackRequest.newBuilder();
R<Boolean> validateResult = validateSendRedpackReqParams(paySendRedpackReqBean, paySendRedpack, wxPaySendRedpackRequestBuilder);
if (!validateResult.getData()) {
log.info(JSON.toJSONString(validateResult));
Map<String, Object> returnMap = PayUtil.makeRetData(PayUtil.makeRetMap(PayConstant.RETURN_VALUE_SUCCESS, validateResult.getMsg(), null, null, null), paySendRedpack.getResKey());
log.info(JSON.toJSONString(returnMap));
return new R<Map<String, Object>>().data(returnMap).failure();
}
return wxSendRedpackService.sendRedpack(paySendRedpack, wxPaySendRedpackRequestBuilder.build());
}
Aggregations