Java project: cross-border shopping mall platform (spring cloud) microservice architecture

1. Main technologies

This system adopts the front-end and back-end separation mode. The front-end uses html technology, and the back-end uses spring cloud + mybatis + Maven + security to build the background.
View: It is mainly responsible for the rendering and display of the page, which is realized by html.
Controller: responsible for reading the data of the view presentation layer, controlling the user's input, and calling the method of the business layer, which is realized through the controller.
Model: The object model analysis after requirement analysis is mainly responsible for data management.

2. Project structure directory

insert image description here

3. Hierarchical calling relationship

insert image description here

Four, eureka service center cluster construction

This project has built two service centers, namely: eureka-server, eureka-server-another sub-module
The following explains the construction process of this module:
1. Create a new eureka-server, eureka-server-another module, and import eureka-server dependencies
insert image description here

2. Add the @EnableEurekaServer annotation to the launcher to enable the service
eureka-server:
insert image description here

eureka-server-another:
insert image description here

3. Configure Eureka startup parameters:
(1) Register two Eureka service centers with each other to build a cluster
eureka-server:
insert image description here

eureka-server-another:
insert image description here

Five, Ribbon, Feign polling load balancing strategy

The project currently uses the user-consumer consumer, and combines Ribbon and Feign to implement a round-robin load balancing strategy.
The following is the implementation process of the round robin load balancing strategy:

  1. On the basis of the Eureka consumer module, add Ribbon and Feign and import their dependencies.
    insert image description here

  2. Inject the RestTemplate into the springboot container and mark @LoadBalanced to implement the load balancer. In this way, when requesting a service provider, Ribbon will use the default polling strategy to call the service provider in turn.
    insert image description here

  3. Add the @FeignClient annotation to the service class in the service layer. In this annotation, the parameter we need to mark has a "value (name)", and the value of value is the name configured by our service provider application.name
    insert image description here

  4. In the last step, we need the api request path in the service provider above the method, so that we can call the api interface given by the service provider.
    insert image description here

Display of six mall functions

Mall display

insert image description here
Add items to the shopping cart
insert image description here
insert image description here
insert image description here
Place an order to buy

Click on the shopping cart and select the items and quantities to be purchased. Click OK to purchase, update the order status, and jump to the My Order page. insert image description here
The My Order interface displays the order status.
insert image description here
Click on the payment order to settle the unpaid order. There are too many information such as discounted
insert image description here
product settlement
insert image description here
and product background, which are not shown here. If you need it, you can contact.

Guess you like

Origin blog.csdn.net/Soncat2000/article/details/127532220
Recommended