SpringCloud actual combat project full set of learning tutorials serialized

PassJava tutorial

Introduction to the

  • The PassJava-Learning project is a Learning tutorial for the PassJava project. Explain architecture, business and technical points.
  • PassJava is a type of JavaBrush the interview questionsOpen source system, you can use fragmentary time to use small procedures to view often meet test questions, solid Java foundation.
  • The PassJava project can teach you how to build a SpringBoot project, a Spring Cloud project
  • Use popular technologies, such as SpringBoot, MyBatis, Redis, MySql, MongoDB, RabbitMQ, Elasticsearch, Docker container deployment.

Better reading experience

  • Document address: www.jayh.club
  • The standby address: jackson0714. Making. IO/PassJava – Le…

Document serialization directory

  • Create a brush Java knowledge of small procedures
  • Create a brush Java knowledge of small procedures (two)
  • 01. Understand distributed basics in five minutes
  • 02. Quickly Build a Linux Environment – Essential for O&M
  • 03. Configure the VM network
  • 4. Install the Docker
  • 05. Docker mysql installation
  • 6. Install redis Docker
  • 07. Configure the local development environment
  • 08. Configure Git
  • 09. Initialize the project and add microservices
  • 10.PassJava- Microservices partition diagram
  • 11. Initialize the database and tables
  • 12. Set up the management background
  • 13. Generate front-end and back-end code automatically
  • 14. Integrate MyBatis-Plus to achieve CRUD
  • 15. Generate CRUD code for all microservices
  • 16. Introduction to Spring Cloud Alibaba components

Generate CRUD code for five microservices

1. Modify the code generator configuration file

(1) \ renren – generator \ SRC \ main \ resources \ generator properties

mainPath=com.jackson0714
package=com.jackson0714.passjava
moduleName=channel
author=jackson0714
[email protected]
tablePrefix=chms_Copy the code

(2) \ renren – generator \ SRC \ main \ resources \ application yml

Change the connected database to passjava_chms

2. Generate channel microservice codes

To start the service, open the browser: http://localhost:8003/#generator.html

Note: The default port address is 8080. I configured it to 8003.

3. Add generated code

  • Delete the folder: main\ Resources \ SRC in the automatically generated code
  • Copy the main folder to the channel module SRC directory

4. Configure channel microservices

  • Pom.xml introduces the common module

    <dependency> <groupId>com.jackson0714.passjava</groupId> <artifactId>passjava-common</artifactId> < version > 0.0.1 - the SNAPSHOT < / version > < / dependency >Copy the code
  • Add application. Yml

    Spring: a datasource: driver - class - name: com. Mysql. Cj). The JDBC driver url: JDBC: mysql: / / 129.211.188. XXX: 3306 / passjava_chms? useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai username: root password: xxx mybatis-plus: mapper-locations: classpath:/mapper/**/*.xml global-config: db-config: id-type: autoCopy the code
  • 5. Test the Channel service interface

    Visit: http://localhost:8000/channel/channel/list

    Returns:

    {"msg":"success","code":0,"page":{"totalCount":0,"pageSize":10,"totalPage":0,"currPage":1,"list":[]}}Copy the code

5. Generate CRUD code for all microservices

6. Configure the microservice port

Passjava-channel port 8000 passjava-content port 9000 passjava-member port 10000 passjava-question port 11000 passjava-study port 12000Copy the code

All microservices were started successfully and the test interface passed

http://localhost:8000/channel/channel/list
http://localhost:9000/content/banner/list
http://localhost:10000/member/member/list
http://localhost:11000/question/question/list
http://localhost:12000/study/studytime/listCopy the code

The code address

Github.com/Jackson0714…

The public,