How to copy other people's code and write your own project

How to copy other people's code and write your own project

One-click replacement:

Select a name, such as good, and press ctrl+shift+alt+j to select all good in the current page, and enter the one you want to replace.

The first step:
establish a database.

Step 2:
imitate the previous sys module to build your own module, such as good, build dao, service, controller, entity, and service under the module and build impl.

Step 3:
Write the entity class corresponding to the database under entity (note that @Data annotation is added to the class);

the fourth step:

1. Create the corresponding xxxDao in the dao package. Note that the annotation @Mapper is added to the xxxdao, and the generic type of the inherited class is its own entity class;

2. In the service package xxxservice, the generic type of the inherited class is its own entity class;

3. In the impl package xxxserviceImpl, add the annotation @Service ("the class name of the parent interface service"), the first generic of the inherited class ServiceImpl is its own xxxDao class, and the second generic is its own entity class;

4. In the mapper under resource, imitating these corresponding xxxmappers, modify the path in the namespace in the mapper file to the path of your own xxxDao.

Step 5:
Create a corresponding controller by imitating under the controller, replace sys with the name of the second part of your own module with one click, capitalize the first letter of your module name with Sys, and then replace the entity class, service, dao with your own class with one click .

Guess you like

Origin blog.csdn.net/weixin_45753248/article/details/111396865