Commit 7a79d3a2 by 徐丛奇

添加文档内容

parent 785fd0ae
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/aidapidesign.iml" filepath="$PROJECT_DIR$/.idea/aidapidesign.iml" />
</modules>
</component>
</project>
\ No newline at end of file
# 登录接口
和服务器对接的时候需要提供Token数据,该接口可以用于获取Token
## 修改记录
## 接口定义
/v1/login
POST
## Request
API请求参数
### Head
X-LoginType {String} 登录方式
X-Sign {String}* 签名信息, 客户端用公钥加密字符串: {deviceSN}\n{activeName}\n{timestamp}
X-DeviceInformation {String}* 设备信息, 格式为: {osName}/{osVersion}/{appVersion}/{deviceSN}/{activeName}
### Form Parameters
activeAccount {String}
activeCode {String}
location {String}
## Response
### Example
**Command**
##### Android
curl -X POST \
-H "X-WS-LoginType: School" \
-H "X-WS-Sign: csqQ4FKqnCmKDNoeHZu9lDkh7zxkKjXB2oQQhXV8WJwlIwIIgXZ1h8SDXNfZz3cRKJZW/5X8ZQYturQIk07qJ17+zBk4OhoaRLM27MbRQX6j/fzZ+82q/6q1qWswxCqcKnm/rKpIqH4/4s8CAgnBw+ZNKPcEN5rVaSLj88FYzpM=" \
-H "X-DeviceInformation: Android%2F5.0%2F4.8%2Fxxxxx%2FtestName" \
http://localhost:8080/v1/login
**Output**
{
"data": {
"accessToken": "30932365e4a5440848fb8726a4bb47a7",
"expiredIn": 7200,
"refreshToken": "f8a03e9322d8400e5305d88a3a776b4b",
"refreshTokenExpiredIn": 2592000
},
"errno": 200,
"msg": "success"
}
\ No newline at end of file
# 刷新Token
当客户端Access Token失效的时候, 可以调用该接口获取新的Token, 该Token不需要提供Sign签名信息, 需要提供上次Login时获取到的RefreshToken
## 修改历史
## 接口定义
/v1/refresh_token
POST
## Request
API请求参数
### Head
X-WS-RefreshToken {String}* Refresh Token参数, 上次Login或者Refresh Token的时候返回的RefreshToken值
X-DeviceInformation {String}* 设备信息, 格式为: {osName}/{osVersion}/{appVersion}/{deviceSN}/{activeName}
## Response
### Example
**Command**
curl -X POST \
-H "X-RefreshToken: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-DeviceInformation: Android%2F5.0%2F4.8%2Fxxxxx%2FtestName" \
http://localhost:8080/v1/refresh_token
**Output**
{
"data": {
"accessToken": "23e36adebbac462041b14a3d4152063f",
"expiredIn": 7200,
"refreshToken": "d91414afb555425c721ea0f34a1160eb",
"refreshTokenExpiredIn": 2592000,
},
"errno": 200,
"msg": "success"
}
\ No newline at end of file
# 上传单条数据
## 修改历史
## 接口定义
/v1/upload_vision_data
POST
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}
X-Sign {String} rsa(timestamp) 加密
### Form Parameters
uuid {String} 唯一ID ,由Android端生成
studentId {String} 学生ID
leftEye {float} 左视力
rightEye {float} 右眼视力
distance {int}
testType {int} 设备模式,1:学校模式、2:商城模式、3:海航模式
testTime {int}
## Response
### Example
**Command**
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Token: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-DeviceInformation: Android%2F5.0%2F4.8%2Fxxxxx%2FtestName" \
-d '{"uuid":"1DE5CAAA-DB46-419A-8162-EC853DAEA5CF","sid":"1111","eid":"2222","leftEye":1.0,"rightEye":1.2,"addType":1,"distance":3,"testTime":1560426091}' \
http://localhost:8080/v1/upload_vision_data
**Output**
{
"errno": 200,
"msg": "success"
}
\ No newline at end of file
# 上传批量数据
## 修改历史
## 接口定义
/v1/batch_upload_vision_data
POST
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}
X-Sign {String} rsa(timestamp) 加密
### Form Parameters
[{"uuid":"1DE5CAAA-DB46-419A-8162-EC853DAEA5CF","studentId":"1111","leftEye":1.0,"rightEye":1.2,"testType":1,"distance":3,"testTime":1560426091}]
## Response
### Example
**Command**
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Token: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-DeviceInformation: Android%2F5.0%2F4.8%2Fxxxxx%2FtestName" \
-d '[{"uuid":"1DE5CAAA-DB46-419A-8162-EC853DAEA5CF","studentId":"1111","leftEye":1.0,"rightEye":1.2,"testType":1,"distance":3,"testTime":1560426091}]'
http://localhost:8080/v1/batch_upload_vision_data
**Output**
{
"errno": 200,
"msg": "success"
}
\ No newline at end of file
# 激活设备
设备与机构进行绑定
## 修改记录
## 接口定义
/v1/vision_terminal_active
POST
## Request
API请求参数
### Head
### Form Parameters
activeAccount {String} RSA加密
activeCode {String} RSA加密
deviceSn {String}
location {String}
## Response
### Example
**Command**
curl -X POST \
-H "X-DeviceInformation: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-Sign: xxxxxxxx"
http://localhost:8080/v1/vision_terminal_active
**Output**
{
"data": {
"equipmentId": "11111",
"activationTime": 1560426091,
"schoolId": "12222",
"testType": 1,
"orgName": "北京市昌平实验小学",
"contacts": "jack",
"address": "",
"phone": "18910265201",
"printQrCodeStatus": 1,
"note1": "",
"note2": ""
},
"errno": 200,
"msg": "success"
}
\ No newline at end of file
# 注册jpush服务
注册设备,接收推送服务
## 修改记录
## 接口定义
/v1/subscribe_jpush
POST
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}
X-Sign {String} rsa(timestamp) 加密
### Form Parameters
jpushToken {String} 设备Token
## Response
该接口返回Token信息
### Example
**Command**
##### Android
curl -X POST \
-H "X-DeviceInformation: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-Sign: xxxxxxxx" \
-G \
--data-urlencode 'jpushToken=xxxxxx' \
http://localhost:8080/v1/subscribe_jpush
**Output**
{
"errno": 200,
"msg": "success"
}
\ No newline at end of file
# 解除设备绑定
## 修改记录
## 接口定义
/v1/vision_terminal_unbind
POST
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}
X-Sign {String} rsa(timestamp) 加密
### Form Parameters
activeAccount {String}
activeCode {String}
## Response
### Example
**Command**
curl -X POST \
-H "X-DeviceInformation: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-Sign: xxxxxxxx"
http://localhost:8080/v1/vision_terminal_unbind
**Output**
{
"errno": 200,
"msg": "success"
}
\ No newline at end of file
# 获取学校的年级和班级信息
## 修改记录
## 接口定义
/v1/get_school_grade_and_class
POST
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osName}/{osVersion}/{appVersion}/{deviceSN}/{activeAccount}
X-Sign {String} rsa(activeAccount+'_'+timestamp) 加密
### Form Parameters
schoolId {String}
## Response
### Example
**Command**
##### Android
curl -X POST \
-H "X-DeviceInformation: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-Sign: xxxxxxxx"
http://localhost:8080/v1/get_school_grade_and_class
**Output**
{
"errno": 200,
"data": {
"gradeList": [
{
"gradeId": 11,
"gradeName": "6",
"list": [
{
"classId": 1824,
"className": "3",
"orderlist": 0
},
{
"classId": 1823,
"className": "2",
"orderlist": 0
}
]
}
]
},
"msg": "success"
}
\ No newline at end of file
# 获取最近软件版本
## 修改记录
## 接口定义
/v1/vision_terminal_latest_version
POST
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}
X-Sign {String} rsa(timestamp) 加密
服务端根据appVersion判断是否需要升级(单设备升级或全设备升级)
### Form Parameters
## Response
### Example
**Command**
##### Android
curl -X POST \
-H "X-DeviceInformation: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-Sign: xxxxxxxx"
http://localhost:8080/v1/vision_terminal_latest_version
**Output**
{
"errno": 200,
"data": {
"versionCode": "250",
"address": "https://static-t.app.iouou.cn/2019/uF9rXsD2PJY4bkNFSzIVbmVrvCUrtLWmV0DgNw3l.apk",
"versionName": "ad_v2.1.2.0",
"content": "测试测试测试"
},
"msg": "success"
}
\ No newline at end of file
# 获取学生信息
## 修改记录
## 接口定义
/v1/get_student_list
GET
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osName}/{osVersion}/{appVersion}/{deviceSN}/{activeAccount}
X-Sign {String} rsa(activeAccount+'_'+timestamp) 加密
### Form Parameters
schoolId {int} 必选
page {int} 默认:1
limit {int} 默认:20
## Response
### Example
**Command**
curl -X GET \
-H "X-DeviceInformation: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-Sign: xxxxxxxx"
-G \
--data-urlencode 'schoolId=111111&page=1&limit=20' \
http://localhost:8080/v1/get_student_list
**Output**
{
"errno": 200,
"msg": "success",
"data": {
"total": 100,
"list":[
{
"studentId": 50687,
"studentName": "郑笑莹",
"gender": 2,
"age": 0,
"schoolId": 160,
"gradeId": 260,
"classId": 1439,
"left_eye": "4.3",
"right_eye": "4.4",
"studentNumber": "",
"distance": 0,
"updated_at": "2019-04-23 16:01:51"
}
]
}
}
\ No newline at end of file
# 获取学生最近三次数据
## 修改记录
## 接口定义
/v1/get_student_latest_visions
GET
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osName}/{osVersion}/{appVersion}/{deviceSN}/{activeAccount}
X-Sign {String} rsa(activeAccount+'_'+timestamp) 加密
### Form Parameters
studentIds {String}
count {int} 默认 3
## Response
### Example
**Command**
##### Android
curl -X GET \
-H "X-DeviceInformation: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-Sign: xxxxxxxx"
http://localhost:8080/v1/get_student_latest_visions
**Output**
{
"errno": 200,
"data": [
{
"studentId": 50687,
"list": [
{
"vid": 27728,
"leftEye": "4.3",
"rightEye": "4.4",
"distance": 3,
"addTime": 1556006511
}
]
},
{
"studentId": 50688,
"list": [
{
"vid": 27729,
"leftEye": "5.1",
"rightEye": "5.1",
"distance": 3,
"addTime": 1556006511
}
]
}
],
"msg": "success"
}
\ No newline at end of file
# 获取学生最近三次数据
## 修改记录
## 接口定义
/v1/get_student_visions
GET
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osName}/{osVersion}/{appVersion}/{deviceSN}/{activeAccount}
X-Sign {String} rsa(activeAccount+'_'+timestamp) 加密
### Form Parameters
studentId {String}
page {int} 默认 1
limit {int} 默认 20
## Response
### Example
**Command**
##### Android
curl -X GET \
-H "X-DeviceInformation: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-Sign: xxxxxxxx"
http://localhost:8080/v1/get_student_visions
**Output**
{
"errno": 200,
"data": [
{
"vid": 27728,
"leftEye": "4.3",
"rightEye": "4.4",
"distance": 3,
"addTime": 1556006511
}
],
"msg": "success"
}
\ No newline at end of file
# 获取广告信息
## 修改记录
## 接口定义
/v1/get_ad
GET
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}
X-Sign {String} rsa(timestamp) 加密
### Form Parameters
## Response
### Example
**Command**
curl -X POST \
-H "X-DeviceInformation: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-Sign: xxxxxxxx"
http://localhost:8080/v1/get_ad
**Output**
{
"errno": 200,
"data": {
"qrCodeUrl": "http://weixin.qq.com/q/02j2sR9QJ4f2h1aRvgNt1Q"
},
"msg": "success"
}
\ No newline at end of file
# 获取商城版二维码
##
## 接口定义
/v1/get_terminal_qrcode
GET
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}
X-Sign {String} rsa(timestamp) 加密
### Form Parameters
## Response
### Example
**Command**
curl -X POST \
-H "X-DeviceInformation: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-Sign: xxxxxxxx"
http://localhost:8080/v1/get_terminal_qrcode
**Output**
{
"errno": 200,
"data": {
"qrCodeUrl": "http://weixin.qq.com/q/02j2sR9QJ4f2h1aRvgNt1Q"
},
"msg": "success"
}
\ No newline at end of file
# 上传批量数据
## 修改历史
## 接口定义
/v1/terminal_remote_cmd
POST
## Request
API请求参数
### Head
### Form Parameters
equipmentId {String} RSA
## Response
cmd 上传命令
backup 上传备份数据 params 月份,如果为空就是当前月份,允许多个月份上传用逗号隔开(6,7,8)上传六七八月份的数据
log 上传log params 月份,同上
### Example
**Command**
curl -X POST \
-H "X-Sign: xxxxxxxx"
-H "X-DeviceInformation: Android%2F5.0%2F4.8%2Fxxxxx%2FtestName" \
-G \
--data-urlencode 'deviceSn=111111' \
http://localhost:8080/v1/terminal_remote_cmd
**Output**
{
"data": {
"cmd": "backup",
"params": "1",
"cmdTime":18910265201,
"serverTime":18910265201,
},
"errno": 200,
"msg": "success"
}
\ No newline at end of file
# 上传文件到服务器
## 修改历史
## 接口定义
/v1/terminal_upload_file
POST
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}
X-Sign {String} rsa(timestamp) 加密
### Form Parameters
dataType {String} backup,log
file {String} gzip
## Response
### Example
**Command**
curl -X POST \
-H "X-Sign: xxxxxxxx"
-H "X-DeviceInformation: Android%2F5.0%2F4.8%2Fxxxxx%2FtestName" \
-G \
http://localhost:8080/v1/terminal_upload_file
**Output**
{
"errno": 200,
"msg": "success"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment