10.商品服务-新增商品

时间:2021-08-10
本文章向大家介绍10.商品服务-新增商品,主要包括10.商品服务-新增商品使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

1.配置会员模块网关信息

 网关配置

spring:
  cloud:
    gateway:
      routes:
        #商品的路由
        #localhost:88/api/product/category/list/tree--->localhost:10000/product....
        #优先级比下面的哪个路由要高所以要放在上面,不然会被截断
        - id: product_route
          uri: lb://gulimall-product
          predicates:
            - Path=/api/product/**
          filters:
            - RewritePath=/api/(?<segment>.*),/$\{segment}
      #第三方路由配置
        - id: third_party_route
          uri: lb://gulimall-third-party
          predicates:
            - Path=/api/thirdparty/**
          filters:
            - RewritePath=/api/thirdparty/(?<segment>.*),/$\{segment}
        #会员服务的路由
        - id: member_route
          uri: lb://gulimall-member
          predicates:
            - Path=/api/member/**
          filters:
              #api前缀去掉剩下的全体保留
            - RewritePath=/api/(?<segment>.*),/$\{segment}

        - id: admin_route
          #lb表示负载均衡
          uri: lb://renren-fast
          #规定前端项目必须带有一个api前缀
          #原来验证码的uri ...localhost:88/api/captcha.jpg
          #应该改成的uri ...localhost:88/renrenfast/captcha.jpg
          predicates:
            - Path=/api/**
          filters:
            - RewritePath=/api/(?<segment>.*),/renren-fast/$\{segment}

原文地址:https://www.cnblogs.com/wuyimin/p/15123984.html