Nacos配置中心实现

发布时间:2024年01月16日

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

export function getServerUrl(url,module){
  if(module=="user"){
    return "http://localhost:80/user/"+url;
  }else if(module=="miaoShaGoods"){
    return "http://localhost:8081/miaoShaGoods/"+url;
  }else if(module=="verifyCode"){
    return "http://localhost:8083/verifyCode/"+url;
  }else if(module=="miaoSha"){
    return "http://localhost:8083/miaoSha/"+url;
  }else if(module=="order"){
    return "http://localhost:8082/order/"+url;
  }
}

spring.application.name=miaosha-goods
spring.cloud.nacos.config.server-addr=127.0.0.1:8848
# spring.cloud.nacos.config.namespace=08dbdfd1-d79d-4c63-9787-bf6045822283
# spring.cloud.nacos.config.group=HUODONG1_GROUP


spring.cloud.nacos.config.extension-configs[0].data-id=server.yml
spring.cloud.nacos.config.extension-configs[0].group=miaosha-goods
spring.cloud.nacos.config.extension-configs[0].refresh=true

spring.cloud.nacos.config.extension-configs[1].data-id=sys.yml
spring.cloud.nacos.config.extension-configs[1].group=miaosha-goods
spring.cloud.nacos.config.extension-configs[1].refresh=true

spring.cloud.nacos.config.extension-configs[2].data-id=redis.yml
spring.cloud.nacos.config.extension-configs[2].group=miaosha-base
spring.cloud.nacos.config.extension-configs[2].refresh=true

spring.cloud.nacos.config.extension-configs[3].data-id=mysql.yml
spring.cloud.nacos.config.extension-configs[3].group=miaosha-base
spring.cloud.nacos.config.extension-configs[3].refresh=true

spring.cloud.nacos.config.extension-configs[4].data-id=rabbitmq.yml
spring.cloud.nacos.config.extension-configs[4].group=miaosha-base
spring.cloud.nacos.config.extension-configs[4].refresh=true

spring.cloud.nacos.config.extension-configs[5].data-id=mybatis-plus.yml
spring.cloud.nacos.config.extension-configs[5].group=miaosha-base
spring.cloud.nacos.config.extension-configs[5].refresh=true
spring.application.name=miaosha-miaosha
spring.cloud.nacos.config.server-addr=127.0.0.1:8848
# spring.cloud.nacos.config.namespace=08dbdfd1-d79d-4c63-9787-bf6045822283
# spring.cloud.nacos.config.group=HUODONG1_GROUP

spring.cloud.nacos.config.extension-configs[0].data-id=server.yml
spring.cloud.nacos.config.extension-configs[0].group=miaosha-miaosha
spring.cloud.nacos.config.extension-configs[0].refresh=true

spring.cloud.nacos.config.extension-configs[1].data-id=sys.yml
spring.cloud.nacos.config.extension-configs[1].group=miaosha-miaosha
spring.cloud.nacos.config.extension-configs[1].refresh=true

spring.cloud.nacos.config.extension-configs[2].data-id=redis.yml
spring.cloud.nacos.config.extension-configs[2].group=miaosha-base
spring.cloud.nacos.config.extension-configs[2].refresh=true

spring.cloud.nacos.config.extension-configs[3].data-id=mysql.yml
spring.cloud.nacos.config.extension-configs[3].group=miaosha-base
spring.cloud.nacos.config.extension-configs[3].refresh=true

spring.cloud.nacos.config.extension-configs[4].data-id=rabbitmq.yml
spring.cloud.nacos.config.extension-configs[4].group=miaosha-base
spring.cloud.nacos.config.extension-configs[4].refresh=true

spring.cloud.nacos.config.extension-configs[5].data-id=mybatis-plus.yml
spring.cloud.nacos.config.extension-configs[5].group=miaosha-base
spring.cloud.nacos.config.extension-configs[5].refresh=true
spring.application.name=miaosha-order
spring.cloud.nacos.config.server-addr=127.0.0.1:8848
# spring.cloud.nacos.config.namespace=08dbdfd1-d79d-4c63-9787-bf6045822283
# spring.cloud.nacos.config.group=HUODONG1_GROUP

spring.cloud.nacos.config.extension-configs[0].data-id=server.yml
spring.cloud.nacos.config.extension-configs[0].group=miaosha-order
spring.cloud.nacos.config.extension-configs[0].refresh=true

spring.cloud.nacos.config.extension-configs[1].data-id=sys.yml
spring.cloud.nacos.config.extension-configs[1].group=miaosha-order
spring.cloud.nacos.config.extension-configs[1].refresh=true

spring.cloud.nacos.config.extension-configs[2].data-id=redis.yml
spring.cloud.nacos.config.extension-configs[2].group=miaosha-base
spring.cloud.nacos.config.extension-configs[2].refresh=true

spring.cloud.nacos.config.extension-configs[3].data-id=mysql.yml
spring.cloud.nacos.config.extension-configs[3].group=miaosha-base
spring.cloud.nacos.config.extension-configs[3].refresh=true

spring.cloud.nacos.config.extension-configs[4].data-id=rabbitmq.yml
spring.cloud.nacos.config.extension-configs[4].group=miaosha-base
spring.cloud.nacos.config.extension-configs[4].refresh=true

spring.cloud.nacos.config.extension-configs[5].data-id=mybatis-plus.yml
spring.cloud.nacos.config.extension-configs[5].group=miaosha-base
spring.cloud.nacos.config.extension-configs[5].refresh=true
spring.application.name=miaosha-user
spring.cloud.nacos.config.server-addr=127.0.0.1:8848
# spring.cloud.nacos.config.namespace=08dbdfd1-d79d-4c63-9787-bf6045822283
# spring.cloud.nacos.config.group=HUODONG1_GROUP

spring.cloud.nacos.config.extension-configs[0].data-id=server.yml
spring.cloud.nacos.config.extension-configs[0].group=miaosha-user
spring.cloud.nacos.config.extension-configs[0].refresh=true

spring.cloud.nacos.config.extension-configs[1].data-id=sys.yml
spring.cloud.nacos.config.extension-configs[1].group=miaosha-user
spring.cloud.nacos.config.extension-configs[1].refresh=true


spring.cloud.nacos.config.extension-configs[2].data-id=redis.yml
spring.cloud.nacos.config.extension-configs[2].group=miaosha-base
spring.cloud.nacos.config.extension-configs[2].refresh=true

spring.cloud.nacos.config.extension-configs[3].data-id=mysql.yml
spring.cloud.nacos.config.extension-configs[3].group=miaosha-base
spring.cloud.nacos.config.extension-configs[3].refresh=true

spring.cloud.nacos.config.extension-configs[4].data-id=rabbitmq.yml
spring.cloud.nacos.config.extension-configs[4].group=miaosha-base
spring.cloud.nacos.config.extension-configs[4].refresh=true

spring.cloud.nacos.config.extension-configs[5].data-id=mybatis-plus.yml
spring.cloud.nacos.config.extension-configs[5].group=miaosha-base
spring.cloud.nacos.config.extension-configs[5].refresh=true
文章来源:https://blog.csdn.net/m0_68935893/article/details/135618848
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。