|
@@ -1,26 +1,21 @@
|
|
|
package com.miaxis.app.controller.film;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.miaxis.common.config.WxpayConfig;
|
|
|
import com.miaxis.common.constant.Constants;
|
|
|
import com.miaxis.common.core.controller.BaseController;
|
|
|
import com.miaxis.common.core.domain.Response;
|
|
|
import com.miaxis.common.exception.CustomException;
|
|
|
-import com.miaxis.common.utils.SecurityUtils;
|
|
|
import com.miaxis.feign.dto.FilmDTO;
|
|
|
-import com.miaxis.system.service.ISysConfigService;
|
|
|
-import com.miaxis.system.service.ISysDictDataService;
|
|
|
-import com.miaxis.wx.domain.WxOrder;
|
|
|
import com.miaxis.wx.service.IWxOrderService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
-import io.swagger.annotations.ApiParam;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.http.client.HttpClient;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.util.Arrays;
|
|
@@ -35,37 +30,15 @@ import static com.miaxis.common.constant.Constants.FILM_BLACK_LIST;
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequiredArgsConstructor
|
|
|
-@RequestMapping(Constants.STUDENT_PREFIX+"/wx/wxpay")
|
|
|
+@RequestMapping(Constants.STUDENT_PREFIX+"/film/order")
|
|
|
@Api(tags = {"【小程序-电影】"})
|
|
|
@Slf4j
|
|
|
public class FilmController extends BaseController {
|
|
|
|
|
|
- @Autowired
|
|
|
- private HttpClient httpClient;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private WxpayConfig wxpayConfig;
|
|
|
|
|
|
@Autowired
|
|
|
private IWxOrderService wxOrderService;
|
|
|
|
|
|
- @Autowired
|
|
|
- private ISysConfigService configService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ISysDictDataService dictDataService;
|
|
|
-
|
|
|
- @Value("${app.appid}")
|
|
|
- private String appid;
|
|
|
- @Value("${wxpay.notifyUrl}")
|
|
|
- private String notifyUrl ;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 以form表单形式提交数据,发送post请求
|
|
|
* @explain
|
|
@@ -88,21 +61,7 @@ public class FilmController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 获取电影订单详细信息
|
|
|
- */
|
|
|
- @GetMapping(value = "/{outTradeNo}")
|
|
|
- @ApiOperation("获取电影订单详细信息")
|
|
|
- public Response<WxOrder> getInfo(
|
|
|
- @ApiParam(name = "outTradeNo", value = "电影订单参数", required = true)
|
|
|
- @PathVariable("outTradeNo") String outTradeNo
|
|
|
- ){
|
|
|
- WxOrder wxOrder = wxOrderService.getByOutTradeNo(outTradeNo);
|
|
|
- if (!wxOrder.getOpenid().equals(SecurityUtils.getLoginUser().getStudent().getOpenid())){
|
|
|
- throw new CustomException("该用户无访问此订单权限");
|
|
|
- }
|
|
|
- return Response.success(wxOrder);
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
|
|
|
|