feat: 支付宝提现
parent
2672fc9e33
commit
47717bae9c
|
@ -14,6 +14,8 @@ import com.mcwl.pay.domain.OrderTrade;
|
|||
import com.mcwl.pay.domain.OrderTradeDto;
|
||||
import com.mcwl.pay.service.AliPayService;
|
||||
import com.mcwl.pay.service.OrderTradeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.checkerframework.checker.units.qual.min;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
@ -42,6 +44,7 @@ import java.util.Map;
|
|||
@Controller
|
||||
@RequestMapping("/ali/pay")
|
||||
@Validated
|
||||
@Api(tags = "支付模块")
|
||||
public class AliPayController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
|
@ -61,6 +64,7 @@ public class AliPayController extends BaseController {
|
|||
* @param response 响应
|
||||
* @throws Exception 抛出异常
|
||||
*/
|
||||
@ApiOperation(value = "支付宝绑定")
|
||||
@GetMapping("/generateQrCode")
|
||||
public void generateQrCode(HttpServletResponse response) throws Exception {
|
||||
String scope = "auth_user"; // 需要获取用户信息
|
||||
|
@ -103,7 +107,11 @@ public class AliPayController extends BaseController {
|
|||
*/
|
||||
@Anonymous
|
||||
@PostMapping("/doPay")
|
||||
public void doPay(@RequestBody OrderTradeDto orderTradeDto, HttpServletResponse response) throws Exception {
|
||||
@ApiOperation(value = "支付宝支付")
|
||||
public void doPay(@Valid
|
||||
@RequestBody
|
||||
OrderTradeDto orderTradeDto,
|
||||
HttpServletResponse response) throws Exception {
|
||||
String qrUrl = null;
|
||||
|
||||
String type = orderTradeDto.getType();
|
||||
|
@ -123,6 +131,7 @@ public class AliPayController extends BaseController {
|
|||
@Anonymous
|
||||
@PostMapping("/fetch")
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "提现")
|
||||
public AjaxResult fetch(@Valid
|
||||
@NotNull(message = "提现金额不能为空")
|
||||
Double amount) throws Exception {
|
||||
|
|
|
@ -1,27 +1,39 @@
|
|||
package com.mcwl.pay.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "订单交易信息")
|
||||
public class OrderTradeDto {
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
@ApiModelProperty(value = "商品ID", required = true)
|
||||
@NotNull(message = "商品ID不能为空")
|
||||
private Integer productId;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
@ApiModelProperty(value = "支付金额", required = true)
|
||||
@NotNull(message = "支付金额不能为空")
|
||||
private Double paymentAmount;
|
||||
|
||||
/**
|
||||
* 订单类型 会员member 积分points
|
||||
*/
|
||||
@ApiModelProperty(value = "订单类型 会员member 积分points", required = true)
|
||||
@NotNull(message = "订单类型不能为空")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
@ApiModelProperty(value = "活动id")
|
||||
private Long promotionId;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue