|
@@ -1,16 +1,20 @@
|
|
|
package com.miaxis.app.controller.wx;
|
|
|
|
|
|
import com.miaxis.common.core.controller.BaseController;
|
|
|
+import com.miaxis.common.core.domain.Response;
|
|
|
import com.miaxis.common.core.page.ResponsePageInfo;
|
|
|
+import com.miaxis.common.exception.CustomException;
|
|
|
import com.miaxis.common.utils.SecurityUtils;
|
|
|
import com.miaxis.wx.domain.WxExtract;
|
|
|
import com.miaxis.wx.service.IWxExtractService;
|
|
|
+import com.miaxis.wx.service.IWxOrderService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
@@ -29,6 +33,9 @@ public class WxExtractController extends BaseController{
|
|
|
@Autowired
|
|
|
private IWxExtractService wxExtractService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IWxOrderService wxOrderService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询微信提现列表
|
|
|
*/
|
|
@@ -46,6 +53,26 @@ public class WxExtractController extends BaseController{
|
|
|
return toResponsePageInfo(list);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 微信提现
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/withdraw")
|
|
|
+ @ApiOperation("微信提现")
|
|
|
+ public Response getPrepareOrder(Integer amount) throws Exception{
|
|
|
+
|
|
|
+ if (amount == null){
|
|
|
+ throw new CustomException("提现金额不能为空");
|
|
|
+
|
|
|
+ }
|
|
|
+ if (amount > 200 && amount <0){
|
|
|
+ throw new CustomException("提现金额必须在200以内");
|
|
|
+ }
|
|
|
+ wxOrderService.wxwithdrawal(amount);
|
|
|
+ return Response.success();
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|