Code Monkey home page Code Monkey logo

lost_found's Introduction

接口文档

接口使用

BaseURL : localhost

使用请求头Authorization携带tokentoken {your token here}访问接口

接口详情

/user 登录相关

GET /user/login/ 获取学号登录链接

Quieries:

  • redirect app回调地址,用于接受AccessToken的地址,需要http/https前缀
  • clientId 设备id

Response(OK):

url就是登录链接

注意:返回url中的所有&被替换成了\u0026,需要前端进行一次字符串替换,不然学校接口会报错

{
    "error":0,
    "msg":"get url success",
    "url":"url"
}

用户登录完成之后会跳转到{redirect}?auth={token}地址,如:

redirecthttps%3a%2f%2fwww.baidu.com时,登录成功后跳转https://www.baidu.com/?auth=LrIH9YEaUy9pmg6nLlpatVvPaxtNuRgQPDT,其中LrIH9YEaUy9pmg6nLlpatVvPaxtNuRgQPDT就是用户token,有效期6个月

之后的请求携带该token即可

/id 获取id相关

GET /id/ 获取id列表

Quieries:

  • type 表单类型:①lostidcard(一卡通拾取)

eg:http://www.buhuiphp.com/id/?type=lost

Response(OK):

    [
        {"id":"VDek4u"},
        {"id":"6ZirNF"},
        {"id":"fir1Gc"},
        {"id":"Kywi2O"},
        {"id":"z09n8p"},
        {"id":"PBLtJh"}
    ]

/idcard 一卡通相关

POST /idcard/ 提交一卡通拾取表单

Quieries:

  • name_owner 失主姓名
  • stuno 失主学号
  • describe 物品描述
  • file 文件(jpeg/pjpeg/jpg/png)
  • name_pickup 拾取人姓名
  • contactType 联系类型
  • contact 联系方式

Response(OK):

    {
        "error":0,
        "msg":"success"
    }

GET /idcard/ 获取一卡通表单信息

Quieries:

  • id 表单唯一编号

Response(OK):

    {
        "error": 0,
        "msg": "success",
        "data": {
            "name_owner": "test",
            "stuno": "17051818",
            "describe": "描述",
            "url": "http:\/\/phi28j82d.bkt.clouddn.com\/lost-found\/image\/test\/185DBD48799A57DC5125F5805BBE5F72.jpg",
            "name_pickup": "test",
            "contactType": "QQ",
            "contact": "contact",
            "timestamp": "1543818517"
        }
    }

/lost 其他遗失物相关

POST /lost/ 提交遗失物拾取表单

Quieries:

  • name_pickup 拾取者姓名
  • type 拾取物品类型
  • describe 物品描述
  • file 文件(jpeg/pjpeg/jpg/png)
  • contactType 联系类型
  • contact 联系方式

Response(OK):

    {
        "error":0,
        "msg":"success"
    }

GET /lost/ 获取遗失物表单信息

Quieries:

  • id 表单唯一编号

Response(OK):

    {
        "error":0,
        "msg":"success",
        "data":{
            "name_pickup":"test",
            "type":"type",
            "describe":"descripe",
            "url":"http:\/\/qiniu.yubei.online\/lost-found\/image\/test\/04ECE64FB4865C9A97854FF0F2D2B7A0.jpg",
            "contactType":"contactTyp",
            "contact":"contact",
            "timestamp":"1543822202"
            }
    }

POST /lost/update.php 修改某拾取物物品描述

Quieries:

  • id 表单唯一编号
  • describe 新物品描述

Response(OK):

    {
     "error":0,
     "msg":"success"
    }

GET /lost/delete.php 删除某拾取物信息

Quieries:

  • id 表单唯一编号

eg:http://www.buhuiphp.com/lost/delete.php?id=z09n8p

Response(OK):

    {
     "error":0,
     "msg":"success"
    }

/qq 跳转QQ相关

POST /qq/ 获取跳转QQ链接

Response(OK):

url就是跳转链接

    {
        "url":"www.buhuiphp.com\/inc\/openqq.php"
    }

/rank 排序相关

GET /rank/ 获取排名降序

Response(OK):

    [{
        "type": "鼠标",
        "count": "3"
    }, {
        "type": "type",
        "count": "1"
    }, {
        "type": "手机",
        "count": "1"
    }, {
        "type": "U盘",
        "count": "1"
    }]

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.