|
@@ -1,67 +0,0 @@
|
|
|
-package com.zanxiang.sdk.controller;
|
|
|
-
|
|
|
-import com.zanxiang.module.util.JsonUtil;
|
|
|
-import com.zanxiang.module.util.pojo.ResultVO;
|
|
|
-import com.zanxiang.sdk.annotation.UnSignCheck;
|
|
|
-import com.zanxiang.sdk.domain.dto.PlatformOrderDTO;
|
|
|
-import com.zanxiang.sdk.domain.params.ProductPayParam;
|
|
|
-import com.zanxiang.sdk.domain.params.UserData;
|
|
|
-import com.zanxiang.sdk.domain.vo.GameShareVO;
|
|
|
-import com.zanxiang.sdk.service.IOrderPayService;
|
|
|
-import com.zanxiang.sdk.service.IOrderService;
|
|
|
-import com.zanxiang.sdk.service.pay.WxPayService;
|
|
|
-import io.swagger.annotations.Api;
|
|
|
-import io.swagger.annotations.ApiResponse;
|
|
|
-import io.swagger.annotations.ApiResponses;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
-
|
|
|
- * @author : lingfeng
|
|
|
- * @time : 2023-01-18
|
|
|
- * @description :
|
|
|
- */
|
|
|
-@Api(tags = "测试接口")
|
|
|
-@RestController
|
|
|
-@RequestMapping(value = "/api/test")
|
|
|
-public class TestController {
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private WxPayService wxPayService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IOrderService orderService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IOrderPayService orderPayService;
|
|
|
-
|
|
|
- @UnSignCheck
|
|
|
- @GetMapping("/close/order")
|
|
|
- @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameShareVO.class)})
|
|
|
- public ResultVO shareGame(String param) {
|
|
|
- PlatformOrderDTO platformOrderDTO = orderService.getByOrderId(param);
|
|
|
- wxPayService.closeOrder(platformOrderDTO);
|
|
|
- return ResultVO.ok();
|
|
|
- }
|
|
|
-
|
|
|
- @UnSignCheck
|
|
|
- @GetMapping("/pay/order")
|
|
|
- @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameShareVO.class)})
|
|
|
- public ResultVO payOrder() {
|
|
|
- String param = "{\"payWay\":1,\"payDevice\":2,\"productId\":\"0.1元\",\"productName\":\"1元宝\",\"productDesc\":\"充值1元购买100元宝\",\"amount\":0.1,\"serverId\":\"2\",\"serverName\":\"二区\",\"roleId\":\"132\",\"roleName\":\"oHaTi5bsKYQKlbWEHcfr7UWk_Wtk\",\"roleLevel\":1,\"extension\":\"\"}";
|
|
|
- ProductPayParam productPayParam = JsonUtil.toObj(param, ProductPayParam.class);
|
|
|
- UserData userData = UserData.builder()
|
|
|
- .gameId(21L)
|
|
|
- .userId(132L)
|
|
|
- .deviceSystem("android")
|
|
|
- .ip("125.121.234.254")
|
|
|
- .build();
|
|
|
- Map<String, Object> stringObjectMap = orderPayService.payCreate(productPayParam, userData);
|
|
|
- System.out.println("11111111111");
|
|
|
- return ResultVO.ok();
|
|
|
- }
|
|
|
-}
|