{"code":20,"msg":"Incorrect username or password"}{"code":28,"msg":"DeviceIds not received."}{"code":23,"msg":"account is inactive"}{"code":24,"msg":"account expired"}{"code":22,"msg":"login success"}{"code":21,"msg":"device error"}{"code":26,"msg":"there is no binded device."}{"code":26,"msg":"there is no binded device."}{"code":27,"msg":"Set deviceIds to null successfully."}
解绑设备
/app/unbindDevice
请求方式: GET
参数:
参数
含义
类型
userName
用户名
string
password
密码
string
返回值:
// 成功{"code":27,"msg":"Set deviceIds to null successfully."}// 账号密码错误{"code":20,"msg":"Incorrect username or password"}// 没有绑定的设备{"code":26,"msg":"there is no binded device."}
2.管理员接口
添加授权时间
/app/addAccreditedTime
请求方式: GET
参数:
参数
含义
类型
userName
用户名
string
deviceId
设备id
string
days
授权的天数
int
返回值:
// 失败{"code":20,"msg":"Incorrect username or password"}// 成功{"code":29,"msg":"Add accredited time successfully."}
修改密码
/app/modifyPassword
请求方式: GET
参数:
参数
含义
类型
userName
用户名
string
oldPassword
旧密码
string
newPassword
新密码
string
返回值:
// 成功{"code":31,"msg":"password has been changed successfully."}// 账号不存在{"code":36,"msg":"wrong user name or password."}
批量生成账号
/app/generateBunchOfAccounts
请求方式: GET
参数:
参数
含义
类型
accountNum
需要创建的账号的数量
int
返回值:
// 成功{"data":{"1":{"password":"123456","account":"GeneratedAccount_8"},"2":{"password":"123456","account":"GeneratedAccount_9"},"3":{"password":"123456","account":"GeneratedAccount_10"},"4":{"password":"123456","account":"GeneratedAccount_11"},"5":{"password":"123456","account":"GeneratedAccount_12"}},"code":200,"msg":"success"}// 每次最多创建100个账号{"code":35,"msg":"Create up to 100 accounts each time."}
删除账号
/app/deleteAccount
请求方式: GET
参数:
参数
含义
类型
userName
用户名
string
返回值:
// 成功{"code":33,"msg":"delete successfully."}// 账号不存在{"code":30,"msg":"username does not exists."}
查询某id之后50个账户信息
/app/show50CccountsAfter
请求方式: GET
参数:
参数
含义
类型
startId
查找该id之后的50个用户信息
int
返回值:
// 成功{"data":[{"id":31,"userName":"robot","passwd":"123123","accreditDeadline":"2020-07-17T02:48:35.000+00:00","cpuId":"234hj23g5k2g35k","motherBoardId":"g53gj2f374fj34j","macAddress":"123415236","diskId":"34613462734234623"},{"id":32,"userName":"721","passwd":"721","accreditDeadline":"","cpuId":"","motherBoardId":"","macAddress":"","diskId":""}],"code":200,"msg":"success"}// startId格式错误{"data":"","code":38,"msg":"startId is not an int number"}
查询某id之前50个账户信息
/app/show50CccountsBefore
请求方式: GET
参数:
参数
含义
类型
endId
查找该id之前的50个用户信息
int
返回值:
// 成功{"data":[{"id":5,"userName":"hanqin","passwd":"2347293475","accreditDeadline":"2020-07-24T06:30:42.000+00:00","cpuId":"","motherBoardId":"","macAddress":"","diskId":""},{"id":8,"userName":"zhq","passwd":"123","accreditDeadline":"2020-07-24T06:30:42.000+00:00","cpuId":"rqwer","motherBoardId":"6246gsd","macAddress":"1234g12342g","diskId":"513f"}],"code":200,"msg":"success"}// endId错误{"data":"","code":39,"msg":"endId is not an int number"}
查询账户相关信息
/app/showAccountInfo
请求方式: GET
参数:
参数
含义
类型
namePieces
用户名碎片信息
string
返回值:
// 成功(namePieces="h"){"data":[{"motherBoardId":"","password":"2347293475","macAddress":"","cpuId":"","accreditDeadline":"2020-07-24 14:30:42","diskId":"","userName":"hanqin"},{"motherBoardId":"6246gsd","password":"123","macAddress":"1234g12342g","cpuId":"rqwer","accreditDeadline":"2020-07-24 14:30:42","diskId":"513f","userName":"zhq"}],"code":200,"msg":"success"}// 用户名片段没有提供{"data":"","code":37,"msg":"namePieces is null"}
手动设置用户授权时间
/app/setAccreditedTime
请求方式: GET
参数:
参数
含义
类型
userName
用户名
string
days
从当前时间往后授权的天数(可以为任意整数)
string
返回值:
// 成功{"code":34,"msg":"set new accredit time successfully"}// 账号不存在{"code":30,"msg":"username does not exists."}