Voter
Voter copied to clipboard
:cn: Simple online vote system based on Spring Boot | 基于SpringBoot的简约投票系统 | :sunglasses: COOL & MODERN | ANONYMOUS | Bootstrap | :cupid: Good looking
Voter
:cn: Simple online vote system based on Spring Boot | åºäºSpringBootçç®çº¦æç¥¨ç³»ç» | :sunglasses: COOL & MODERN | ANONYMOUS | Bootstrap | :cupid: Good looking
:construction_worker: é¨ç½²ä¸éå°é®é¢ï¼:heavy_plus_sign: æç微信å·ï¼1101635162 :ok_hand: æ å¿å¸®å©ä½ è§£å³é®é¢ã
English Version
é¢è§ Preview
å ¬å¼æµè¯ç½ç« | Public Test Website

ä¸æè¯´æ
è¿è¡
æ¬é¡¹ç®ä½¿ç¨Intellij IDEAæå»ºï¼ä½ å¯ä»¥ä½¿ç¨IDEAç´æ¥è°è¯æ¬é¡¹ç®ã
é ç½®MySQLæ°æ®åº
Voteré»è®¤ä½¿ç¨MySQLä¸çVoteråºã
å¨å¼å§ä½¿ç¨ä¹åï¼è¯·å¨ä½ çMySQLä¸å
å建ä¸ä¸ªå为"Voter"çæ°æ®åºã
èªå¨çæè¡¨
Voteréæäºèªå¨çææ°æ®è¡¨çåè½ãç¼è¾ç±»pers.adlered.voter.configuration.MySQL类使项ç®å¨å¯å¨æ¶èªå¨é¨ç½²æ°æ®è¡¨ã
注æï¼é ç½®æ¤ç±»åªæ¯ä¸ºäºèªå¨çææ°æ®è¡¨ï¼å¦æä½ æ³ä¸ºVoteré ç½®è¯»åæ°æ®åºè¿æ¥ï¼è¯·é ç½®application.propertiesæä»¶ä¸çåæ°ã
请注æï¼å¦æä½ æ³æå¨å»ºè¡¨ï¼å¯ä»¥æ§è¡ä¸åè¯å¥ï¼
USE Voter;
CREATE TABLE `Voter_Vote` (
`VID` int(11) NOT NULL AUTO_INCREMENT,
`Title` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
`Describe` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
`Selection` varchar(10000) CHARACTER SET utf8mb4 DEFAULT NULL,
`Type` int(11) DEFAULT '0',
`Limit` int(11) DEFAULT '-1',
PRIMARY KEY (`VID`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
INSERT INTO `Voter_Vote` VALUES (1, 'This is a vote title :)', 'And here is a describe of the vote XD', '<%1<%92<%Vote for Xiaoli<%2<%42<%Vote for Zhanghua<%3<%41<%Vote for Ergou<%4<%37<%Vote for Guawazi<%5<%48<%Vote for Benwei<%6<%50<%Vote for Adler', 0, 2);
é ç½®æ°æ®åºè¿æ¥
å½å»ºç«å®ææ°æ®åºåï¼é
ç½®application.propertiesæä»¶æ¥é
ç½®æ°æ®åºè¿æ¥ã
å·¥ä½åç
å®ç°ä¸ä¸²å符串å卿ææç¥¨é项ç»è®¡
åå¨å¨æ°æ®åºä¸çSelectionTextåæ®µå¦ä¸ï¼
<%1<%0<%Vote for Xiaoli
<%2<%10<%Vote for Zhanghua
<%3<%20<%Vote for Ergou
<%4<%30<%Vote for Guawazi
<%5<%40<%Vote for Benwei
<%6<%50<%Vote for Adler
è§å®çæç¥¨åå¨è¯æ³å¦ä¸ï¼
<%é项å·<%è·å¾ç¥¨æ°<%é项æè¿°
éè¿pers.adlered.voter.analyzerä¸çæ¹æ³å¯¹æ¤å段å®ç°åæä¸ä¿®æ¹ã
English Version
Run
This project is built using Intellij IDEA, you can use IDEA to debug this project directly.
Configuring the MySQL database
Voter defaults to the Voter library in MySQL.
Before you start using it, create a database called "Voter" in your MySQL.
Automatically generating tables
Voter integrates the ability to automatically generate data tables. Editing the class pers.adlered.voter.configuration.MySQL class enables the project to automatically deploy the data table at startup.
**Note: This class is configured only to automatically generate data tables. If you want to configure read and write database connections for Voter, configure the parameters in the application.properties file. **
Please note: If you want to build a table manually, you can execute the following statement:
USE Voter;
CREATE TABLE `Voter_Vote` (
`VID` int(11) NOT NULL AUTO_INCREMENT,
`Title` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
`Describe` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
`Selection` varchar(10000) CHARACTER SET utf8mb4 DEFAULT NULL,
`Type` int(11) DEFAULT '0',
`Limit` int(11) DEFAULT '-1',
PRIMARY KEY (`VID`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
INSERT INTO `Voter_Vote` VALUES (1, 'This is a vote title :)', 'And here is a describe of the vote XD', '<%1<%92<%Vote for Xiaoli<%2<%42<%Vote for Zhanghua<%3<%41<%Vote for Ergou<%4<%37<%Vote for Guawazi<%5<%48<%Vote for Benwei<%6<%50<%Vote for Adler', 0, 2);
Configuring database connections
After creating the database, configure the application.properties file to configure the database connection.
working principle
Implement a string of strings to store all voting option statistics
The SelectionText field stored in the database is as follows:
<%1<%0<%Vote for Xiaoli
<%2<%10<%Vote for Zhanghua
<%3<%20<%Vote for Ergou
<%4<%30<%Vote for Guawazi
<%5<%40<%Vote for Benwei
<%6<%50<%Vote for Adler
The prescribed voting storage syntax is as follows:
<% option number <% get votes <% option description
Analyze and modify this field by the method in pers.adlered.voter.analyzer.