From 50a2773b5a8bbd54cc950ddb8e3bca3d68dc9619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Fri, 27 Sep 2024 15:55:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=B3=BB=E7=BB=9F=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=85=8D=E7=BD=AE=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=BA=97=E9=93=BA=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E9=93=BE=E6=8E=A5=E8=8E=B7=E5=8F=96=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/shop/ShopPayApiController.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/ShopPayApiController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/ShopPayApiController.java index ce36138e..409d34ea 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/ShopPayApiController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/ShopPayApiController.java @@ -31,7 +31,7 @@ import java.util.Map; @RestController @RequiredArgsConstructor @Api(tags = "店铺支付相关接口") -@RequestMapping("/api/shop-pay-api") +@RequestMapping(value = {"/api/shop-pay-api", "/api/shopPayApi"}) public class ShopPayApiController { private final ParamsService paramsService; @@ -39,28 +39,28 @@ public class ShopPayApiController { @GetMapping("getOrderPayUrl") @ApiOperation("获取店铺订单支付URL") @ApiImplicitParams({ - @ApiImplicitParam(name = "orderId", value = "订单id", paramType = "query", required = true, dataType="String") , - @ApiImplicitParam(name = "shopId", value = "店铺id", paramType = "query",required = true, dataType="String") , + @ApiImplicitParam(name = "orderId", value = "订单id", paramType = "query", required = true, dataType = "String"), + @ApiImplicitParam(name = "shopId", value = "店铺id", paramType = "query", required = true, dataType = "String"), }) public ResponseEntity url(@RequestParam Map params) { MapProxy mapProxy = MapProxy.create(params); String shopId = mapProxy.getStr("shopId"); String orderId = mapProxy.getStr("orderId"); try { - if(StrUtil.isBlank(shopId)){ + if (StrUtil.isBlank(shopId)) { throw new BadRequestException("店铺id不能为空"); } - if(StrUtil.isBlank(orderId)){ + if (StrUtil.isBlank(orderId)) { throw new BadRequestException("订单id不能为空"); } String baseUrl = paramsService.getValue(ParamsEnum.SHOP_ORDER_PAY_BASE_URL.name()); String buildUrl = URLUtil.buildQuery(params, Charset.defaultCharset()); String fullUrl = baseUrl.concat("?").concat(buildUrl); return ResponseEntity.ok().body(fullUrl); - }catch (BadRequestException e){ + } catch (BadRequestException e) { return ResponseEntity.badRequest().body(e.getMessage()); - }catch (Exception e){ - log.error("获取店铺订单支付URL异常",e); + } catch (Exception e) { + log.error("获取店铺订单支付URL异常", e); return ResponseEntity.ok().body("获取店铺订单支付URL异常"); } }