# QCDP **Repository Path**: valleybird/qcdp ## Basic Information - **Project Name**: QCDP - **Description**: 基于spring cloud的微服务后台 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-11-03 - **Last Updated**: 2022-11-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # QCDP ## 介绍 基于spring cloud的微服务后台 由云南渠成科技有限公司搭建,并以此为基础开发相关业务应用系统。 ## 软件架构 软件架构说明 待补充主要使用产品及技术 ## 上手及运行教程 ### 运行本项目 1. Nacos安装、配置及运行 2. DemoApi运行及测试 3. Gateway运行及测试 4. 下一步 #### Nacos安装、配置及运行 (nacos配置使用端口为:8848) 1. 在https://nacos.io/zh-cn/index.html 下载1.X版本的运行文件。 2. 在mysql中新建一个名为nacos的数据库或使用已有的数据库,在该数据库上执行conf\nacos-mysql.sql脚本。 3. 在nacos\conf目录下,修改application.properties中配置信息。取消Config Module Related Configurations和Count of DB部分的注释。取消Connect URL of DB部分的注释,并根据实际使用的数据修改连接和账户密码。 4. nacos默认为集群模式启动,在启动文件startup.cmd中第28行修改保存配置为单例模式启动。 ~~~ set MODE="standalone" ~~~ 5. 运行bin\startup启动nacos,通过地址 http://localhost:8848/nacos/index.html 访问web端管理界面(默认用户名和密码均为nacos)。 #### DemoApi运行及测试 (DemoApi配置使用端口为:8081) 1. 在IDEA中打开项目。 2. 如在上一步修改过nacos使用的端口,请根据上一步配置的nacos使用的端口修改qc-module-demo-api中的bootstrap.yml配置。 3. 在nacos配置界面中新建配置,Data ID为:module-demo,Group为:DEFAULT_GROUP,配置格式为:YAML,配置内容如下: ~~~ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver username: root password: root url: jdbc:mysql://localhost:3306/demo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai mvc: pathmatch: matching-strategy: ant_path_matcher cloud: nacos: discovery: server-addr: 127.0.0.1:8848 username: nacos password: nacos # namespace: public ~~~ 4. 启动DemoApiApplication。 5. 在浏览器或postman等工具中进行访问测试,访问地址:http://localhost:8081/qzj/test ,看到返回“Test Return Result.”即为正常。 #### Gateway运行及测试 (Gateway配置使用端口为:8088) 1. 如在上一步修改过nacos使用的端口,根据上一步配置的nacos使用的端口修改qc-gateway中的bootstrap.yml配置。 2. 在nacos配置界面中新建配置,Data ID为:qc-gateway,Group为:DEFAULT_GROUP,配置格式为:YAML,配置内容如下: ~~~ spring: mvc: pathmatch: matching-strategy: ant_path_matcher cloud: nacos: discovery: server-addr: 127.0.0.1:8848 username: nacos password: nacos gateway: discovery: locator: enabled: true routes: - id: demo uri: lb://module-demo predicates: - Path=/** ~~~ 3. 启动QCGatewayApplication。 4. 在浏览器或postman等工具中进行访问测试,访问地址:http://localhost:8088/qzj/test ,看到返回“Test Return Result.”即为正常。 #### 下一步 ### 本项目结构目录 ## 开发说明 1. xxxx 2. xxxx 3. xxxx