地铁轨道用户部分接口

用户接口

1.注册

2.登录

3.解绑设备

管理员接口

1.添加授权时间

2.修改密码

3.添加授权时间

4.批量生成账号

5.删除账号

6.查询某id之前50个账户信息

7.查询某id之后50个账户信息

8.查询账户相关信息

9.手动设置用户授权时间

1.用户接口

注册

/app/register
请求方式: GET
参数:
参数含义类型
userName用户名string
password密码string
返回值:
// 成功
{
    "data": "",
    "code": 9,
    "msg": "successfully registered"
}
//失败
{
    "data": "",
    "code": 11,
    "msg": "username exists"
}

登录

/app/login
请求方式: GET
参数含义类型
userName用户名string
password密码string
cpuIDcpu标识string
motherBoard主板标识string
macAddressMAC地址标识string
diskID硬盘标识string
返回值:
{
    "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设备idstring
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."
}

回到开头

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值