"Software Architecture and Middleware" Homework 1 Report
——Assignment 1: Software Architecture
Name: Shi Zhuofan Student ID: 120L021011
Table of contents
Project title: Microservice-based online shopping cloud platform
Today, the network economic model is becoming more and more popular, and online shopping is increasingly accepted by everyone. The rapid development of the Internet has subverted the traditional collection, transmission and appearance of information, and provided unprecedented favorable conditions and impetus for the improvement of workers' labor skills and work efficiency. Most of the economic income growth of personal business and enterprises has benefited from the promotion and application of the Internet.
The online shopping cloud platform is the front-end business platform of e-commerce, which plays a very important role in the whole process of business activities. The online shopping system is also a commercial information system. It has powerful interactive functions, can provide users with various information resources, and can facilitate information transmission between merchants and users. The new online and offline integrated marketing model can facilitate Complete electronic trade quickly.
The users of a shopping platform are divided into two categories, one is the administrator, who is responsible for maintaining the products on the shopping platform and managing the brand classification of the products sold on the platform. The other category is ordinary mobile phone customers, who will browse products through the shopping platform and finally turn them into the shopping cart and place an order.
Therefore, for two types of users, our large job project needs to be designed into two small projects, the management end and the client end .
At the same time, in general, the shopping platform has a lot of visits in practice. In order to simulate the real situation, multiple servers are used for deployment, and traffic limiting strategies are used. Therefore, the management end and the client end are deployed in two different clusters.
Figure 1.1 Project deployment diagram
The system can be used by users with different identities to log in. Different users can execute different modules after logging in, mainly as follows:
This system provides administrators who can manage background data, products, employees, brands
The shopping platform allows customers to browse products and shop
Management side:
The management system can log in to the administrator account, log in to the employee account, and the administrator can manage and query the employees, products, and brand categories of an e-commerce trading platform. The information in the background management system allows customers to place orders for e-commerce products on their mobile phones.
client:
Customers can log in, log in with the mobile phone SMS verification code, and then place an order for the product, and place the order by determining the delivery location through location positioning.
The database contains employee table, brand table, good product table;
Brand |
id |
primary key |
name |
brand name |
|
number |
The total number of products contained in the brand |
|
Create_time |
creation time |
|
update_time |
update time |
|
create_user |
founder |
|
update_user |
Edited by |
|
Good |
id |
primary key |
name |
Product name |
|
price |
The selling price of the item |
|
Brand |
The brand the product belongs to |
|
Create_time |
creation time |
|
update_time |
update time |
|
create_user |
founder |
|
update_user |
Edited by |
|
Img |
Product Image URL |
|
Employee |
id |
primary key |
name |
employee's name |
|
status |
Status 0: disabled, 1: normal |
|
username |
username |
|
password |
password |
|
phone |
Phone number |
|
sex |
gender |
|
Id_number |
ID number |
|
Create_time |
creation time |
|
update_time |
update time |
|
create_user |
founder |
|
update_user |
Edited by |
Table 2.2 Database tables and their meanings
In the figure above, the classes of the "control layer" are all named with the suffix "Controller".
For example, "Employee Controller", "Product Controller", "Brand Controller", etc.
(1). Mail-employee module:
● Statically map the backend front-end resources and deploy them on the server ( WebMvcConfig )
●Set the global exception handler, which is responsible for the global exception handling method ( GlobalExceptionHandler )
●According to the requirements, apply the new json object converter by yourself, and extend the message converter of the mvc framework ( JacksonObjectMapper )
● Configure the paging plug-in of MP ( MybatisPlusConfig )
●Employee login interface
●Employee exit
●New employees
●Employee information page query
●Modify employee information according to id
●Query employee information according to id
(2).Mail-brand module:
●New brand
●Paging query of brand information
●Modify brand information according to id
●Query brand information according to id
●Modify the total number of brands according to the brand name
● Returns the total number of specified brands
(3).Mail-good module:
●New product
●Paging query of product information
●Modify product information according to id
●Query product information according to id
●Used to open and display goodslist on the mobile terminal
(4).Mail-loginMessage module:
●Randomly generate a verification code
●Call the api to send a verification code to the specified mobile phone number
In the specific development process, it is implemented according to the Spring Cloud framework and is divided into multiple microservice modules. Each microservice module places classes with different functions in the same package, so the above package diagram will include:
- "Control class" package: Controller
- "Service class" package Service
- "Persistence layer" package Mapping
- "Entity Classes" package: Entity
- "Boundary Representation Classes" package: UI
There is a layer of "service class" between the "control class" and "entity class". The "control class" actually entrusts the "service class" to implement various functions, which can make the functional division of the entire system more clear
As can be seen from the figure above, in the business process of "user purchases",
- Customer logs in with mobile phone number, sends and receives verification code
- Then select the product in Home and add it to the shopping cart
- After the shopping cart is confirmed, check the receipt information and place the final order
As can be seen from the above figure, in the business process of "administrator manages data",
- The administrator logs in with the administrator account password
- After the verification account in the background is passed, all data in the background will be displayed on the home page
- Administrators can add, delete, modify and query on the management page
- After performing the corresponding operation, a successful page will be fed back
Generally, shopping platforms have a large number of visits in practice. In order to simulate the real situation, multiple servers are used for deployment, and traffic limiting strategies are used. Therefore, the management end and client end, middleware, and database are deployed in different clusters
server |
deployment content |
shopping server cluster |
Deploy the shopping platform front end |
Manage server clusters |
Deployment management system backend microservices |
database server cluster |
Deploy databases such as mysql |
middleware server cluster |
Deploy nacos, sentinel and other middleware |