Giter VIP home page Giter VIP logo

vote's Introduction

需求说明

  • 实现创建投票表单
  • 显示创建的表单
  • 删除查看在线表单
  • 实现投票的功能
  • 最后显示投票的结果
  • 通过IP来标识用户

开发文档

API 文档

创建投票表单

POST/api/v1/createForm

Req:body

{
    pwd:String, //密码
    title:String, //标题
    options:[
        {
             value:"选项1"
        }
     ]
}

Res

{
    url:String, //链接 如http://localhost/forms/8222
}

获取所有创建的投票

GET /api/v1/forms

Req:Params

{
    pageNum:Number, //页码
    pageSize:Number, //每页几个
}

Res

{
    data:[
        {
            title:String,//标题
            options:[
                {
                    value:"选项1",
                    number:100 //票数,第一次没有,投票后才有
                }
            ]
        }
    ]
}

打开一个投票

GET /api/v1/forms/:formId

Req:Params

{
    pwd:String,//密码
}

Res

{
    data:{
            title:String,//标题
            options:[
                {
                    value:"选项1",
                    number:100 //票数,第一次没有,投票后才有
                }
            ]
        }
}

提交一个表单

POST /api/v1/submitForm

Req:Params

{
    select:Number, // 选择的序号
    ip:String,
    pwd:String,
    formId:String,
}

Res

{
    data:[
        {
            title:String,//标题
            options:[
                {
                    value:"选项1",
                    number:100 //票数
                }
            ]
        }
    ]
}

vote's People

Contributors

lydanne avatar

Stargazers

mainzxq avatar

Watchers

James Cloos avatar  avatar

Forkers

tbpn21 lvduizhang

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.