actooors / vote_tool Goto Github PK
View Code? Open in Web Editor NEWThis is a simple vote tool
This is a simple vote tool
http://localhost:8081/api/vote/groupPullVote
会
{"code":"FAILED","message":"请登录","data":null}
http://localhost:8081/api/vote/partyPullVote
就是
{"code":"SUCCESS","message":null,"data":null}
没有问题.
注: 我没连校园网, 但为什么会在这里提示我没有登录??
计票员
进行一次投票
党接口格式/api/vote/partyPullVote
团接口格式/api/vote/groupPullVote
POST请求
{
"data":[
{
"voted": true,
"name":"金东寒"
},
{
"voted": false,
"name":"殷子良"
}
]
}
{
"code":"success",
"message":"",
"data":""
}
管理员界面
对应返回每位候选人得票数的相似接口
返回的是每位候选人得票百分比
POST请求(既然你都用了post那就全部post拉倒了),返回所有候选人得票百分比
同样 order为0为无序,1为有序
党代表接口格式/api/user/partyPercentage
团代表接口格式/api/user/groupPercentage
"order":"0"
{
"code": "SUCCESS",
"message": null,
"data": [
{
"name": "1",
"num": 2%
},
{
"name": "10",
"num": 1%
},
{
"name": "王五",
"num": 1%
},
{
"name": "12",
"num": 1%
}
]
}
管理员界面
对应返回得票总数
GET请求
党代表接口格式/api/vote/partyAllvoteNum
团代表接口格式/api/vote/groupAllvoteNum
{
"code": "SUCCESS",
"message": null,
"data": 661
}
计票员界面
返回计票员投票次数接口,每次当成功投票,次数均会+1
POST请求,返回机票次数
党代表接口格式/api/user/partyVoteNum
团代表接口格式 /api/user/groupVoteNum
{
"code": "SUCCESS",
"message": null,
"data": {
"countNum":2
}
}
使用一卡通登录,无需token有效期,只需登录即可
登录接口
接口格式为/api/login
POST请求,请返回token及用户的身份,identy1是计票员,2是管理员
{
"uid":"16122131",
"password":"xxxxx"
}
{
"code":"SUCCESS",
"message":null,
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxNjEyMTY2NiIsImV4cCI6MTUyNzc2NzExMiwiaWF0IjoxNTI3MzM1MTEyfQ.bRBUXRrKn3A4vGg5VrpIpeaSGgBo-bRs8xxoKRUGfLKsEhzs9-3ku2xJR9-reN4XwY5LvaAy0XV8tg6Z3ac8Uw",
"identity":1
}
}
管理员界面
返回投票人信息接口,一开始计票员可以选择党代表或者是团代表,两者返回不同的数据
下面以党代表为例,团代表格式一样
POST请求,order为0返回未排序结果,order为1返回按照投票数从大到小排序结果
党代表接口格式/api/vote/partyVote
团代表接口格式/api/vote/groupVote
{
"order":0
}
{
"code": "SUCCESS",
"message": null,
"data": [
{
"name": "1",
"num": 2
},
{
"name": "10",
"num": 1
},
{
"name": "王五",
"num": 1
},
{
"name": "12",
"num": 1
}
]
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.