diff --git a/docs/setup/quick-start.md b/docs/setup/quick-start.md index c92cd8f69..f7657464f 100644 --- a/docs/setup/quick-start.md +++ b/docs/setup/quick-start.md @@ -44,7 +44,7 @@ spring: url: jdbc:mysql://s1.iocoder.cn:3306/mall_product?useSSL=false&useUnicode=true&characterEncoding=UTF-8 # 请修改成你本地的 MySQL url driver-class-name: com.mysql.jdbc.Driver username: root # 请修改成你本地的 MySQL username - password: 3WLiVUBEwTbvAfsh # 请修改成你本地的 MySQL password + password: zhuyang # 请修改成你本地的 MySQL password ``` # 4. Zookeeper diff --git a/management-web-app/pom.xml b/management-web-app/pom.xml index 06b23a98b..bed43c5dd 100644 --- a/management-web-app/pom.xml +++ b/management-web-app/pom.xml @@ -106,6 +106,11 @@ mapstruct-jdk8 + + + org.springframework.cloud + spring-cloud-starter-openfeign + diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/ManagementWebApplication.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/ManagementWebApplication.java index 121979533..6812bb727 100644 --- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/ManagementWebApplication.java +++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/ManagementWebApplication.java @@ -2,8 +2,12 @@ package cn.iocoder.mall.managementweb; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients public class ManagementWebApplication { public static void main(String[] args) { diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/ProductSpuController.http b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/ProductSpuController.http index 00d3c8f3c..6ffb59c67 100644 --- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/ProductSpuController.http +++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/product/ProductSpuController.http @@ -49,3 +49,11 @@ id=59&name=测试商品标题&description=测试商品描述&cid=637&sellPoint= &skus[1].price=2&skus[1].quantity=50&skus[1].attrValueIds=2,4 ### + +### /product-spu/get +GET http://127.0.0.1:18083/management-api/product-spu/get?productSpuId=32 +Content-Type: application/x-www-form-urlencoded +Authorization:Bearer yudaoyuanma + +### + diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/feign/ProductSpuFeign.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/feign/ProductSpuFeign.java new file mode 100644 index 000000000..2597badf5 --- /dev/null +++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/feign/ProductSpuFeign.java @@ -0,0 +1,20 @@ +package cn.iocoder.mall.managementweb.feign; + +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuRespDTO; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; + +@FeignClient(value = "product-service") +public interface ProductSpuFeign { + /** + * 获得商品 SPU + * + * @param productSpuId 商品 SPU 编号 + * @return 商品 SPU + */ + @GetMapping(value = "/product/spu/get") + CommonResult getProductSpu(@RequestParam("productSpuId") Integer productSpuId); + +} diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/product/ProductSpuManager.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/product/ProductSpuManager.java index 8655f307a..ef2c4d734 100644 --- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/product/ProductSpuManager.java +++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/product/ProductSpuManager.java @@ -7,9 +7,11 @@ import cn.iocoder.mall.managementweb.controller.product.vo.spu.ProductSpuPageReq import cn.iocoder.mall.managementweb.controller.product.vo.spu.ProductSpuRespVO; import cn.iocoder.mall.managementweb.controller.product.vo.spu.ProductSpuUpdateReqVO; import cn.iocoder.mall.managementweb.convert.product.ProductSpuConvert; +import cn.iocoder.mall.managementweb.feign.ProductSpuFeign; import cn.iocoder.mall.productservice.rpc.spu.ProductSpuRpc; import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuRespDTO; import org.apache.dubbo.config.annotation.DubboReference; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @@ -23,6 +25,9 @@ public class ProductSpuManager { @DubboReference(version = "${dubbo.consumer.ProductSpuRpc.version}") private ProductSpuRpc productSpuRpc; + @Autowired + private ProductSpuFeign productSpuFeign; + /** * 创建商品 SPU * @@ -52,7 +57,7 @@ public class ProductSpuManager { * @return 商品 SPU */ public ProductSpuRespVO getProductSpu(Integer productSpuId) { - CommonResult getProductSpuResult = productSpuRpc.getProductSpu(productSpuId); + CommonResult getProductSpuResult = productSpuFeign.getProductSpu(productSpuId); getProductSpuResult.checkError(); return ProductSpuConvert.INSTANCE.convert(getProductSpuResult.getData()); } diff --git a/management-web-app/src/main/resources/application-dev.yml b/management-web-app/src/main/resources/application-dev.yml index 31a3a702f..9e9f28fb7 100644 --- a/management-web-app/src/main/resources/application-dev.yml +++ b/management-web-app/src/main/resources/application-dev.yml @@ -4,15 +4,15 @@ spring: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: - # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 + # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 # Mall 认证安全配置 mall.security.admin.demo: true # 是否开启演示模式 diff --git a/management-web-app/src/main/resources/application-local.yml b/management-web-app/src/main/resources/application-local.yml index 2e26cd388..fede4927b 100644 --- a/management-web-app/src/main/resources/application-local.yml +++ b/management-web-app/src/main/resources/application-local.yml @@ -4,12 +4,12 @@ spring: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: - # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 + # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 diff --git a/moved/product/product-service-impl/src/main/resources/config/application.yaml b/moved/product/product-service-impl/src/main/resources/config/application.yaml index 66af9a899..10a3e9425 100644 --- a/moved/product/product-service-impl/src/main/resources/config/application.yaml +++ b/moved/product/product-service-impl/src/main/resources/config/application.yaml @@ -4,7 +4,7 @@ spring: url: jdbc:mysql://s1.iocoder.cn:3306/mall_product?useSSL=false&useUnicode=true&characterEncoding=UTF-8 driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: diff --git a/moved/system/system-service-impl/src/main/resources/config/application.yaml b/moved/system/system-service-impl/src/main/resources/config/application.yaml index a44537f1e..bef7c0a02 100644 --- a/moved/system/system-service-impl/src/main/resources/config/application.yaml +++ b/moved/system/system-service-impl/src/main/resources/config/application.yaml @@ -4,7 +4,7 @@ spring: url: jdbc:mysql://s1.iocoder.cn:3306/mall_admin?useSSL=false&useUnicode=true&characterEncoding=UTF-8 driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: diff --git a/pay-service-project/pay-service-app/src/main/resources/application-dev.yaml b/pay-service-project/pay-service-app/src/main/resources/application-dev.yaml index c7b4acbb6..faab4b01a 100644 --- a/pay-service-project/pay-service-app/src/main/resources/application-dev.yaml +++ b/pay-service-project/pay-service-app/src/main/resources/application-dev.yaml @@ -1,24 +1,24 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_pay?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_pay?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: - # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 + # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 # XXL-Job 配置项 xxl: diff --git a/pay-service-project/pay-service-app/src/main/resources/application-local.yaml b/pay-service-project/pay-service-app/src/main/resources/application-local.yaml index b57d1302f..ffc81eb45 100644 --- a/pay-service-project/pay-service-app/src/main/resources/application-local.yaml +++ b/pay-service-project/pay-service-app/src/main/resources/application-local.yaml @@ -1,24 +1,24 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_pay?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_pay?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: -# address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 +# address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 # Dubbo 服务提供者的配置 provider: tag: ${DUBBO_TAG} # Dubbo 路由分组 @@ -28,7 +28,7 @@ xxl: job: enabled: false # 本地开发时,关闭 XXL-Job admin: - addresses: http://400-infra.server.iocoder.cn:9099 + addresses: http://localhost:9099 executor: appname: ${spring.application.name} accessToken: diff --git a/pay-service-project/pay-service-app/src/main/resources/application.yaml b/pay-service-project/pay-service-app/src/main/resources/application.yaml index 57ba7cf4b..e35632ddf 100644 --- a/pay-service-project/pay-service-app/src/main/resources/application.yaml +++ b/pay-service-project/pay-service-app/src/main/resources/application.yaml @@ -46,7 +46,7 @@ dubbo: # RocketMQ 配置项 rocketmq: - name-server: 400-infra.server.iocoder.cn:9876 + name-server: localhost:9876 producer: group: ${spring.application.name}-producer-group diff --git a/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/common/dubbo/DubboGenericInvokerTest.java b/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/common/dubbo/DubboGenericInvokerTest.java index 878c72956..603267cd7 100644 --- a/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/common/dubbo/DubboGenericInvokerTest.java +++ b/pay-service-project/pay-service-integration-test/src/test/java/cn/iocoder/mall/payservice/common/dubbo/DubboGenericInvokerTest.java @@ -15,7 +15,7 @@ public class DubboGenericInvokerTest { application.setName("api-generic-consumer"); RegistryConfig registry = new RegistryConfig(); - registry.setAddress("nacos://400-infra.server.iocoder.cn:8848?namespace=dev"); + registry.setAddress("nacos://localhost:8848?namespace=dev"); application.setRegistry(registry); diff --git a/product-service-project/product-service-api/pom.xml b/product-service-project/product-service-api/pom.xml index e267473c8..1cbc81a0c 100644 --- a/product-service-project/product-service-api/pom.xml +++ b/product-service-project/product-service-api/pom.xml @@ -26,6 +26,11 @@ org.projectlombok lombok + + org.springframework.cloud + spring-cloud-openfeign-core + RELEASE + diff --git a/product-service-project/product-service-app/pom.xml b/product-service-project/product-service-app/pom.xml index cafab548f..4c886ba44 100644 --- a/product-service-project/product-service-app/pom.xml +++ b/product-service-project/product-service-app/pom.xml @@ -102,6 +102,10 @@ aspectjweaver 1.9.6 + + io.swagger + swagger-annotations + diff --git a/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/ProductServiceApplication.java b/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/ProductServiceApplication.java index ac41a7aab..5c5c30edc 100644 --- a/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/ProductServiceApplication.java +++ b/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/ProductServiceApplication.java @@ -2,8 +2,12 @@ package cn.iocoder.mall.productservice; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; @SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients public class ProductServiceApplication { public static void main(String[] args) { diff --git a/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductSpuController.http b/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductSpuController.http new file mode 100644 index 000000000..48ef87dd1 --- /dev/null +++ b/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/ProductSpuController.http @@ -0,0 +1,4 @@ +### /product/spu/get 获得商品 SPU +GET http://localhost:38082/product/spu/get?productSpuId=32 +### + diff --git a/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/SpuController.java b/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/SpuController.java new file mode 100644 index 000000000..6f7fd7903 --- /dev/null +++ b/product-service-project/product-service-app/src/main/java/cn/iocoder/mall/productservice/controller/SpuController.java @@ -0,0 +1,31 @@ +package cn.iocoder.mall.productservice.controller; + +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.mall.productservice.manager.spu.ProductSpuManager; +import cn.iocoder.mall.productservice.rpc.spu.dto.ProductSpuRespDTO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import static cn.iocoder.common.framework.vo.CommonResult.success; + +@RestController +@RequestMapping("/product/spu") +@Api("商品spu") +public class SpuController { + @Autowired + private ProductSpuManager productSpuManager; + + @GetMapping("/get") + @ApiOperation("获得商品 SPU") + @ApiImplicitParam(name = "productSpuId", value = "商品 SPU 编号", required = true) + public CommonResult getProductSpu(@RequestParam(value="productSpuId") Integer productSpuId) { + return success(productSpuManager.getProductSpu(productSpuId)); + } + +} diff --git a/product-service-project/product-service-app/src/main/resources/application-dev.yaml b/product-service-project/product-service-app/src/main/resources/application-dev.yaml index 8d210f360..7256a5bb2 100644 --- a/product-service-project/product-service-app/src/main/resources/application-dev.yaml +++ b/product-service-project/product-service-app/src/main/resources/application-dev.yaml @@ -1,21 +1,21 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_product?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_product?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: - # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 + # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 diff --git a/product-service-project/product-service-app/src/main/resources/application-local.yaml b/product-service-project/product-service-app/src/main/resources/application-local.yaml index 099913a16..8c2752534 100644 --- a/product-service-project/product-service-app/src/main/resources/application-local.yaml +++ b/product-service-project/product-service-app/src/main/resources/application-local.yaml @@ -1,24 +1,24 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_product?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_product?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: -# address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 +# address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 # Dubbo 服务提供者的配置 provider: tag: ${DUBBO_TAG} # Dubbo 路由分组 diff --git a/product-service-project/product-service-app/src/main/resources/application.yaml b/product-service-project/product-service-app/src/main/resources/application.yaml index e169a0bfa..296e61a84 100644 --- a/product-service-project/product-service-app/src/main/resources/application.yaml +++ b/product-service-project/product-service-app/src/main/resources/application.yaml @@ -42,7 +42,7 @@ dubbo: # RocketMQ 配置项 rocketmq: - name-server: 400-infra.server.iocoder.cn:9876 + name-server: localhost:9876 producer: group: ${spring.application.name}-producer-group diff --git a/promotion-service-project/promotion-service-app/src/main/resources/application-dev.yaml b/promotion-service-project/promotion-service-app/src/main/resources/application-dev.yaml index 99a349fac..946ea52b2 100644 --- a/promotion-service-project/promotion-service-app/src/main/resources/application-dev.yaml +++ b/promotion-service-project/promotion-service-app/src/main/resources/application-dev.yaml @@ -1,21 +1,21 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_promotion?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_promotion?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: - # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 + # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 diff --git a/promotion-service-project/promotion-service-app/src/main/resources/application-local.yaml b/promotion-service-project/promotion-service-app/src/main/resources/application-local.yaml index 19e0f347a..43bff1671 100644 --- a/promotion-service-project/promotion-service-app/src/main/resources/application-local.yaml +++ b/promotion-service-project/promotion-service-app/src/main/resources/application-local.yaml @@ -1,24 +1,24 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_promotion?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_promotion?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: -# address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 +# address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 # Dubbo 服务提供者的配置 provider: tag: ${DUBBO_TAG} # Dubbo 路由分组 diff --git a/promotion-service-project/promotion-service-app/src/main/resources/application.yaml b/promotion-service-project/promotion-service-app/src/main/resources/application.yaml index 542011fa4..10d90e898 100644 --- a/promotion-service-project/promotion-service-app/src/main/resources/application.yaml +++ b/promotion-service-project/promotion-service-app/src/main/resources/application.yaml @@ -46,7 +46,7 @@ dubbo: # RocketMQ 配置项 rocketmq: - name-server: 400-infra.server.iocoder.cn:9876 + name-server: localhost:9876 producer: group: ${spring.application.name}-producer-group diff --git a/search-service-project/search-service-app/src/main/resources/application-dev.yaml b/search-service-project/search-service-app/src/main/resources/application-dev.yaml index 2e26cd388..fede4927b 100644 --- a/search-service-project/search-service-app/src/main/resources/application-dev.yaml +++ b/search-service-project/search-service-app/src/main/resources/application-dev.yaml @@ -4,12 +4,12 @@ spring: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: - # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 + # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 diff --git a/search-service-project/search-service-app/src/main/resources/application-local.yaml b/search-service-project/search-service-app/src/main/resources/application-local.yaml index 9c125c50b..07ae5f036 100644 --- a/search-service-project/search-service-app/src/main/resources/application-local.yaml +++ b/search-service-project/search-service-app/src/main/resources/application-local.yaml @@ -4,15 +4,15 @@ spring: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: -# address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 +# address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 # Dubbo 服务提供者的配置 provider: tag: ${DUBBO_TAG} # Dubbo 路由分组 diff --git a/search-service-project/search-service-app/src/main/resources/application.yaml b/search-service-project/search-service-app/src/main/resources/application.yaml index 8b1f96473..71b38c6bf 100644 --- a/search-service-project/search-service-app/src/main/resources/application.yaml +++ b/search-service-project/search-service-app/src/main/resources/application.yaml @@ -9,12 +9,12 @@ spring: data: elasticsearch: cluster-name: elasticsearch - cluster-nodes: 400-infra.server.iocoder.cn:9300 + cluster-nodes: localhost:9300 repositories: enable: true elasticsearch: rest: - uris: 400-infra.server.iocoder.cn:9200 + uris: localhost:9200 # Dubbo 配置项 dubbo: @@ -46,7 +46,7 @@ dubbo: # RocketMQ 配置项 rocketmq: - name-server: 400-infra.server.iocoder.cn:9876 + name-server: localhost:9876 # Actuator 监控配置项 management: diff --git a/shop-web-app/src/main/resources/application-dev.yml b/shop-web-app/src/main/resources/application-dev.yml index 2e26cd388..fede4927b 100644 --- a/shop-web-app/src/main/resources/application-dev.yml +++ b/shop-web-app/src/main/resources/application-dev.yml @@ -4,12 +4,12 @@ spring: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: - # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 + # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 diff --git a/shop-web-app/src/main/resources/application-local.yml b/shop-web-app/src/main/resources/application-local.yml index 12e9ed401..d8b2b0c81 100644 --- a/shop-web-app/src/main/resources/application-local.yml +++ b/shop-web-app/src/main/resources/application-local.yml @@ -4,7 +4,7 @@ spring: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Spring 主应用配置 main: @@ -14,5 +14,5 @@ spring: dubbo: # Dubbo 注册中心 registry: - # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 + # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 diff --git a/system-service-project/system-service-app/src/main/resources/application-dev.yaml b/system-service-project/system-service-app/src/main/resources/application-dev.yaml index 5f93d363a..c6c91d9e7 100644 --- a/system-service-project/system-service-app/src/main/resources/application-dev.yaml +++ b/system-service-project/system-service-app/src/main/resources/application-dev.yaml @@ -1,14 +1,14 @@ spring: # MySQL 配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_system?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_system?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Redis 配置 redis: - host: 400-infra.server.iocoder.cn + host: localhost port: 6379 database: 0 @@ -17,12 +17,12 @@ spring: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: - # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 + # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 diff --git a/system-service-project/system-service-app/src/main/resources/application-local.yaml b/system-service-project/system-service-app/src/main/resources/application-local.yaml index b59d19223..4a3ed5fd4 100644 --- a/system-service-project/system-service-app/src/main/resources/application-local.yaml +++ b/system-service-project/system-service-app/src/main/resources/application-local.yaml @@ -1,14 +1,14 @@ spring: # MySQL 配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_system?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_system?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Redis 配置 redis: - host: 400-infra.server.iocoder.cn + host: localhost port: 6379 database: 0 @@ -17,15 +17,15 @@ spring: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: -# address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 +# address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 # Dubbo 服务提供者的配置 provider: tag: ${DUBBO_TAG} # Dubbo 路由分组 diff --git a/trade-service-project/trade-service-app/src/main/resources/application-dev.yaml b/trade-service-project/trade-service-app/src/main/resources/application-dev.yaml index 6359e3363..a371d4a54 100644 --- a/trade-service-project/trade-service-app/src/main/resources/application-dev.yaml +++ b/trade-service-project/trade-service-app/src/main/resources/application-dev.yaml @@ -1,21 +1,21 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_trade?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_trade?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: - # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 + # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 diff --git a/trade-service-project/trade-service-app/src/main/resources/application-local.yaml b/trade-service-project/trade-service-app/src/main/resources/application-local.yaml index da9304ac3..99ebfb162 100644 --- a/trade-service-project/trade-service-app/src/main/resources/application-local.yaml +++ b/trade-service-project/trade-service-app/src/main/resources/application-local.yaml @@ -1,16 +1,16 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_trade?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_trade?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # # Spring 主应用配置 # main: @@ -20,8 +20,8 @@ spring: dubbo: # Dubbo 注册中心 registry: -# address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 +# address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 # Dubbo 服务提供者的配置 provider: tag: ${DUBBO_TAG} # Dubbo 路由分组 diff --git a/trade-service-project/trade-service-app/src/main/resources/application.yaml b/trade-service-project/trade-service-app/src/main/resources/application.yaml index 41e0ac3ce..fe35cf834 100644 --- a/trade-service-project/trade-service-app/src/main/resources/application.yaml +++ b/trade-service-project/trade-service-app/src/main/resources/application.yaml @@ -52,7 +52,7 @@ dubbo: # RocketMQ 配置项 rocketmq: - name-server: 400-infra.server.iocoder.cn:9876 + name-server: localhost:9876 producer: group: ${spring.application.name}-producer-group diff --git a/user-service-project/user-service-app/src/main/resources/application-dev.yaml b/user-service-project/user-service-app/src/main/resources/application-dev.yaml index e08317307..32a4152b1 100644 --- a/user-service-project/user-service-app/src/main/resources/application-dev.yaml +++ b/user-service-project/user-service-app/src/main/resources/application-dev.yaml @@ -1,21 +1,21 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_user?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_user?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: - # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 + # address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 diff --git a/user-service-project/user-service-app/src/main/resources/application-local.yaml b/user-service-project/user-service-app/src/main/resources/application-local.yaml index 6a89f36d2..85a689310 100644 --- a/user-service-project/user-service-app/src/main/resources/application-local.yaml +++ b/user-service-project/user-service-app/src/main/resources/application-local.yaml @@ -1,24 +1,24 @@ spring: # 数据源配置项 datasource: - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/mall_user?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT + url: jdbc:mysql://localhost:3306/mall_user?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: 3WLiVUBEwTbvAfsh + password: zhuyang # Spring Cloud 配置项 cloud: nacos: # Spring Cloud Nacos Discovery 配置项 discovery: - server-addr: 400-infra.server.iocoder.cn:8848 # Nacos 服务器地址 + server-addr: localhost:8848 # Nacos 服务器地址 namespace: dev # Nacos 命名空间 # Dubbo 配置项 dubbo: # Dubbo 注册中心 registry: -# address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址 - address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 +# address: spring-cloud://localhost:8848 # 指定 Dubbo 服务注册中心的地址 + address: nacos://localhost:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址 # Dubbo 服务提供者的配置 provider: tag: ${DUBBO_TAG} # Dubbo 路由分组