From e26b29c5eb079f0416f4ab403b86507a6b21f8c6 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 23 Oct 2023 19:22:47 +0800 Subject: [PATCH] =?UTF-8?q?trade=EF=BC=9A=E5=A2=9E=E5=8A=A0=20gateway=20?= =?UTF-8?q?=E8=BD=AC=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yaml | 16 ++++++++++++++++ .../module/member/api/user/MemberUserApi.java | 2 +- .../member/api/user/MemberUserApiImpl.java | 4 ++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/yudao-gateway/src/main/resources/application.yaml b/yudao-gateway/src/main/resources/application.yaml index 3ccb05120..d3ac74eae 100644 --- a/yudao-gateway/src/main/resources/application.yaml +++ b/yudao-gateway/src/main/resources/application.yaml @@ -110,6 +110,19 @@ spring: - Path=/app-api/promotion/** filters: - RewritePath=/app-api/promotion/v3/api-docs, /v3/api-docs + ## trade-server 服务 + - id: trade-admin-api # 路由的编号 + uri: grayLb://trade-server + predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组 + - Path=/admin-api/trade/** + filters: + - RewritePath=/admin-api/trade/v3/api-docs, /v3/api-docs # 配置,保证转发到 /v3/api-docs + - id: trade-app-api # 路由的编号 + uri: grayLb://trade-server + predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组 + - Path=/app-api/trade/** + filters: + - RewritePath=/app-api/trade/v3/api-docs, /v3/api-docs x-forwarded: prefix-enabled: false # 避免 Swagger 重复带上额外的 /admin-api/system 前缀 @@ -142,3 +155,6 @@ knife4j: - name: promotion-server service-name: promotion-server url: /admin-api/promotion/v3/api-docs + - name: trade-server + service-name: trade-server + url: /admin-api/trade/v3/api-docs diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java index 085f004e4..c05eaa9fd 100644 --- a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java @@ -17,7 +17,7 @@ import java.util.Map; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; @FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory = -@Tag(name = "RPC 服务 - 会员用户的") +@Tag(name = "RPC 服务 - 会员用户") public interface MemberUserApi { String PREFIX = ApiConstants.PREFIX + "/user"; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java index 648a02f2a..20ef36473 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java @@ -5,8 +5,8 @@ import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.service.user.MemberUserService; -import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.Collection; @@ -19,7 +19,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; * * @author 芋道源码 */ -@Service +@RestController // 提供 RESTful API 接口,给 Feign 调用 @Validated public class MemberUserApiImpl implements MemberUserApi {