|
@@ -5,6 +5,7 @@ import com.gree.mall.miniapp.annotation.ApiNotAuth;
|
|
|
import com.gree.mall.miniapp.bean.PayDetail;
|
|
|
import com.gree.mall.miniapp.bean.material.*;
|
|
|
import com.gree.mall.miniapp.constant.Constant;
|
|
|
+import com.gree.mall.miniapp.constant.SybConstants;
|
|
|
import com.gree.mall.miniapp.exception.RemoteServiceException;
|
|
|
import com.gree.mall.miniapp.helper.ResponseHelper;
|
|
|
import com.gree.mall.miniapp.logic.material.WebsitSalesLogic;
|
|
@@ -187,17 +188,19 @@ public class MaterialSalesController {
|
|
|
|
|
|
@ApiNotAuth
|
|
|
@GetMapping("/pay")
|
|
|
- @ApiOperation(value = "生成小程序支付")
|
|
|
+ @ApiOperation(value = "生成支付")
|
|
|
public ResponseHelper<PayDetail> websitDefault(
|
|
|
@ApiParam(value = "appOrderId",required = true) @RequestParam String key,
|
|
|
- @ApiParam(value = "openid",required = true) @RequestParam String openid
|
|
|
+ @ApiParam(value = "openid",required = true) @RequestParam String openid,
|
|
|
+ @ApiParam(value = "通联支付类型") @RequestParam(required = false, defaultValue = SybConstants.PAY_TYPE_W06) String payType,
|
|
|
+ @ApiParam(value = "支付完成跳转(必须为https协议地址,且不允许带参数)") @RequestParam(required = false) String frontUrl
|
|
|
) throws RemoteServiceException, InterruptedException {
|
|
|
Lock obtain = redisLockRegistry.obtain(Constant.RedisPrefix.LOCK_ORDER + ":" + key);
|
|
|
if(!obtain.tryLock(10, TimeUnit.SECONDS)){
|
|
|
throw new RemoteServiceException("系统繁忙,请稍后再尝试");
|
|
|
}
|
|
|
try {
|
|
|
- PayDetail pay = websitSalesLogic.generatePayRecord(key, openid);
|
|
|
+ PayDetail pay = websitSalesLogic.generatePayRecord(key, openid, payType, frontUrl);
|
|
|
return ResponseHelper.success(pay);
|
|
|
}finally {
|
|
|
obtain.unlock();
|