[Lilishop Mall] No3-5. Module detailed design, product module-1 (commodity classification, brand management, specification management, parameters, measurement unit, store classification) detailed design

  Only the backend is involved, see the top column for all directories, codes, documents, and interface paths are:

[Lilishop Mall] Record the study notes of the B2B2C mall system~


The whole article will combine the business introduction to focus on the design logic, including the interface class and business class. The specific combination of source code analysis is not complicated to read~

Caution: Some comments in the source code are wrong, some comments have completely opposite meanings, and some comments are not correct. I updated them during the reading process and added new comments where I did not know. So be careful when reading the source code!

 

Table of contents

A1. Unit of measurement

B1.M terminal (belongs to explicit operation) 

B2.S terminal (belongs to explicit operation)  

A2. Brand management

B1.M terminal (belongs to explicit operation)  

A3. Specification management

B1.M terminal (belongs to explicit operation)  

B2.S terminal (belongs to explicit operation)  

A4. Parameters (strongly belong to commodity category)

B1.M terminal (belongs to explicit operation)  

 C1. The interface of commodity classification parameter group

 C2. The interface of the parameters in the commodity classification parameter group

B2.S terminal (belongs to explicit operation)  

A5. Commodity classification

B1.M terminal (belongs to explicit operation)  

C1. Commodity classification interface

C2. Commodity classification-brand interface

C3. Commodity classification-specification interface

C4. Commodity classification-parameter interface

B2.S terminal (belongs to explicit operation) 

C1. Commodity classification interface (which includes the query associated brand interface)

C2. Commodity classification-specification interface

C3. Commodity classification - parameter group interface

A6. Store classification

B1.S terminal (belongs to explicit operation)  


The management of product information is mainly on the S-side of the store. The auxiliary information related to the product, such as product classification, is jointly managed by the M-side of the operation and the S-side of the store. The B-side of the buyer is mainly used for viewing and placing orders, so this article does not include The viewing interface of the B-side, and the interface of the buyer's B-side front desk are explained in an article. [However, the shopping cart and order will be explained together with the order~]

Before we start, let’s talk about the relationship between these modules:

1. Although the parameters in specifications and product categories are strongly related to product categories, they are weakly related to products (specifications are directly converted into json and stored in goods_sku, and parameters are converted into json and stored in goods), so their modifications cannot be changed. Affects classification and commodities; the unit of measurement is also the same, directly save the value in goods;

2. The brand is directly associated with the product, and is also associated with the product category. The product and product category are directly related to the display operation, so deleting/disabling the brand needs to determine whether there is an associated product and category, and deleting the product category needs to determine whether it is related Commodities (the reason why disabling does not affect is because prohibition or disabling does not affect the front-end viewing, and the commodity will be re-selected at that time)

3. The related information of the product, such as album, sku, etc., is attached to the product and will not be modified separately.

 Next, let’s start with the smallest related module~~~The product will be put in the next article~~~

A1. Unit of measurement

There is nothing to say about this, it is the addition, modification and deletion of the unit of measurement, and the text content directly saved when the product is selected is not the id (there is no need to bind the id, because there is no need for such a strong binding relationship)

B1.M terminal (belongs to explicit operation) 

  • Pagination to obtain commodity measurement unit, obtain commodity measurement unit, add commodity measurement unit, edit commodity measurement unit, delete commodity measurement unit

 

B2.S terminal (belongs to explicit operation)  

The unit list is only obtained on the product release page. Here, the backend uses pagination, but the frontend does not perform paging or lazy loading, so the frontend still obtains everything~

  • Get the unit of measure of the product by page

A2. Brand management

Operate the M terminal to manage the brand, and then bind the brand to the product category. When releasing a product on the S-side of the store, select the product category first, and then obtain the brand bound to the product category for selection and binding. Therefore, the brand is bound to the product through the product category.

The operation of this part of the brand and product classification is in the product classification (see product classification).

Deleting/disabling a brand requires judging whether there are related products and categories~~~ This is placed in code development

B1.M terminal (belongs to explicit operation)  

Operate the M terminal management brand

  •  Obtain brand details by id, obtain all non-disabled brands, obtain by page, add new brand, update data, enable/disable brand in the background, delete in batches

Get all non-disabled brands for product classification page calls 

  

   

B2.S end (this end does not need an interface)  

The S terminal itself is a brand obtained according to the product classification, so no special controller is provided, and this interface is placed in the product classification (see the product classification S terminal)

  

 

A3. Specification management

I also mentioned the relationship between specifications and products before, and you can choose the specifications in the product category. Moreover, the specifications when publishing products can be customized, that is to say, the specifications here are a convenient and quick choice, and naturally do not need to be strongly associated with the products.

The operation of this section of specifications and commodity classification is in commodity classification (see commodity classification).

B1.M terminal (belongs to explicit operation)  

It is more convenient to separate rule values ​​with commas.

  • Get all available specs, search specs by page, save specs, change specs, delete in bulk

Get all available specifications for product category page calls 

  

B2.S terminal (belongs to explicit operation)  

The S-side will only be viewed on the release product page

  • Obtain category specifications based on categoryId

   

A4. Parameters (strongly belong to commodity category)

As mentioned before, commodity classification is related to parameters, specifications, and brands, and now there is still one parameter missing.

The parameter module is composed of parameter groups and parameters. Multiple parameter groups can be added to a product category; see the data tables: li_category_parameter_group, li_parameters [the names of these two tables cannot be put together, it is difficult to associate and imagine]

B1.M terminal (belongs to explicit operation)  

 C1. The interface of commodity classification parameter group

  • Query the parameter group information bound under a category, save the parameter group data, update the parameter group data, delete the parameter group by id

 

 C2. The interface of the parameters in the commodity classification parameter group

  • Add parameters, edit parameters, delete parameters by id 

But pay attention, there is a bug in the code, there should be a parameter type in the parameter, which is used to mark whether the parameter is optional or filled in manually, and it is also in the database table, but there is no such field in the entity class, so when saving it in the end This parameter is null, if you want to restore the use, you can add it yourself

    

   

B2.S terminal (belongs to explicit operation)  

The S terminal is also obtained according to the product classification, and only parameter values ​​can be edited, and parameter items cannot be customized.

The S-side will only be viewed on the release product page.

  • Query the parameter information bound under a category  

A5. Commodity classification

Commodity categories are associated with parameters, specifications, and brands, and the associated operations are separated from the addition, modification, and deletion of categories. Therefore, commodity categories have a separate controller interface, and other associations have their own controller interfaces.

B1.M terminal (belongs to explicit operation)  

C1. Commodity classification interface

  • Query the list of all subcategories under a certain category, add product categories, modify product categories, delete categories by id, disable/enable categories in the background

   

C2. Commodity classification-brand interface

  • Query the brand information bound under a certain category, save the brand information bound under a certain category

   

C3. Commodity classification-specification interface

  • Query the specification information bound under a certain category, save the specification information bound under a certain category

   

C4. Commodity classification-parameter interface

It is the parameter interface in A4.

  

B2.S terminal (belongs to explicit operation) 

C1. Commodity classification interface (which includes the query associated brand interface)

When publishing products on the S side of the store, first obtain the product category. This product category is in the business category selected when registering, and it is not owned by the platform~ 

  • Obtain the classification of store operations, and obtain the brand information associated with the selected classification

  

C2. Commodity classification-specification interface

  • Query the specification information bound under a category

   

C3. Commodity classification - parameter group interface

  • Query the parameter information bound under a category

  

A6. Store classification

When the store is classified, it only belongs to the store management, and it is used for displaying on the homepage of the B-end front store. This is very simple. are classified according to level.

In terms of business logic, when publishing a product, you can bind the store category, and when deleting the store category, binding his product will not have an impact, because it will not affect the viewing at any end~so there will be no strong association~~~

B1.S terminal (belongs to explicit operation)  

  • Get the current store product category list, get store product category details, add store product category, modify store product category, delete store product category

   

Guess you like

Origin blog.csdn.net/vaevaevae233/article/details/128263513