An introduction to one of the tutorials for developing lottery analysis tools in the Go language beego framework

Two months before the Spring Festival in 2020, a friend asked me if I could develop a software to analyze the ranking of five lottery winnings. I probably understood his needs and felt that the software could be developed, so I agreed to him.

The main function point of this:
collect lottery numbers and put them into storage.
Manually add lottery numbers into storage.
Set the number selection rule and save it.
Analyze and view the winning probability of the lottery rules.
Export the TXT file of the number generated by the number selection rule.

After the functions are determined, the selection of programming development languages ​​and frameworks begins. I have been developing projects with the ThinkPHP framework of the PHP language before. If I develop this small tool software in PHP, it can be easily written. The Spring Boot framework of the Java language also probably understands that it is no problem to do it. The Go language is a relatively new language. It is said that the concurrency performance is very strong, and it is also complained that it does not have generics, and the exception handling mechanism is not friendly enough. After thinking about it, I finally chose Go + Beego to do this project. The main reason is that an executable EXE file can be compiled and used, and the deployment is very convenient.

After the rear-end selection is completed, it is the turn of the front-end tangled selection. Whether to use Vue.js as the front-end basic framework or to use jQuery, after a painful ideological struggle, I still choose the front-end framework AdminLTE of jQuery + Bootstrap for development. The reason is that I don't have the need to separate the front and back ends. Vue.js has no experience in using it, and I am more familiar with jQuery.

It turned out that I wanted to design a software prototype first and then enter the development stage. Considering that I can only spare 1-2 hours a day to do this project, I have to learn the basic knowledge of the Go language and the Beego development framework at the same time. The time is tight, so I am lazy. The prototyping link is omitted and goes directly to the database design. Using PowerDesigner database modeling software to design the following entities: user, administrator, arrangement five, coding rules, probability statistics.

User related table

Arrange five related tables

After hard work, the functions of the first version were finally completed on the 29th of the Spring Festival in 2020. The picture above is for reference.

This article was originally published by the open source Chinese author [Open Source Letu CRM], and may not be reproduced without permission.

Welcome to pay attention to the first time to get original sharing content.

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324061805&siteId=291194637