当前位置:网站首页>Practice of online problem feedback module (III): automatically generate all controller, service, mapper and other files
Practice of online problem feedback module (III): automatically generate all controller, service, mapper and other files
2022-07-18 06:12:00 【Bug bacteria ¹】
author :bug bacteria
official account : Ape circle wonderful house
important clause : Originality is not easy. , For reprint, please attach the original source link and this statement , Thank you for your cooperation .
Copyright notice : Some words or pictures in the article may come from the Internet or Baidu Encyclopedia , If there is infringement, please contact bug Bacterial treatment .
One 、 Preface
The next few issues ,bug I want to share with you that I just received a temporary demand yesterday , It's hot , I would like to share how I faced the temporary requirements and made the whole development cycle , It includes sorting out businesses, creating business tables, realizing business logic to form a closed loop, and connecting with the front end , Some business development and functional development will be interspersed , This one-stop process is witnessed online with you , Share with the novice , I hope it will help you .
Environmental statement :idea2019.3 + springboot2.3.1.REALSE + mybati-plus3.2.0 + mysql5.6 + jdk1.8
If the partners feel that the article is helpful to you in the process of reviewing the article , Please don't be stingy with your praise , Boldly put the article Lighten up Well , Your likes are three in a row ( Collection ️+ Focus on + Leaving a message. ) That's right bug The best encouragement and support on my creative path . Time does not give up *️, Create constantly , come on. ️
Two 、 Text
And the specific call , In fact, it is in this sentence that . The purpose is to generate the corresponding file according to the table name you enter . Is terby's humanized convenience easy to use .
strategy.setInclude(scanner(" Table name , Multiple English comma splits ").split(","));So I hope my friends who have used it , Can you give me some support , Easy to use things should be analyzed for everyone It's right to be happy together .
Then comes the experiment , Is it useful , It depends on me to perform it and show you . I'll add a new one here sys_questions Take table as an example .
I run it directly MyGenerator Medium main The main function . Then input sys_questions Back carriage return . You can see , The following screenshots , Those files have been generated directly .

If you don't believe it, you can check it under the corresponding folder , I won't show you screenshots here , After all, the content output of the console after execution is obvious . I have told you the corresponding generated file and its location . In fact, it has been proved to be generated .
There is another thing , Although it is generated , In fact, some automatically generated file codes need to be manually modified , It's not perfect , There's a flaw , But you can also not change , I am one of those people with typical obsessive-compulsive disorder , So I will change this to my code style .
For example, the generated entity class , The native one is created for us in this format by default . This is definitely not what we want , It is also an irresponsible way of writing , We need not only to modify @ApiModel Of value And describtion All have to be modified so that developers can understand it at a glance .
![]()
Because this is the mapping of the corresponding database field table , So the best name is , First of all , Can you consider what this table is for , Second, bring the entity name , that will do .
such as :value = Problem feedback information entity .description=" Tracking user problem feedback information entity ", In this way, you know what you mean , One can know at a glance that this watch is dry , It is also conducive to subsequent maintenance personnel to understand or rewrite .
Secondly , That is, the primitive entity class does not have @TableName Annotated , We'd better add , Specify the mapping database table name . such as : This is how I specify it here .
@TableName("user_questions")Screenshot of database table :

So you just add the corresponding table name you need to map to the annotation . Everyone should understand this , There is no need for me to introduce the detailed use of this annotation ?
... ...
All right. , The above is all about this issue , Have you learned to give up ? If it helps you , Please don't forget to give bug bacteria [ Three companies support ] yo . If you want to get more learning resources or want to communicate with more technology enthusiasts , You can pay attention to my official account. 『 Ape circle wonderful house 』, The backstage replies the key words to get the learning materials 、 Big factory surface 、 Interview templates and other massive resources , Just wait for you to get .
3、 ... and 、 I recommend
For the actual development of the problem feedback module , I combed the teaching and link address of each issue completely , For reference only : I hope it can help you .
- Practice of online problem feedback module ( One ): Sort out business requirements and create database tables
- Practice of online problem feedback module ( Two ): Encapsulate code to automatically generate class file
- Practice of online problem feedback module ( 3、 ... and ): Automatically generate all Controller、Service、Mapper Wait for the documents
- Practice of online problem feedback module ( Four ): Encapsulate generic field classes
- Practice of online problem feedback module ( 5、 ... and ): Realize the automatic filling function of general field content
- Practice of online problem feedback module ( 6、 ... and ): Interface document definition
- Practice of online problem feedback module ( 7、 ... and ): Installation and deployment swagger2
- Practice of online problem feedback module ( 8、 ... and ): Realize image upload function - Part 1
- Practice of online problem feedback module ( Nine ): Realize image upload function - The next part
- Practice of online problem feedback module ( Ten ): Realize the picture preview function
- Practice of online problem feedback module ( 11、 ... and ): Realize the picture download function
- Practice of online problem feedback module ( Twelve ): Realize the function of deleting pictures
- Practice of online problem feedback module ( 13、 ... and ): Realize multi parameter paging query list
- Practice of online problem feedback module ( fourteen ): Realize the online question answering function
- Practice of online problem feedback module ( 15、 ... and ): Realize the function of online updating feedback status
- Practice of online problem feedback module ( sixteen ): Realize the function of checking details
- Practice of online problem feedback module ( seventeen ): Realization excel Template online download function
- Practice of online problem feedback module ( eighteen ): Realization excel Batch import function of account file records
- Practice of online problem feedback module ( nineteen ): Realize batch export of data to excel Function in file
- Practice of online problem feedback module ( twenty ): Conclusion
The above is the content of 20 issues , Each issue is dry , For the development of a module , How to build and test the deployment online bit by bit , I'll say it again , This is not an exercise , It's actual combat ! It's actual combat ! It's actual combat !
If you think you just need to understand one of the knowledge points or business , No objection , Just choose a few of them to study , It's all over anyway ; I just hope you can gain something , Grow up , It's not in vain for me to summarize and update you after work every day .
Four 、 At the end of the article
If you want to learn more , Little friends can pay attention to bug I created a special column for you 《springboot Zero basic introductory teaching 》, It's all my hands , Ongoing update , I hope I can help more friends .
I am a bug bacteria , A procedural ape who wants to get out of the mountain and change his fate . There's a long way to go , Are waiting for us to break through 、 To challenge . Come on , friends , Let's cheer together ! The future can be expected ,fighting!
Finally, I'll give you two words I like very much , Share with you !
️ Be what you want to be , No time limit , As long as willing , Anytime? start.
You can change... From now on , It can be the same , This matter , There are no rules , You can live your best .
If the article helps you , Just leave your Fabulous Well !(#^.^#);
If you like bug Sharing articles , Just... Please bug Bacteria point Focus on Well !(๑′ᴗ‵๑)づ╭~;
If you have any questions about the article , Please also at the end of the text Leaving a message. perhaps Add group Well 【QQ Communication group :708072830】;
Given the limited personal experience , All viewpoints and technical research points , If there is any objection , Please reply directly to participate in the discussion ( Do not make offensive remarks , thank you );
Copyright notice : Originality is not easy. , For reprint, please attach the original source link and this statement , copyright , Piracy must be investigated !!! thank you .
边栏推荐
- 原厂直销MOS管 KNL42150 2.8A/1500V 适用光伏逆变器 可提供样品
- Some notes on kubelet in kubernetes
- 在线问题反馈模块实战(二):封装代码自动生成类文件器
- Foundation of deep learning: 9 Reproduce classic networks: lenet5 and alexnet
- @EqualsAndHashCode注解的使用
- 讓企業數字化砸鍋和IT主管背鍋的軟件供應鏈安全風險指北
- @RequestBody
- 关于 c 打印异常的问题
- 杰理之内置触摸可供修改的参数【篇】
- O & M - mélange de compétences
猜你喜欢

迪文串口屏教程(1)

Dimitra and ocean protocol interpret the secrets behind agricultural data

让企业数字化砸锅和IT主管背锅的软件供应链安全风险指北

在线问题反馈模块实战(三):自动生成所有Controller、Service、Mapper等文件

How can win11 maximize the software interface by default? Win11 opens the software interface by default to maximize

Matplotlib绘图报错:“! LaTeX Error: File `type1cm.sty‘ not found.“ 解决办法

IM即时通讯软件开发之扫码登录功能

阿里内网疯传的P8“顶级”分布式架构手册被我拿到了

深度学习基础:9.复现经典网络:LeNet5与AlexNet

i7-12700H 和 R7-6800H,这两个 CPU 差距有多大?
随机推荐
SYD_ Calculator skill 2 [manage cos]
Web开发人员的10个数据库优化最佳实践
差距大?不同学历考生考研的要求和条件
Go+mysql+redis+vue3 simple chat room, the fourth bullet: Gin's websocket communication and multi go task processing
Engineering monitoring vibrating wire wireless acquisition instrument external digital sensor access logic and data transmission
爆肝万字,终于搞定这篇神经网络搭建全全全流程!学不会你来找我~
Some notes on kubelet in kubernetes
2022年安全员-A证考试题目及在线模拟考试
Foundation of deep learning: 8 Convolution and pooling
杰理之本修改解码时钟的方法【篇】
关于Kubernetes中kubelet的一些笔记
Loj#576-「LibreOJ NOI Round #2」签到游戏【线段树】
In the new era of digital cockpit, the insight and prediction of head enterprise Botai
华为通用卡证识别功能,一键实现多种卡绑定
What is the real HTAP? (1) Background article
使用Excel2016的函数生成随机16、32、36位ID字符串内容
杰理之N 开了 1 拖 2 功能会影响蓝牙距离【篇】
Matplotlib绘图报错:“! LaTeX Error: File `type1cm.sty‘ not found.“ 解决办法
炒期货到哪里开户?如何开户更安全?
三维重建之线结构光(一)