首先从gitee中克隆人人开源项目,建库建表,逆向工程生成基本增删改查
com.alibaba.cloud spring-cloud-alibaba-dependencies2.1.0.RELEASE pom import -----------------------------------以下业务模块,创建时构建web和feign----------------------------------
1.8 Greenwich.SR3 org.springframework.cloud spring-cloud-dependencies${spring-cloud.version} pom import org.springframework.boot spring-boot-starter-parent2.1.8.RELEASE org.springframework.boot spring-boot-starter-weborg.springframework.cloud spring-cloud-starter-openfeignorg.springframework.boot spring-boot-starter-testtest
整合nacos:
1. 安装nacos软件
2. pom文件引入依赖
com.alibaba.cloud spring-cloud-starter-alibaba-nacos-discovery
3. 在配置文件中注册nacos
server:
port: 8080 #本服务端口号为 8080
spring:
cloud:
nacos:
discovery:
server-addr: localhost:8848 #nacos注册中心地址为 localhost:8848
application:
name: gulimall-member #本服务名为 gulimall-member
4. 在主启动类上加上注解 @EnableDiscoveryClient
@EnableDiscoveryClient //表示开开启服务发现与注册功能
@SpringBootApplication
public class GulimallOrderApplication {
public static void main(String[] args) {
SpringApplication.run(GulimallOrderApplication.class, args);
}
}
5. 浏览器访问 http://localhost:8848/nacos 账户密码默认为 nacos
6. 展示服务列表



