Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lydanne/vote
一个小型的投票系统
https://github.com/lydanne/vote
Last synced: 6 days ago
JSON representation
一个小型的投票系统
- Host: GitHub
- URL: https://github.com/lydanne/vote
- Owner: Lydanne
- License: apache-2.0
- Created: 2020-06-03T07:38:31.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T08:35:57.000Z (almost 2 years ago)
- Last Synced: 2024-08-10T07:48:24.669Z (3 months ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# 需求说明
- 实现创建投票表单
- 显示创建的表单
- 删除查看在线表单
- 实现投票的功能
- 最后显示投票的结果
- 通过IP来标识用户# 开发文档
## API 文档
### 创建投票表单
POST`/api/v1/createForm`
Req:body
```js
{
pwd:String, //密码
title:String, //标题
options:[
{
value:"选项1"
}
]
}
```Res
```js
{
url:String, //链接 如http://localhost/forms/8222
}
```### 获取所有创建的投票
GET `/api/v1/forms`
Req:Params
```js
{
pageNum:Number, //页码
pageSize:Number, //每页几个
}
```Res
```js
{
data:[
{
title:String,//标题
options:[
{
value:"选项1",
number:100 //票数,第一次没有,投票后才有
}
]
}
]
}
```### 打开一个投票
GET `/api/v1/forms/:formId`
Req:Params
```js
{
pwd:String,//密码
}
```Res
```js
{
data:{
title:String,//标题
options:[
{
value:"选项1",
number:100 //票数,第一次没有,投票后才有
}
]
}
}
```### 提交一个表单
POST `/api/v1/submitForm`
Req:Params
```js
{
select:Number, // 选择的序号
ip:String,
pwd:String,
formId:String,
}
```Res
```js
{
data:[
{
title:String,//标题
options:[
{
value:"选项1",
number:100 //票数
}
]
}
]
}
```