GithubHelp home page GithubHelp logo

taofuli-backend's Introduction

福利列表

curl -X GET http://localhost:3000/api/events/
response:
        {
          "events"=>
          [
            {
              "title"=>"MyString", 
              "url"=>"MyString", 
              "image_url"=>"/uploads/event/image/8/rails.png",
              "amount"=>1, 
              "effective_date"=>"2016-07-14", 
              "expire_date"=>"2016-07-14", 
              "engaged"=>1,
              "available_quota"=>1,
              "content"=>"detail",
              "content_array"=>["hello", "world"],
              "official_benefit"=>"official",
              "official_benefit_array"=>=>["hello", "world"],
              "additional_benefit"=>"additional",
              "additional_benefit_array"=>["hello", "world"]
            },
            ....
          ]
        }

获取某个福利详情

curl -X GET http://localhost:3000/api/events/{event.id}

获取用户信息

curl -X GET --header "Authorization: Token token=#{openid}" http://localhost:3000/api/users/get_info
response:
        {
          "name"=>"foobar",
          "cell"=>"1111111111",
          "email"=>"[email protected]",
          "gender"=>"男"
          "state"=>"权益未激活"
        }

更新用户信息

curl -X PATCH --header "Authorization: Token token=#{openid}" -d "name=foobar&..." http://localhost:3000/api/users/update_profile
params: {
          "name"=>"foobar",
          "cell"=>"1111111111",
          "email"=>"[email protected]",
          "gender"=>"男"
        }

商务合作

curl -X POST -d "name=foobar&..." http://localhost:3000/api/customers/
params:   {
            "name"=>"foobar",
            "cell"=>"11111111111",
            "qq"=>"1111111111",
            "desc"=>"many words"
          }
response:
        201 ok;422 ng

创建福利记录

curl -X POST --header "Authorization: Token token=#{openid}" -d "event_id=1" http://localhost:3000/api/orders/
response:
        201 ok;422 ng

福利记录列表

curl -X GET --header "Authorization: Token token=#{openid}" http://localhost:3000/api/orders/
response:
        {
          "orders"=>
          [
          {
            "id"=>34, 
            "date"=>"2016年7月15日", 
            "event_title"=>"MyString", 
            "amount"=>1, 
            "state"=>"未派发"
          },
          ...
          ]
        }

获取signature

curl -X GET -d "url=http://www.baidu.com" http://localhost:3000/api/wx_get_jsapi_ticket

taofuli-backend's People

Contributors

ken-wong avatar

Watchers

James Cloos avatar Super avatar

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.