diff --git a/README.md b/README.md index eddc05f..cae2a2a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,6 @@ novel-cloud #### 技术选型 - | 技术 | 说明 | --------------------| --------------------------- | SpringBoot | Spring应用快速开发脚手架 @@ -69,7 +68,9 @@ novel-cloud | ELK | 分布式日志分析 | Vue | 前端开发框架 +#### 数据模型 +![QQ20200520-215756](./assert/QQ20200529-170006.png) #### 截图 @@ -107,6 +108,92 @@ novel-cloud +#### 安装步骤 + +1. 下载源码,如果是ZIP包,下载后需要解压。 + + ![image-20200529173322783](./assert/image-20200529173322783.png) + +2. 开发环境配置,请确保开发机器上已安装如下软件环境。 + - [ ] Java开发工具包jdk1.8+ + - [ ] IDE(Eclipse或IntelliJ IDEA) + - [ ] + - [ ] 项目管理工具maven + - [ ] 微服务注册中心/配置中心nacos + - [ ] 分布式缓存服务Redis + - [ ] 搜索引擎服务ElasticSearch + - [ ] ElasticSearch可视化客户端Kibana + - [ ] 消息中间件RabbitMq + - [ ] 数据库服务Mysql + +3. 登陆nacos配置中心导入下载源码中的配置文件。 + + ![image-20200529173322783](./assert/QQ20200529-180807.png)![image-20200529173322783](./assert/QQ20200529-181203.png) + + ![image-20200529173322783](./assert/QQ20200529-181406.png) + + ![image-20200529173322783](./assert/QQ20200529-181531.png) + +4. 使用IDE导入下载的源码(这里以IntelliJ IDEA为例)。 + + ![image-20200529173322783](./assert/QQ20200529-175108.png) + +5. 修改通用配置中的配置中心地址和命名空间ID。 + + ![image-20200529182810929](./assert/QQ20200529-182931.png) + + ![image-20200529173322783](./assert/QQ20200529-182657.png) + +6. 启动微服务网关。 + + - 修改网关服务的配置中心地址和命名空间ID + + ![image-20200529173322783](./assert/QQ20200529-184805.png) + + - 修改网关配置文件注册中心地址和命名空间ID + + ![image-20200529173322783](./assert/QQ20200529-0.png) + + ![image-20200529173322783](./assert/QQ20200529-182356.png) + + - 启动网关服务novel-gateway + + ![image-20200529173322783](./assert/QQ20200529-1.png) + + ![image-20200529173322783](./assert/QQ20200529-183445.png) + +7. 启动监控服务。 + + - 修改监控服务的配置中心地址和命名空间ID![image-20200529173322783](./assert/QQ20200529-185750.png) + + - 修改监控微服务的注册中心地址和命名空间ID以及登陆的用户名和密码![image-20200529173322783](./assert/QQ20200529-185912.png) + + - 启动监控服务novel-monitor,启动方法和网关服务相同 + + - 访问监控服务,因为网关中配置了监控服务的路由,所以可直接或通过网关来访问监控服务:http://<网关ip>:<网关端口号>/monitor + + ![image-20200529173322783](./assert/QQ20200529-190730.png) + + + +8. 启动业务微服务,这里以小说微服务为例。 + + - 修改网关配置文件book-service.yml中的注册中心地址和命名空间ID,以及其他配置(数据库/redis/elasticsearch/mq等),方法同上 + + - 启动novel-service服务,方法同上 + + - 访问接口文档:http://<服务IP>:<服务端口号>/swagger-ui.html, + + 例如:http://127.0.0.1:620/swagger-ui.html + + + +9. 通过网关统一接口访问路径。 + + http://<网关IP>:<网关端口号>/api/<接口路径> + + 以小说小说分类列表查询接口为例:http://127.0.0.1:527/api/book/listBookCategory + #### 代码仓库 Gitee仓库地址: https://gitee.com/xiongxyang/novel-cloud diff --git a/assert/QQ20200529-0.png b/assert/QQ20200529-0.png new file mode 100644 index 0000000..c804561 Binary files /dev/null and b/assert/QQ20200529-0.png differ diff --git a/assert/QQ20200529-1.png b/assert/QQ20200529-1.png new file mode 100644 index 0000000..3a11d92 Binary files /dev/null and b/assert/QQ20200529-1.png differ diff --git a/assert/QQ20200529-170006.png b/assert/QQ20200529-170006.png new file mode 100644 index 0000000..be5059a Binary files /dev/null and b/assert/QQ20200529-170006.png differ diff --git a/assert/QQ20200529-175108.png b/assert/QQ20200529-175108.png new file mode 100644 index 0000000..2c60bf8 Binary files /dev/null and b/assert/QQ20200529-175108.png differ diff --git a/assert/QQ20200529-180807.png b/assert/QQ20200529-180807.png new file mode 100644 index 0000000..4fa9efe Binary files /dev/null and b/assert/QQ20200529-180807.png differ diff --git a/assert/QQ20200529-181203.png b/assert/QQ20200529-181203.png new file mode 100644 index 0000000..ecb9db2 Binary files /dev/null and b/assert/QQ20200529-181203.png differ diff --git a/assert/QQ20200529-181406.png b/assert/QQ20200529-181406.png new file mode 100644 index 0000000..793fdbd Binary files /dev/null and b/assert/QQ20200529-181406.png differ diff --git a/assert/QQ20200529-181531.png b/assert/QQ20200529-181531.png new file mode 100644 index 0000000..18881e7 Binary files /dev/null and b/assert/QQ20200529-181531.png differ diff --git a/assert/QQ20200529-182356.png b/assert/QQ20200529-182356.png new file mode 100644 index 0000000..f6208bb Binary files /dev/null and b/assert/QQ20200529-182356.png differ diff --git a/assert/QQ20200529-182657.png b/assert/QQ20200529-182657.png new file mode 100644 index 0000000..882ed43 Binary files /dev/null and b/assert/QQ20200529-182657.png differ diff --git a/assert/QQ20200529-182931.png b/assert/QQ20200529-182931.png new file mode 100644 index 0000000..8fdd3c5 Binary files /dev/null and b/assert/QQ20200529-182931.png differ diff --git a/assert/QQ20200529-183445.png b/assert/QQ20200529-183445.png new file mode 100644 index 0000000..53d72c3 Binary files /dev/null and b/assert/QQ20200529-183445.png differ diff --git a/assert/QQ20200529-184805.png b/assert/QQ20200529-184805.png new file mode 100644 index 0000000..6367749 Binary files /dev/null and b/assert/QQ20200529-184805.png differ diff --git a/assert/QQ20200529-185750.png b/assert/QQ20200529-185750.png new file mode 100644 index 0000000..f5a065b Binary files /dev/null and b/assert/QQ20200529-185750.png differ diff --git a/assert/QQ20200529-185912.png b/assert/QQ20200529-185912.png new file mode 100644 index 0000000..013e4e0 Binary files /dev/null and b/assert/QQ20200529-185912.png differ diff --git a/assert/QQ20200529-190730.png b/assert/QQ20200529-190730.png new file mode 100644 index 0000000..7f08174 Binary files /dev/null and b/assert/QQ20200529-190730.png differ diff --git a/assert/image-20200529173322783.png b/assert/image-20200529173322783.png new file mode 100644 index 0000000..8f39a7c Binary files /dev/null and b/assert/image-20200529173322783.png differ diff --git a/doc/sql/novel-cloud数据模型.ndm b/doc/sql/novel-cloud数据模型.ndm new file mode 100644 index 0000000..1974e1c Binary files /dev/null and b/doc/sql/novel-cloud数据模型.ndm differ diff --git a/doc/yml/nacos_config_export_20200529164001.zip b/doc/yml/nacos_config_export_20200529164001.zip new file mode 100644 index 0000000..68a3074 Binary files /dev/null and b/doc/yml/nacos_config_export_20200529164001.zip differ diff --git a/doc/yml/novel-gateway/novel-gateway.yml b/doc/yml/novel-gateway/novel-gateway.yml index dc56e7c..0521cbd 100644 --- a/doc/yml/novel-gateway/novel-gateway.yml +++ b/doc/yml/novel-gateway/novel-gateway.yml @@ -17,12 +17,36 @@ spring: namespace: 3960c71a-62ac-4b8f-8c30-bba8e8143a0c gateway: routes: + - id: home-route + uri: lb://novel-home + predicates: + - Path=/api/home/** + filters: + - RewritePath=/api/(?.*), /$\{segment} + - id: news-route + uri: lb://news-service + predicates: + - Path=/api/news/** + filters: + - RewritePath=/api/(?.*), /$\{segment} - id: user-route uri: lb://user-service predicates: - Path=/api/user/** filters: - RewritePath=/api/(?.*), /$\{segment} + - id: book-route + uri: lb://book-service + predicates: + - Path=/api/book/** + filters: + - RewritePath=/api/(?.*), /$\{segment} + - id: search-route + uri: lb://novel-search + predicates: + - Path=/api/search/** + filters: + - RewritePath=/api/(?.*), /$\{segment} - id: monitor-route uri: lb://novel-monitor predicates: