I am participating in the Mid-Autumn Festival Creative Submission contest. Please see:Mid-Autumn Festival Creative Submission Contest

preface

The Golden Nine years ushered in one of China’s four traditional festivals [Mid-Autumn Festival]. The Mid-Autumn Festival, also known as offering to the moon festival, moon Festival, Moon Festival, Autumn Festival, Zhongqiu Festival, worship the moon festival, moon niang Festival, moon Festival, reunion Festival, etc., is a traditional Chinese folk festival. Since ancient times, the Mid-Autumn Festival has been offering sacrifices to the moon, enjoying the moon, eating moon cakes, playing lanterns, enjoying osmanthus flowers, drinking osmanthus wine and other folk customs, spread to the present, enduring. Mid-Autumn Festival is approaching, I wish my friends in advance:

The Mid-Autumn festival

A month, a cake, a blessing;

Have you, have me, have friendship;

Have hair, money, no BUG!

Of course, as a program ape, we are also expressing our best wishes to the Mid-Autumn Festival in various forms in the traditional Chinese festivals. If you have used SpringBoot before, you will often see the console printing the SpringBoot Logo and version information during startup projects, as shown in the following figure. This article will be based on the Spring Boot Banner program ape on the Mid-Autumn Festival blessing.

. ____ _ __ _ _ / \ \ / ___ '_ __ _ _) (_ _ __ __ _ \ \ \ \ (\ ___ () |' _ | '_ | |' _ \ / _ ` | \ \ \ \ \ \ / ___) | | _) | | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.3.0. RELEASE)Copy the code

What is the Banner

Banner generally refers to Banner advertising. Banner Ad is the earliest form of network advertising, is also the most common form at present. Banner ads, also known as banner ads, are rectangular bulletin boards that stretch across a web page. When a user clicks on these banners, they usually link to the advertiser’s web page.

Spring Banner in the Boot

When we start the SpringBoot project, the console will print the SpringBoot Banner and version information. We believe that partners are familiar with the SpringBoot Banner, so if we support custom Banner in our own project? The answer is yes, we can support custom banners. Let’s begin. In the Spring in the Boot, SpringBoot has an interface org. Springframework. Boot. The Banner is specialized to do the operation. The banner is enabled by default. When we do not need to enable the banner, we can turn it off. The closing code is as follows:

        SpringApplication springApplication = new SpringApplication(DemoSwaggerBootstrapUiApplication.class);
        springApplication.setBannerMode(Banner.Mode.OFF);
        springApplication.run(args);
Copy the code

I believe that more friends need to start the Banner, so we can directly use the Main method to start. The following code:

@SpringBootApplication @MapperScan(value = "com.example.demo.mapper") public class DemoSwaggerBootstrapUiApplication { public static void main(String[] args) { SpringApplication.run(DemoSwaggerBootstrapUiApplication.class, args); }}Copy the code

When we use a custom Banner, we only need to add the character set of the Banner and the filename of the Banner in the configuration file. As follows, the banner we need to add is the information in the following figure:

spring.banner.charset=UTF-8
spring.banner.location=classpath:banner
Copy the code

The banner file contains the following information:

_ooOoo_ o8888888o 88" . "88 (| -_- |) O\ = /O ____/`---'\____ .' \\| |// `. / \\||| : | | | / / / / _ | | | | | - : - | | | | | - \ | | \ \ \ / / / | | | \ _ | '\ - /' | | \. - \ __ ` ` ___ - / - / ___ `.. '/ -- -- \ `. __. ""'" `. ___ \ _ < | > _ / ___. "" '>'. | | : ` - \ `; ` \ _ / `; . ` / - ` : | | \ \ ` - \ _ __ \ / __ _ /. - ` / / = = = = = = ` - ____ ` - ___ \ _____ / ___ - ` _____. - '= = = = = = = - =' ` ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ the Buddha bless never BUGCopy the code

After running the project, the banner is changed to the banner we set

You can customize a Mid-Autumn Festival Banner

The common online generation tools for setting banners are as follows.

www.bootschool.net/ascii

Patorjk.com/software/ta…

www.degraeve.com/img2txt.php as above three online tools. Contains banners of text type and image type. The first two online tools generate ordinary text type, the third tool can directly generate the image required banner information, we enjoy a few.

Happy Mid-Autumn Festival

The moon cake

Mid-Autumn Festival, how can the moon cakes, ha ha, the moon cakes below.

The previous chapter lottery

11. Spring Boot integrates with AutoGenerator code generator

Thanks for your comments, lucky draw was held at 2021-09-11 11:35:00, and two lucky readers were selectedThank you again and ask both readers to contact the author.

Screenshot of the drawing video is as follows:

Lucky readers [Rubble】

Lucky readers [NewBoy】

Congratulations to the above two lucky commenters who will receive a new nugget badge from the Nuggets.

conclusion

Ok, more fun banner you can design according to your needs. I wish you all a happy Mid-Autumn Festival, good health, smooth work and good luck in everything.

About the author: [Little Ajie] a love tinkering with the program ape, JAVA developers and enthusiasts. Public number [Java full stack architect] maintainer, welcome to pay attention to reading communication.

Well, thank you for reading, I hope you like it, if it is helpful to you, welcome to like collection. If there are shortcomings, welcome comments and corrections. See you next time.