|
@@ -1,5 +1,6 @@
|
|
package com.yonge.cooleshow.student.controller;
|
|
package com.yonge.cooleshow.student.controller;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.huifu.adapay.core.AdapayCore;
|
|
import com.huifu.adapay.core.AdapayCore;
|
|
import com.huifu.adapay.core.util.AdapaySign;
|
|
import com.huifu.adapay.core.util.AdapaySign;
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
|
|
@@ -11,6 +12,8 @@ import com.yonge.cooleshow.common.controller.BaseController;
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
import com.yonge.cooleshow.common.entity.HttpResponseResult;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -26,6 +29,8 @@ import java.util.Map;
|
|
@RequestMapping("/payment")
|
|
@RequestMapping("/payment")
|
|
@Api(value = "付款接口", tags = "付款接口")
|
|
@Api(value = "付款接口", tags = "付款接口")
|
|
public class PaymentController extends BaseController {
|
|
public class PaymentController extends BaseController {
|
|
|
|
+ private final static Logger log = LoggerFactory.getLogger(PaymentController.class);
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private PaymentSdk paymentSdk;
|
|
private PaymentSdk paymentSdk;
|
|
@Autowired
|
|
@Autowired
|
|
@@ -49,10 +54,11 @@ public class PaymentController extends BaseController {
|
|
return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
return failed(HttpStatus.FORBIDDEN, "请登录");
|
|
}
|
|
}
|
|
HttpResponseResult<Map<String, String>> responseResult = paymentSdk.getOpenId(js_code);
|
|
HttpResponseResult<Map<String, String>> responseResult = paymentSdk.getOpenId(js_code);
|
|
- if(responseResult.getStatus()){
|
|
|
|
|
|
+ if (responseResult.getStatus()) {
|
|
Map<String, String> data = responseResult.getData();
|
|
Map<String, String> data = responseResult.getData();
|
|
//绑定到用户表
|
|
//绑定到用户表
|
|
user.setWechatId(data.get("openid"));
|
|
user.setWechatId(data.get("openid"));
|
|
|
|
+ log.info("绑定用户openid,param is {}", JSONObject.toJSONString(user));
|
|
sysUserFeignService.bindOpenId(user);
|
|
sysUserFeignService.bindOpenId(user);
|
|
}
|
|
}
|
|
return responseResult;
|
|
return responseResult;
|