Git Product home page Git Product logo

plus1core's Introduction

#Plus1Core

使用

sudo apt-get install mysql-server
修改 SQLValue.java  database user password
cd .
mvn clean compile -PcheckstyleSkip exec:java

The API of the server:

[xxx]验证用户名是否存在

GET /services/userexistence/{username}

返回JSON,包含

  • username
  • available: "yes" or "no"
[xxx] 注册

POST /services/usercreation

接受JSON,包含

  • username
  • password

返回JSON

  • result: 数字(0代表成功,其余请参见/fudan.plus1/Kits/Finals.java)
[xxx] 登录

GET /services/verification/{username}/{password}

返回JSON,包含

  • result: 数字(0代表成功,其余请参见/fudan.plus1/Kits/Finals.java)
[xxx] 创建新计数器

POST /services/countercreation

curl -i -H "Content-Type: application/json" -X POST -d '{"administrator":"rikka","counterName":"testcounter","value":"0","step":"1","unit":"s"}' 127.0.0.1:8080/services/countercreation

接受JSON,包含

  • administrator
  • counterName
  • value
  • step
  • unit

返回JSON,包含

  • result: 数字(0代表成功,其余请参见/fudan.plus1/Kits/Finals.java)
  • counterId: String
[xxx] 获取用户的所有计数器

GET /users/{username}/counters

返回JSON

  • List
    • Counter
      • administrator
      • counterId
      • counterName
      • value
      • step
      • unit
[xxx] 添加已有计数器

POST /users/{username}/{counterId}

返回JSON,包含

  • result: 数字(0代表成功,其余请参见/fudan.plus1/Kits/Finals.java)
[xxx] 删除计数器

DELETE /users/{username}/{counterId}

接受JSON,包含

  • administrator

返回JSON,包含

  • result: 数字(0代表成功,其余请参见/fudan.plus1/Kits/Finals.java)
[xxx] 改变计数器

PUT /users/{username}/{counterId}

接受JSON

  • administrator
  • counterName
  • value
  • step
  • unit

返回JSON,包含

  • result: 数字(0代表成功,其余请参见/fudan.plus1/Kits/Finals.java)
[xxx] 获取一个计数器

GET /counters/{counterId}

返回JSON

  • counter
    • counterId
    • counterName
    • value
    • step
    • unit
    • administrator
[xxx] 计数加

curl -X POST 127.0.0.1:8080/counters/testid/increase

POST /counters/{counterId}/increase

返回JSON,包含

  • result: 数字(0代表成功,其余请参见/fudan.plus1/Kits/Finals.java)
[xxx] 计数减

POST /counters/{counterId}/decrease

返回JSON,包含

  • result: 数字(0代表成功,其余请参见/fudan.plus1/Kits/Finals.java)
获取计数器(纯文本)信息

GET /info/{counterId}

返回"text/plain",具体信息由','隔开:

counterId + "," + administrator + "," + counterName + "," + value + "," + step + "," + unit

plus1core's People

Contributors

wenxinglai avatar

Watchers

 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.