From 5966258bff8ccbcd16de486e18b0815ce2814b57 Mon Sep 17 00:00:00 2001 From: andy <1042025947@qq.com> Date: Fri, 18 Apr 2025 11:52:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 2 + .../authorization/service/CloudService.java | 2 +- .../service/ResourceService.java | 12 +++--- .../src/main/resources/application.yml | 3 +- .../hd/cloud/service/rpc/ResourceService.java | 11 +++--- .../hd/cloud/service/rpc/WechatService.java | 18 ++++----- .../src/main/resources/application.yml | 5 +-- .../gateway/oauth2/service/WechatService.java | 8 ++-- .../src/main/resources/application.yml | 2 +- .../hd/wechat/service/rpc/CloudService.java | 38 +++++++++---------- .../wechat/service/rpc/ResourceService.java | 17 ++++----- .../src/main/resources/application.yml | 2 +- 12 files changed, 60 insertions(+), 60 deletions(-) diff --git a/admin-server/src/main/resources/application.yml b/admin-server/src/main/resources/application.yml index 4660688..c07022e 100644 --- a/admin-server/src/main/resources/application.yml +++ b/admin-server/src/main/resources/application.yml @@ -28,6 +28,8 @@ spring: serverAddr: 192.168.5.213:8848 username: nacos password: nacos + config: + namespace: ${nacos.namespace:public} discovery: namespace: ${nacos.namespace:public} register-enabled: true diff --git a/authorization-server/src/main/java/com/evotech/hd/authorization/service/CloudService.java b/authorization-server/src/main/java/com/evotech/hd/authorization/service/CloudService.java index 20ac029..7d583ca 100644 --- a/authorization-server/src/main/java/com/evotech/hd/authorization/service/CloudService.java +++ b/authorization-server/src/main/java/com/evotech/hd/authorization/service/CloudService.java @@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam; import java.util.List; -@FeignClient(value = "cloud-server", path = "/cloud") +@FeignClient(name = "${CLOUD-SERVER-API-NAME}", path = "${CLOUD-SERVER-API-PATH}") public interface CloudService { diff --git a/authorization-server/src/main/java/com/evotech/hd/authorization/service/ResourceService.java b/authorization-server/src/main/java/com/evotech/hd/authorization/service/ResourceService.java index c50a0a8..10b6484 100644 --- a/authorization-server/src/main/java/com/evotech/hd/authorization/service/ResourceService.java +++ b/authorization-server/src/main/java/com/evotech/hd/authorization/service/ResourceService.java @@ -16,27 +16,27 @@ import org.springframework.web.bind.annotation.RequestParam; import java.util.List; -@FeignClient(value = "resource-server") +@FeignClient(name = "${RESOURCE-SERVER-API-NAME}", path = "${RESOURCE-SERVER-API-PATH}") public interface ResourceService { - @GetMapping(value = "/resource/user/userbyname", + @GetMapping(value = "/user/userbyname", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result loadUserByName(@RequestParam("uname") String userName); - @PostMapping(value = "/resource/user/userpermbyid", + @PostMapping(value = "/user/userpermbyid", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result userPermById(@NotNull @RequestParam("uid") String userId, @RequestParam("type")Integer type); - @PostMapping(value = "/resource/loginlog/add", + @PostMapping(value = "/loginlog/add", consumes = {MediaType.APPLICATION_JSON_VALUE}) public Result addLoginLog(@RequestBody LogLogin log); - @GetMapping(value = "/resource/logininfo/get", + @GetMapping(value = "/logininfo/get", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result loginInfo(@RequestParam("uid") String uid); - @GetMapping(value = "/resource/user/station",consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE}) + @GetMapping(value = "/user/station",consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE}) public BaseResponse> loadBatteryStation(@RequestParam("uid") String uid); } diff --git a/authorization-server/src/main/resources/application.yml b/authorization-server/src/main/resources/application.yml index 1104965..a042627 100644 --- a/authorization-server/src/main/resources/application.yml +++ b/authorization-server/src/main/resources/application.yml @@ -15,7 +15,8 @@ spring: config: import: - nacos:yt-common.properties?refreshEnabled=true - - nacos:${spring.application.name}.yaml?refreshEnabled=true + - nacos:oauth2-server.yaml?refreshEnabled=true + - nacos:yt-redis.yaml?refreshEnabled=true cloud: nacos: serverAddr: 192.168.5.213:8848 diff --git a/cloud-manage-server/src/main/java/com/evotech/hd/cloud/service/rpc/ResourceService.java b/cloud-manage-server/src/main/java/com/evotech/hd/cloud/service/rpc/ResourceService.java index 76b5842..7f5a8cb 100644 --- a/cloud-manage-server/src/main/java/com/evotech/hd/cloud/service/rpc/ResourceService.java +++ b/cloud-manage-server/src/main/java/com/evotech/hd/cloud/service/rpc/ResourceService.java @@ -1,20 +1,19 @@ package com.evotech.hd.cloud.service.rpc; -import java.util.List; - +import com.evotech.hd.common.core.entity.Result; +import com.evotech.hd.common.core.entity.resource.dict.Dict; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; -import com.evotech.hd.common.core.entity.Result; -import com.evotech.hd.common.core.entity.resource.dict.Dict; +import java.util.List; -@FeignClient(value = "resource-server") +@FeignClient(name = "${RESOURCE-SERVER-API-NAME}", path = "${RESOURCE-SERVER-API-PATH}") public interface ResourceService { - @GetMapping(value = "/resource/dict/listdict", + @GetMapping(value = "/dict/listdict", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result> listDict(@RequestParam String typeCode); diff --git a/cloud-manage-server/src/main/java/com/evotech/hd/cloud/service/rpc/WechatService.java b/cloud-manage-server/src/main/java/com/evotech/hd/cloud/service/rpc/WechatService.java index 589d76e..ad10c14 100644 --- a/cloud-manage-server/src/main/java/com/evotech/hd/cloud/service/rpc/WechatService.java +++ b/cloud-manage-server/src/main/java/com/evotech/hd/cloud/service/rpc/WechatService.java @@ -14,39 +14,39 @@ import com.evotech.hd.common.core.entity.cloud.OrderSwapBattery; import com.evotech.hd.common.core.entity.cloud.OrderSwapBatteryPre; import com.evotech.hd.common.core.entity.cloud.TradeDetail; -@FeignClient(value = "wechat-server") +@FeignClient(name = "${WECHAT-SERVER-API-NAME}", path = "${RESOURCE-SERVER-API-PATH}") public interface WechatService { - @GetMapping(value = "/wechat/xcx/qrcode/get2", + @GetMapping(value = "/xcx/qrcode/get2", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public String getQRCode2(@RequestParam String path, @RequestParam String width, @RequestParam String env_version); - @GetMapping(value = "/wechat/xcx/qrcode/create2", + @GetMapping(value = "/xcx/qrcode/create2", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public String createQRCode2(@RequestParam String path, @RequestParam String width); - @PostMapping(value = "/wechat/gzh/msg/send/preorder2", + @PostMapping(value = "/gzh/msg/send/preorder2", consumes = {MediaType.APPLICATION_JSON_VALUE}) public Result preOrderMessage(@RequestBody OrderSwapBatteryPre osbp); - @PostMapping(value = "/wechat/gzh/msg/send/order", + @PostMapping(value = "/gzh/msg/send/order", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result orderMessage(@ParameterObject OrderSwapBattery osb, @RequestParam Integer templateType); - @PostMapping(value = "/wechat/gzh/msg/send/order2", + @PostMapping(value = "/gzh/msg/send/order2", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result orderMessage2(@RequestParam Integer id, @RequestParam Integer templateType); - @PostMapping(value = "/wechat/gzh/msg/send/recharge", + @PostMapping(value = "/gzh/msg/send/recharge", consumes = {MediaType.APPLICATION_JSON_VALUE}) public Result rechargeMessage(@RequestBody TradeDetail trade, @RequestParam Integer money); - @PostMapping(value = "/wechat/wechatpay/native/prepay", + @PostMapping(value = "/wechatpay/native/prepay", consumes = {MediaType.APPLICATION_JSON_VALUE}) public Result wechatNativePay(@RequestBody NativePayVO prePay); - @GetMapping(value = "/wechat/wechatpay/native/order/query", + @GetMapping(value = "/wechatpay/native/order/query", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result orderQuery(@RequestParam Integer type, @RequestParam String outTradeNo); diff --git a/cloud-manage-server/src/main/resources/application.yml b/cloud-manage-server/src/main/resources/application.yml index dacc441..733a9cc 100644 --- a/cloud-manage-server/src/main/resources/application.yml +++ b/cloud-manage-server/src/main/resources/application.yml @@ -12,7 +12,7 @@ logging: spring: # 服务名称必须带上,不然nacos服务列表中没有,也不会有注册成功的信息 application: - name: cloud-server #${cloud-manage-server:cloud-server} + name: ${cloud-manage-server:cloud-server} jackson: timeZone: GMT+08:00 date-format: yyyy-MM-dd HH:mm:ss @@ -22,8 +22,7 @@ spring: import: - nacos:yt-common.properties?refreshEnabled=true - nacos:cloud-server.yaml?refreshEnabled=true - - + - nacos:yt-redis.yaml?refreshEnabled=true cloud: nacos: serverAddr: 192.168.5.213:8848 diff --git a/gateway-server/src/main/java/com/evotech/hd/gateway/oauth2/service/WechatService.java b/gateway-server/src/main/java/com/evotech/hd/gateway/oauth2/service/WechatService.java index be59ef6..4ddf353 100644 --- a/gateway-server/src/main/java/com/evotech/hd/gateway/oauth2/service/WechatService.java +++ b/gateway-server/src/main/java/com/evotech/hd/gateway/oauth2/service/WechatService.java @@ -1,16 +1,16 @@ package com.evotech.hd.gateway.oauth2.service; -import java.util.Map; - import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; -@FeignClient(value = "wechat-server") +import java.util.Map; + +@FeignClient(name = "${WECHAT-SERVER-API-NAME}", path = "${WECHAT-SERVER-API-PATH}") public interface WechatService { - @PostMapping(value = "/wechat/login/tokenbuild", + @PostMapping(value = "/login/tokenbuild", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Map tokenBuilder(@RequestParam String wuid); diff --git a/gateway-server/src/main/resources/application.yml b/gateway-server/src/main/resources/application.yml index 550c5e9..0084049 100644 --- a/gateway-server/src/main/resources/application.yml +++ b/gateway-server/src/main/resources/application.yml @@ -25,7 +25,7 @@ spring: config: import: - nacos:yt-common.properties?refreshEnabled=true - - nacos:${spring.application.name}.yaml?refreshEnabled=true + - nacos:gateway-server.yaml?refreshEnabled=true cloud: nacos: serverAddr: 192.168.5.213:8848 diff --git a/wechat-server/src/main/java/com/evotech/hd/wechat/service/rpc/CloudService.java b/wechat-server/src/main/java/com/evotech/hd/wechat/service/rpc/CloudService.java index a1327dc..f9970e5 100644 --- a/wechat-server/src/main/java/com/evotech/hd/wechat/service/rpc/CloudService.java +++ b/wechat-server/src/main/java/com/evotech/hd/wechat/service/rpc/CloudService.java @@ -19,78 +19,78 @@ import org.springframework.web.bind.annotation.RequestParam; import java.util.List; import java.util.Map; -@FeignClient(value = "${CLOUD-SERVER-API-NAME}") +@FeignClient(name = "${CLOUD-SERVER-API-NAME}", path = "${CLOUD-SERVER-API-PATH}") public interface CloudService { - @PostMapping(value = "/cloud/order/swap/pre/add", + @PostMapping(value = "/order/swap/pre/add", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result addPre(OrderSwapBatteryPre osbp); - @PostMapping(value = "/cloud/order/swap/pre/cancel", + @PostMapping(value = "/order/swap/pre/cancel", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result cancelPre(@RequestParam Integer id, @RequestParam Integer status); - @GetMapping(value = "/cloud/order/swap/pre/list", + @GetMapping(value = "/order/swap/pre/list", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result> listPre(@SpringQueryMap PageListSwapOrderPreRequest plsopr); - @GetMapping(value = "/cloud/order/swap/list", + @GetMapping(value = "/order/swap/list", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result> list(@SpringQueryMap PageListSwapOrderRequest plsor); - @GetMapping(value = "/cloud/order/swap/step/list", + @GetMapping(value = "/order/swap/step/list", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result> listStep(@RequestParam String orderNo); - @GetMapping(value = "/cloud/batterystation/liststation", + @GetMapping(value = "/batterystation/liststation", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result> listStation(@RequestParam String plateNum); // public Result> listStation(@SpringQueryMap BasePageRequest bpr); - @GetMapping(value = "/cloud/company/companyByCode", + @GetMapping(value = "/company/companyByCode", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result> companyByCode(@RequestParam String ccode); - @GetMapping(value = "/cloud/vehicle/wechatuser/relation/list", + @GetMapping(value = "/vehicle/wechatuser/relation/list", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result> listWechatUserCar(@RequestParam String wuid); - @PostMapping(value = "/cloud/wallet/add", + @PostMapping(value = "/wallet/add", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result addWallet(WalletAccount wa); - @GetMapping(value = "/cloud/wallet/list", + @GetMapping(value = "/wallet/list", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result> listWallet(@RequestParam String ownerId); - @GetMapping(value = "/cloud/wallet/detail/list", + @GetMapping(value = "/wallet/detail/list", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result> listWalletDetail(@SpringQueryMap PageListWalletRequest plwr); - @PostMapping(value = "/cloud/trade/wechatpay/notify", + @PostMapping(value = "/trade/wechatpay/notify", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public void wechatPayNotifyHandle(TradeDetail tradeDetail); - @PostMapping(value = "/cloud/order/swap/wallet/pay", + @PostMapping(value = "/order/swap/wallet/pay", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result walletPay(@RequestParam String orderNo, @RequestParam String wuid, @RequestParam String uname); - @PostMapping(value = "/cloud/wallet/isOpenAccount", + @PostMapping(value = "/wallet/isOpenAccount", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result isOpenAccount( @RequestParam String wuid); - @PostMapping(value = "/cloud/order/swap/startSwap", + @PostMapping(value = "/order/swap/startSwap", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result startSwap( @RequestParam String wuid,String orderId); - @PostMapping(value = "/cloud/order/swap/getStartSwap", + @PostMapping(value = "/order/swap/getStartSwap", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result getStartSwap(@RequestParam String wuid, String orderId); - @PostMapping(value = "/cloud/wallet/getWalleCode", + @PostMapping(value = "/wallet/getWalleCode", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result getWalleCode(@RequestParam String wuid); - @PostMapping(value = "/cloud/wallet/getPayAttach", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) + @PostMapping(value = "/wallet/getPayAttach", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result getPayAttach(@NotBlank String wuid); } diff --git a/wechat-server/src/main/java/com/evotech/hd/wechat/service/rpc/ResourceService.java b/wechat-server/src/main/java/com/evotech/hd/wechat/service/rpc/ResourceService.java index 15e8bf9..ce1948f 100644 --- a/wechat-server/src/main/java/com/evotech/hd/wechat/service/rpc/ResourceService.java +++ b/wechat-server/src/main/java/com/evotech/hd/wechat/service/rpc/ResourceService.java @@ -1,28 +1,27 @@ package com.evotech.hd.wechat.service.rpc; -import java.util.List; - +import com.evotech.hd.common.core.entity.Result; +import com.evotech.hd.common.core.entity.resource.WechatAgreement; +import com.evotech.hd.common.core.entity.resource.WechatSwiper; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; -import com.evotech.hd.common.core.entity.Result; -import com.evotech.hd.common.core.entity.resource.WechatAgreement; -import com.evotech.hd.common.core.entity.resource.WechatSwiper; +import java.util.List; -@FeignClient(value = "resource-server") +@FeignClient(name = "${RESOURCE-SERVER-API-NAME}", path = "${RESOURCE-SERVER-API-PATH}") public interface ResourceService { - @GetMapping(value = "/resource/wechat/agreement/list", + @GetMapping(value = "/wechat/agreement/list", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result> listAgreement(@RequestParam String appid, @RequestParam Integer type, @RequestParam Integer status); - @GetMapping(value = "/resource/wechat/swiper/list", + @GetMapping(value = "/wechat/swiper/list", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result> listSwiper(@RequestParam String appid, @RequestParam Integer type, @RequestParam Integer status); - @GetMapping(value = "/resource/util/ip", + @GetMapping(value = "/util/ip", consumes = {MediaType.APPLICATION_FORM_URLENCODED_VALUE}) public Result getIp(); } diff --git a/wechat-server/src/main/resources/application.yml b/wechat-server/src/main/resources/application.yml index 2341794..79d22fa 100644 --- a/wechat-server/src/main/resources/application.yml +++ b/wechat-server/src/main/resources/application.yml @@ -16,8 +16,8 @@ spring: config: import: - nacos:yt-common.properties?refreshEnabled=true - - nacos:yt-redis.yaml?refreshEnabled=true - nacos:wechat-server.yaml?refreshEnabled=true + - nacos:yt-redis.yaml?refreshEnabled=true cloud: nacos: serverAddr: 192.168.5.213:8848