Commit ba3b7a26 by lichaogang

refactor api for new version

parent 9b90a134
......@@ -17,14 +17,14 @@ API请求参数
### Head
X-LoginType {String} 登录方式
X-Sign {String}* 签名信息, 客户端用公钥加密字符串: {deviceSN}\n{activeName}\n{timestamp}
X-DeviceInformation {String}* 设备信息, 格式为: {osName}/{osVersion}/{appVersion}/{deviceSN}/{activeName}
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_username) 加密
### Form Parameters
activeAccount {String}
activeCode {String}
username {String}
password {String}
location {String}
## Response
......@@ -34,22 +34,43 @@ API请求参数
**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" \
-H "X-DeviceInformation: ooadmin/v1.1/5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-ChannelId: YS_P03_KARAMAY" \
-H "X-Sign: siX++d9tc3qrGgI9HKfscXGpabC9M/Wa8xEQU/rjWnMaxKCG/kCQBNlnaXrP8/0mt2XnlGMs/p/KX2jo3yVpQijFaupMtWeGuN2YtRVQWRa3tG53npMUttU5SjQWGa4UAOdxV7V8FLvm0DvO47zxC4puCcbGTbljH0q7BkADYGc=" \
-d "username=qrc240pDUO69WsN23x%2flcps1M%2fydVX9pjbhOXVzuX9pqp5LMG8llkMhRWhC4M3kAOqH0EXX2w4bcHA0VpvnIEEKvevThh6A1QJq4rN46WU88yX3TXD7%2bKEJMnomWaQlMKmNW%2fm0RFd7PGZoN%2bribYrCgCEUR6WNpDRyaxsKfXEY%3d&password=qrc240pDUO69WsN23x%2flcps1M%2fydVX9pjbhOXVzuX9pqp5LMG8llkMhRWhC4M3kAOqH0EXX2w4bcHA0VpvnIEEKvevThh6A1QJq4rN46WU88yX3TXD7%2bKEJMnomWaQlMKmNW%2fm0RFd7PGZoN%2bribYrCgCEUR6WNpDRyaxsKfXEY%3d" \
http://localhost:8080/v1/login
**Output**
{
"data": {
"accessToken": "30932365e4a5440848fb8726a4bb47a7",
"expiredIn": 7200,
"refreshToken": "f8a03e9322d8400e5305d88a3a776b4b",
"refreshTokenExpiredIn": 2592000
"userId":122222222
"username": "testuser",
"title": "张飞",
"canUpload": 1,
"orgName": "东小口社区医院",
"planList":[
{
"planId":1,
"planName": "广西南宁2019年上学期学生视力筛查",
"startDate": 1569859200,
"endDate": 1569859200,
camps:[
{
"campId": 1111199999999999,
"campName": "北京朝阳实验小学",
"status": 1,
},
{
"campId": 1111199999999999,
"campName": "北京朝阳实验小学",
"status": 1,
}
],
},
],
},
"errno": 200,
"msg": "success"
......
......@@ -6,7 +6,8 @@
## 接口定义
/v1/upload_vision_data
/v1/upload_vision_data 正测
/v1/upload_vision_data/repeat 复测
POST
## Request
......@@ -15,12 +16,13 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
dataId {String} 唯一ID ,由Android端生成
planId {int} 计划ID
studentId {int} 学生ID
leftEye {float} 左眼视力 3.8-5.3
rightEye {float} 右眼视力 3.8-5.3
......
......@@ -6,7 +6,8 @@
## 接口定义
/v1/batch_upload_vision_data
/v1/batch_upload_vision_data 正测
/v1/batch_upload_vision_data/repeat 复测
POST
## Request
......@@ -15,12 +16,12 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
[{"uuid":"1DE5CAAA-DB46-419A-8162-EC853DAEA5CF","studentId":"1111","leftEye":1.0,"rightEye":1.2,"testType":1,"distance":3,"testTime":1560426091,"classId":1111}]
[{"uuid":"1DE5CAAA-DB46-419A-8162-EC853DAEA5CF","studentId":"1111","leftEye":1.0,"rightEye":1.2,"leftOffset":1,"rightOffset":1,"isNaked":1,"testType":1,"distance":3,"testTime":1560426091,"classId":1111}]
## Response
......
# 激活设备
设备与机构进行绑定
## 修改记录
## 接口定义
/v1/vision_terminal_active
POST
## Request
API请求参数
### Head
X-ChannelId {String} 渠道ID
### Form Parameters
activeAccount {String} RSA加密
activeCode {String} RSA加密
deviceSn {String}
location {String}
## Response
testType : ,1:学校模式、2:商城模式、3:海航模式 4:趋光模式
qrCodeCallbackUrl: 测试结果扫码后调用地址,如果为空就用默认的
### Example
**Command**
curl -X POST \
-H "X-DeviceInformation: ooadmin/v1.1/5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-ChannelId: YS_P03_KARAMAY" \
-H "X-Sign: siX++d9tc3qrGgI9HKfscXGpabC9M/Wa8xEQU/rjWnMaxKCG/kCQBNlnaXrP8/0mt2XnlGMs/p/KX2jo3yVpQijFaupMtWeGuN2YtRVQWRa3tG53npMUttU5SjQWGa4UAOdxV7V8FLvm0DvO47zxC4puCcbGTbljH0q7BkADYGc=" \
-d "activeAccount=qrc240pDUO69WsN23x%2flcps1M%2fydVX9pjbhOXVzuX9pqp5LMG8llkMhRWhC4M3kAOqH0EXX2w4bcHA0VpvnIEEKvevThh6A1QJq4rN46WU88yX3TXD7%2bKEJMnomWaQlMKmNW%2fm0RFd7PGZoN%2bribYrCgCEUR6WNpDRyaxsKfXEY%3d&activeCode=qrc240pDUO69WsN23x%2flcps1M%2fydVX9pjbhOXVzuX9pqp5LMG8llkMhRWhC4M3kAOqH0EXX2w4bcHA0VpvnIEEKvevThh6A1QJq4rN46WU88yX3TXD7%2bKEJMnomWaQlMKmNW%2fm0RFd7PGZoN%2bribYrCgCEUR6WNpDRyaxsKfXEY%3d" \
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,
"qrCodeCallbackUrl":"http://www.hahahaah.com",
"note1": "",
"note2": "",
"headerUrl":"",
"footer":""
},
"errno": 200,
"msg": "success"
}
\ No newline at end of file
# 注册jpush服务
注册设备,接收推送服务
## 修改记录
## 接口定义
/v1/subscribe_jpush
POST
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
### Form Parameters
jpushToken {String} 设备Token
## Response
该接口返回Token信息
### Example
**Command**
##### Android
curl -X POST \
-H "X-DeviceInformation: 11%2f22%2f96" \
-H "X-Sign: lsK+/Wm5n2ArbOJfCx8zyW3RhFo+cAAsjjFa5eRcjt0lMGvkncSwwTErRuwYPQ4S2LkjZ7/qGIHmsEYMYGvmlvI4HZXrxUZzrSyf9GRqBYrfGAKVPbI3bBaxge64KkdGUba6f7enWy7wb5ORJXxLJbpTJ4nL3B+TwWECtfpMv6A=" \
-d "jpushToken=444444" \
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}/{activeAccount}
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
......@@ -14,8 +14,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
......
......@@ -14,8 +14,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
......@@ -46,17 +46,13 @@ API请求参数
{
"studentId": 50687,
"studentName": "郑笑莹",
"idcard": "11001020020202",
"gender": 2,
"age": 0,
"isUseGlasses": 0,
"schoolId": 160,
"gradeId": 260,
"classId": 1439,
"leftEye": "4.3",
"rightEye": "4.4",
"studentNumber": "",
"distance": 0,
"updatedAt": "2019-04-23 16:01:51"
"leftEye": 4.3,
"rightEye": 4.4,
}
]
}
......
......@@ -15,8 +15,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
......
......@@ -15,8 +15,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
......
# 获取广告信息
## 修改记录
## 接口定义
/v1/get_ad
GET
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
### Form Parameters
## Response
type:1、图片、2:视频、3:网页、4:光明之星
carouselTime:轮播时间
### Example
**Command**
curl -X POST \
-H "X-DeviceInformation: 5ebfdbca1a5d4dbd4a6cc8e835276779" \
-H "X-Sign: xxxxxxxx"
http://localhost:8080/v1/get_ad
**Output**
{
"data": [
{
"title": "test",
"type": 1,
"url": "http://www.baidu.com",
"carouselTime": 111,
"listOrder": 1
}
],
"errno": 200,
"msg": "success"
}
\ No newline at end of file
# 获取商城版二维码
##
## 接口定义
/v1/get_terminal_qrcode
GET
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
### Form Parameters
## Response
### Example
**Command**
curl -X GET \
-H "X-DeviceInformation: 11%2f22%2f96" \
-H "X-Sign: gsvC5MP2ASj9JsX0uauVpriye6xz1G3GIwY9I9JEhQdvsdJs+LHi4+AcVE9JHEApFlAbiNv3FjahOMymWslI8fXcmkaUBCb/tFT8zHn/YFE6yIyOOVMojoYTPSEYkSGmJN2tekru0nHiO7z5wS8DDbP680wfuzQPFJUxJyeDGb4=" \
http://localhost:8080/v1/get_terminal_qrcode
**Output**
{
"code": "200",
"msg": "success",
"data": {
qrCodeUrl:"http://weixin.qq.com/q/02payj9BJ4f2h1efGpNt1a"
}
}
\ No newline at end of file
......@@ -15,8 +15,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
cmdId int64 1233
......
......@@ -14,8 +14,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
......
......@@ -14,8 +14,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
......
# 上传单条商城数据
## 修改历史
## 接口定义
/v1/upload_shop_vision_data
POST
## Request
API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
### Form Parameters
dataId {String} 唯一ID ,由Android端生成
nickname {String} 昵称
parentId {int} 家长ID
leftEye {float} 左眼视力 3.8-5.3
rightEye {float} 右眼视力 3.8-5.3
leftOffset {int} 错误个数
rightOffset {int} 错误个数
distance {int} 3米或5米
phone {String} 手机号
testTime {int}
## Response
### Example
**Command**
curl -X POST \
-H "X-DeviceInformation: 11%2f22%2f141" \
-H "X-Sign: mCNfxI/TgBt9K63KJ/cMcW2SgjJuQhmpiyUsSIVncfrI7XgukTBX8mqB5zZZ4Zmid2Elb0NbeUEmPanSMkWMENzLu0hbFQQhN9FaOsCNAK0wBmOgZ0PW0/jCqi7m4yC0wcxRlkbefob7nB76ri5j2wvB0Qi4Js8UPUl77eegs9A=" \
-d 'dataId=1DE5CAAA-DB46-419A-8162-EC853DAEA5CF&studentId=549&leftEye=1.0&rightEye=1.2&leftOffset=1&rightOffset=0&parentId=10&phone=1111&distance=3&testTime=1560426091' \
http://localhost:8080/v1/upload_shop_vision_data
**Output**
{
"errno": 200,
"msg": "success"
}
\ No newline at end of file
......@@ -15,8 +15,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
......
......@@ -15,8 +15,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
......
......@@ -7,6 +7,7 @@
## 接口定义
/v1/upload_diopter_data
/v1/upload_diopter_data/repeat
POST
## Request
......@@ -15,15 +16,24 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
dataId {String} 唯一ID ,由Android端生成
planId {int} 计划ID
studentId {int} 学生ID
leftEye {String} <REFL0162.012.00-03.00+--02.50-01.00170>
rightEye {String} <REFR0162.012.00-03.00+--02.50-01.00170>
leftS {float} 球镜S
leftC {float} 柱镜C
leftA {float} 轴位A
rightS {float} 球镜S
rightC {float} 柱镜C
rightA {float} 轴位A
pd {float} 全瞳距值,4 个字节,输出格式为??.?,单位为 mm,如 62.0 表示瞳距为 62mm,如果为“00.0”表示该项无记录
vd {float} 顶点距离值,5 个字节,输出格式为??.??,单位为 mm,如 12.00 表示 12mm
se {float} 综合球镜度,6 个字节,输出格式为???.??,单位为 D,如-05.25 表示综合球镜度为-5.25D。
sylsign {string} 记录数据时柱镜符号设置,2 个字节,可能是++、--、+-,分别代表正、负、混合设置。
testTime {int}
classId {int} 班级ID
......
......@@ -15,8 +15,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
......
......@@ -15,8 +15,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
......
......@@ -15,8 +15,8 @@ API请求参数
### Head
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{equipmentId}/{activeAccount}
X-Sign {String} rsa(timestamp) 加密
X-DeviceInformation {String} 设备信息, 格式为: {osVersion}/{appVersion}/{deviceSN}/{orgID}
X-Sign {String} rsa(timestamp_userId) 加密
### Form Parameters
......
......@@ -65,5 +65,17 @@ API请求参数
"testTime":1566357456,
}
],
"diopter": [
{
"leftSph": -25,
"leftCyl": 50,
"leftAxis": 50,
"rightSph": 1,
"rightCyl": 44,
"rightAxis": 25,
"pd": 56,
"testTime": 1536635470
}
],
}
}
\ No newline at end of file
......@@ -44,6 +44,7 @@ API请求参数
"studentId": 101123985365794816,
"studentName": "陈宇昕",
"gender": 1,
"isUseGlasses": 0,
"class": "1900班",
"grade": "1年级",
"campName": "湘潭县第一中学"
......
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