UNPKG

qweb-client

Version:

qweb client.

284 lines 8.45 kB
{ "info": { "title": "用户登录", "author": "Sophia", "description": "用户登录", "auth": false }, "request": { "type": "object", "properties": { "account": { "anyOf": [ { "type": "string", "pattern": "^(13[0-9]|14[57]|15[012356789]|17[678]|18[0-9])[0-9]{8}$", "description": "人员账户" }, { "type": "string", "pattern": "^[-0-9a-zA-Z]{1,20}$", "description": "机构账户" } ] }, "password": { "type": "string" } }, "additionalProperties": false, "required": [ "account", "password" ] }, "response": { "switch": [ { "if": { "properties": { "status": { "enum": [ 0 ] } } }, "then": { "type": "object", "switch": [ { "if": { "properties": { "type": { "enum": [ 0 ] } } }, "then": { "properties": { "status": { "enum": [ 0 ] }, "type": { "enum": [ 0 ] }, "sessionId": { "type": "string", "pattern": "^[A-Za-z0-9]{32}$", "description": "sessionId" }, "personnel": { "type": "object", "description": "用户信息", "properties": { "name": { "type": "string", "pattern": "^.{2,10}$", "description": "人员姓名" }, "jobNumber": { "type": "string", "pattern": "^.+$", "description": "工号" }, "belongingOrganizationId": { "type": "string", "pattern": "^[A-Za-z0-9]{32}$", "description": "所属机构ID" }, "visibleOrganizationId": { "type": "string", "pattern": "^[A-Za-z0-9]{32}$", "description": "可视机构ID" }, "registerTime": { "type": "integer", "description": "注册时间" }, "accountStatus": { "enum": [ 1, 2 ], "description": "账号状态" } }, "additionalProperties": false, "required": [ "name", "belongingOrganizationId", "visibleOrganizationId", "registerTime", "accountStatus" ] } }, "additionalProperties": false, "required": [ "status", "type", "sessionId", "personnel" ] }, "continue": false }, { "if": { "properties": { "type": { "enum": [ 1 ] } } }, "then": { "properties": { "status": { "enum": [ 0 ] }, "type": { "enum": [ 1 ] }, "sessionId": { "type": "string", "pattern": "^[A-Za-z0-9]{32}$", "description": "sessionId" }, "organization": { "type": "object", "description": "机构信息", "properties": { "parentId": { "type": "string", "pattern": "^[A-Za-z0-9]{32}$", "description": "父级机构ID" }, "name": { "type": "string", "pattern": "^.{1,20}$", "description": "机构名称" }, "contact": { "type": "object", "description": "机构联系方式", "properties": { "regionCode": { "type": "string", "pattern": "^[1-9][0-9][0-9]{4}$", "description": "区域代码,eg:110100" }, "email": { "type": "string", "pattern": "^(\\w)+(.\\w+)*@(\\w)+((.\\w+)+)$", "description": "邮箱地址" }, "address": { "type": "string", "pattern": "^.+$", "description": "地址" }, "mobile": { "type": "string", "pattern": "^(13[0-9]|14[57]|15[012356789]|17[678]|18[0-9])[0-9]{8}$", "description": "手机号码,eg: 13800138000" } }, "required": [ "regionCode", "email", "address", "mobile" ], "additionalProperties": false }, "registerTime": { "type": "integer", "description": "注册时间" }, "accountStatus": { "enum": [ 1, 2 ], "description": "账号状态" } }, "additionalProperties": false, "required": [ "name", "contact", "registerTime", "accountStatus" ] } }, "additionalProperties": false, "required": [ "status", "type", "sessionId", "organization" ] }, "continue": false } ] }, "continue": false }, { "if": { "properties": { "status": { "enum": [ 1, 2 ] } } }, "then": { "type": "object", "properties": { "status": { "enum": [ 1, 2 ], "description": "返回状态代码" }, "message": { "type": "string", "description": "返回状态描述" } }, "additionalProperties": false, "required": [ "status" ] }, "continue": false } ] }, "constant": { "ResponseStatus": { "SUCCESS": 0, "ACCOUNT_DISABLED": 1, "PASSWORD_MISMATCH": 2 } } }