Commit 97adad9d by 潘建波

合并展示页面

1 parent 1ae18408
Showing 361 changed files with 4845 additions and 1 deletions
File mode changed
NODE_ENV = '"development"'
\ No newline at end of file
NODE_ENV = 'development'
VUE_APP_URL = 'http://192.168.9.133:20080'
\ No newline at end of file
VUE_APP_URL = ''
\ No newline at end of file
No preview for this file type
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/img/favicon.ico">
<title>繁星2.0</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/css/theme.css" type="text/css" />
<link rel="stylesheet" href="/css/theme_extra.css" type="text/css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
<script src="/js/jquery-2.1.1.min.js" defer></script>
<script src="/js/modernizr-2.8.3.min.js" defer></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-nav-search">
<a href="/index.html" class="icon icon-home"> 繁星2.0</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="//search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1">
<a class="" href="/index.html">概述</a>
</li>
<li class="toctree-l1">
<span class="caption-text">所有接口</span>
<ul class="subnav">
<li class="">
<a class="" href="/home.html">首页展示</a>
</li>
<li class="">
<a class="" href="/system.html">系统运维</a>
</li>
<li class="">
<a class="" href="/resource.html">资源管理</a>
</li>
<li class="">
<a class="" href="/search.html">智能检索</a>
</li>
<li class="">
<a class="" href="/task.html">任务管理</a>
</li>
</ul>
</li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="/index.html">繁星2.0</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="/index.html">Docs</a> &raquo;</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<h1 id="404-page-not-found">404</h1>
<p><strong>Page not found</strong></p>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
</div>
Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" style="cursor: pointer">
<span class="rst-current-version" data-toggle="rst-current-version">
</span>
</div>
<script>var base_url = '/';</script>
<script src="/js/theme.js" defer></script>
<script src="/search/main.js" defer></script>
</body>
</html>
概述
=======================
本服务用于对用户身份认证和授权。
通讯协议
------------
所有通讯均采用HTTP+JSON格式。
接口返回内容的说明
----------------------------
1. 采用标准HTTP返回状态码向接口调用者指出操作是否成功,例如2xx均表示成功,4xx和5xx表示失败。
2. 对于HTTP返回状态码2xx的情况,本文档各个接口分别规定了其响应内容的格式(即Response Body规定的格式)。
3. 对于HTTP返回状态码非2xx的情况,可以不返回任何响应内容,即不含有Response Body。但是也可以返回一个以下格式的Response Body向调用者给出更详细的错误指示:
| {
| "ecode": 0, # 整数类型,是平台自定义的错误码
| "enote": "The camera is created ok." # 字符串,关于错误的说明
| }
认证过程
------------
1. 用户给出用户名和密码调用登录接口,从平台获取rtoken, atoken,以及各自的过期时间。
#. 以后用户调用接口时都需要提供atoken,如果atoken失败,而rtoken未过期,则可以调用接口重新获取atoken。
#. 如果rtoken也过期,那就需要重新通过用户名和密码得到atoken。
说明:atoken和rtoken都是字符串,长度不超过64个ASCII字符。
授权过程
----------
API授权
^^^^^^^^^
权限建立过程
++++++++++++++
1. 各服务向认证服务注册自己所有的HTTP API,需要包括serv_type, verb, path和name。path中带有变量,变量写法:{$var_name},var_name是不同的变量名,如user_unid。
**注意:**
- 认证服务为每一个API注册的时候都将生成一个唯一id(api_unid),这个id是根据(verb, path)生成的,确保唯一,可以用md5sum的方法生成。在以后服务重新注册这个接口的时候这个api_unid是不变的。
- 认证服务必须对注册结果进行持久化存储,即使相应服务重启或未启动也不会丢失已注册的接口信息。
2. 管理员在操作界面上可以分服务类型(serv_type)列出API,并将其加入到权限表中。
3. 管理员在操作界面上为角色设置权限。
4. 管理员在操作界面上为用户或用户组分配角色。
鉴权过程
++++++++++
1. 认证服务收到其它服务发过来的atoken和(verb, path)对。
2. 认证服务首先认证该token是否合法,如果不存在返回鉴权失败,否则得到该用户的user_unid。
3. 认证服务根据(verb, path)和api表进行匹配,如果匹配不成功,则返回API匹配失败。
4. 如果匹配成功,那么生成api_unid,然后查找权限表中是否存在这个api_unid,如果不存在则说明该接口对所有合法用户都可用,返回鉴权成功的响应。
5. 如果权限表中存在这个api_unid,则得到该用户所属的角色列表和该用户所在用户组所属的角色列表,合并为该用户的角色表。然后检查该权限是否属于用户角色表的任何一个,如果是则鉴权成功,否则鉴权失败。
菜单授权
^^^^^^^^^^
权限建立过程
++++++++++++++
1. 管理员在认证服务创建app(包括name和note)。认证服务返回一个唯一的unid(必须是数字和字母的组合,长度不超过32)。
#. 管理员在认证服务创建该应用的所有菜单项,需要包括app_unid, 菜单的name, note, position和父节点,如果是根节点则不给出父节点。认证服务为每一个菜单项生成一个唯一unid,且每个菜单项对应一个权限项。
#. 管理员在操作界面上可以按需出树形或列表形式的菜单项,并为不同角色分配菜单权限。
#. 管理员在操作界面上为用户或用户组分配角色。
菜单获取过程
++++++++++++++
1. 认证服务收到客户端发过来的atoken,确定用户的user_unid。
#. 认证服务根据用户的user_unid得到其角色。
#. 认证服务根据应用的app_unid和用户角色得到其可访问菜单的菜单树。
#. 认证服务向该用户返回菜单树。
登录认证接口
=============
用户登录
^^^^^^^^^^
| Verb: POST
| Path: /api/v1/auth/users/login
| Header: (Content-Type: application/json)
Request Body:
.. code-block:: python
{
"user_type": "user", # 可取值[user|device|service|mphone],分别表示普通用户、设备、服务,可为空,为空时默认是:user
# user_type为"user"时必填
"jgpush_userid":"xxx", #极光用户id (可选:当为app端登陆时必传
#1、以用户账号和密码登录
"username":"xxxx", # 用户名
"password":"xxxxxx", # 密码
#2、以用户注册的手机号登录
"mphone":13812321312, # 手机号
"sms_code":123456, # 手机短信验证码
# user_type为"device"时必填
"dev_refid": "xxxxxxxx", # 设备的唯一refid
# user_type为"service"时必填
"serv_name": "xxxxxxxx", # 服务的唯一name
"serv_key": "xxxxxxxx", # 服务的秘钥
}
Response Body:
.. code-block:: python
{
"user_unid":"xxxx", # 必填,用户unid
"user_type":"xxxx", # 可选,用户类型,不出现表示"user",即普通用户。
"atoken":"xxxx", # 必填,用户的atoken
"atoken_edt":"2017-03-29T00:12:30", # 必填,atoken到期时间
"rtoken":"xxxx", # 可选,用户的rtoken
"rtoken_edt":"2017-06-29T00:12:30", # 可选,rtoken到期时间
}
根据用户注册手机号获取短信验证码
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/auth/users/smscode
| Header: (Content-Type: application/json)
Request Body:
.. code-block:: python
{
"mphone":13812321312 # 手机号(注:认证服务得有该手机的注册信息
}
Response Body:
.. code-block:: python
{
"ecode": 200,
"enote": "OK"
}
短信重置密码
^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/auth/users/reset/password
| Header: (Content-Type: application/json)
Request Body:
.. code-block:: python
{
"mphone":13812321312 # 手机号(注:认证服务得有该手机的注册信息
"username":"xxxx", # 用户名
"sms_code":123456 # 验证码
#以下为新设置的密码信息
"password":"xxxxxx" # 密码
}
Response Body:
.. code-block:: python
{
"ecode": 200,
"enote": "OK"
}
根据rtoken获取atoken
^^^^^^^^^^^^^^^^^^^^^^
| ``Verb:`` GET
| ``Path:`` /api/v1/auth/users/{$user_unid}/atoken
| ``Header:`` (authorization, {$auth_rtoken})
Request Body: 无
Response Body:
.. code-block:: python
{
"user_unid":"xxxx", # 用户unid
"user_type":"xxxx", # 用户类型
"atoken":"xxxx", # 用户的atoken
"atoken_edt":"2017-03-29T00:12:30", # atoken到期时间
}
修改自己的密码
^^^^^^^^^^^^^^^^^^^^^^
| ``Verb:`` POST
| ``Path:`` /api/v1/auth/users/{$user_unid}/password
| ``Header:`` (authorization, {$auth_rtoken})
Request Body: 无
.. code-block:: python
{
"old_pwd":"xxxx", # 旧密码
"new_pwd":"xxxx", # 新密码
}
.. attention:: 修改密码会引起atoken和atoken_edt的改变。
Response Body:
.. code-block:: python
{
"user_unid":"xxxx", # 用户unid
"atoken":"xxxx", # 用户的atoken
"atoken_edt":"2017-03-29T00:12:30", # atoken到期时间
}
鉴权
^^^^^^^^^^
| Verb: POST
| Path: /api/v1/auth/authorize
| Header: (authorization, {$atoken}), (Content-Type: application/json)
Request Body:
.. code-block:: python
{ # api鉴权
"perm": {
"type": "api",
"api": {
"verb": "POST",
"path": "/api/v1/users",
}
}
}
返回标准http返回码,200表示成功,401表示授权失败。
Response Body:
.. code-block:: python
{
"user_unid":"xxxx", # 用户unid
"user_type":"xxxx", # 用户类型
}
获取app菜单树
^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/auth/menu_tree?app_unid=xxxx
| Header: (authorization, {$atoken})
Request Body:无
Response Body:
.. code-block:: python
{
"app_unid": "xxxx",
"app_name": "xxxx",
"menu_tree": [ # 列表顺序按照position从小到大排列。
{
"position": 1,
"unid": "xxxx",
"refid": "xxxx",
"name":"xxxx",
"note":"xxxx",
"child": [],
},
{...}
]
}
API管理
================
批量注册API
----------------
| ``Verb:`` POST
| ``Path:`` /api/v1/auth/apis
| ``Header:`` (authorization, {$atoken}), (Content-Type: application/json)
``Request Body:``
.. code-block:: python
{
"apis": [
{
"name": "创建用户",
"verb": "POST",
"path": "/api/v1/users",
"serv_type": "stream"
},
...
}
Response Body:
.. code-block:: python
{
"apis": [
{
"unid": "xxxx",
"name": "创建用户",
"verb": "POST",
"path": "/api/v1/users"
"serv_type": "stream"
},
...
}
列出API
----------------
| ``Verb:`` GET
| ``Path:`` /api/v1/auth/apis
| ``Header:`` (authorization, {$atoken}), (Content-Type: application/json)
``Request Params:``
- serv_type: 必填,可以根据服务类型做删选
- name, name__like: 分别表示精确和模糊匹配。
- offset, limit
- order: 默认desc
- sortby: 默认name
- verb: GET, POST, DELETE(for http); get, post, delete, put(for ws)
- path: /api/xxxx(for http), /wsapi/xxxx(for ws)
``Response Body:``
.. code-block:: python
{
"apis": [
{
"unid": "xxxx",
"name": "创建用户",
"verb": "POST",
"path": "/api/v1/users",
"serv_type": "stream",
},
...
}
.. attention::
- 如果同时指定verb和path,那么应该返回列表应该只有一个接口。
\ No newline at end of file
菜单管理
================
应用(app)管理
---------------
创建应用
^^^^^^^^^^^^^^^
| ``Verb:`` POST
| ``Path:`` /api/v1/auth/apps
| ``Header:`` (authorization, {$atoken}), (Content-Type: application/json)
Request Body:
.. code-block:: python
{
"name": "xxx",
"note": "xxx"
}
Response Body:
.. code-block:: python
{
"unid": "xxx",
"name": "xxx",
"note": "xxx"
}
.. attention::
1. 创建应用的时候服务程序需要同时创建菜单根节点。
列出应用
^^^^^^^^^^^^^^^
| ``Verb:`` GET
| ``Path:`` /api/v1/auth/apps
| ``Header:`` (authorization, {$atoken})
| ``Params:``
- offset, limit
- order: 默认asc
- sortby: 默认name
- is_active:取值为true或false
- name, name__like: 当type==api时使用,分别表示精确和模糊匹配。
Request Body:无
Response Body:
.. code-block:: python
{
"total_num": 100, # 总数量
"list_size": 10, # 本次返回的列表项数量
"offset": 10, # 本次返回项目的起始索引
"list_data":
[
{
"unid": "xxx",
"name": "xxx",
"note": "xxx"
}
...
]
}
修改应用
^^^^^^^^^^^^^^^
| ``Verb:`` POST
| ``Path:`` /api/v1/auth/apis/{$app_unid}
| ``Header:`` (authorization, {$atoken})
Request Body:
.. code-block:: python
{
"name": "xxx",
"note": "xxx"
}
Response Body:
.. code-block:: python
{
"unid": "xxx",
"name": "xxx",
"note": "xxx"
}
删除应用
^^^^^^^^^^^^^^^
| ``Verb:`` DELETE
| ``Path:`` /api/v1/auth/apis/{$app_unid}
| ``Header:`` (authorization, {$atoken})
Request Body:无
Response Body: 正确无,错误返回相应的结构。
.. attention:: 如果应用下包含菜单,那么删除会失败。
菜单管理
------------
创建菜单
^^^^^^^^^^^^^^^
| ``Verb:`` POST
| ``Path:`` /api/v1/auth/apps/{$app_unid}/menus
| ``Header:`` (authorization, {$atoken}), (Content-Type: application/json)
Request Body:
.. code-block:: python
{
"position": 1, # 必填,菜单项的相对位置
"name": "xxx", # 必填,菜单项显示的名称
"note": "xxx" # 可选,菜单项说明
"parent": "xxx" # 可选,父节点菜单项的unid,没有表示虚拟根节点。
}
.. attention::
1. 应用的根节点在创建应用的时候由服务程序自动创建,本接口只能创建非根节点。
2. 如果一个应用已经有一个虚拟根节点,那么再创建应该报错。
Response Body:
.. code-block:: python
{
"unid": "xxx", # 必填,认证服务分配的菜单unid
"position": 1, # 必填,菜单项的相对位置
"name": "xxx", # 必填,菜单项显示的名称
"note": "xxx" # 可选,菜单项说明
"parent": "xxx" # 可选,父节点菜单项的unid,没有表示虚拟根节点。
"perm_unid": "xxxx", # 必填,对应的权限unid
}
.. attention:: 创建菜单的同时要创建一个与该菜单项关联的权限。
获取菜单
^^^^^^^^^^^^^^^
| ``Verb:`` GET
| ``Path:`` /api/v1/auth/apps/{$app_unid}/menus
| ``Header:`` (authorization, {$atoken})
| ``Params:``
- shape, 表示获取菜单结果的形状,tree表示树形结构,list表示列表结构,默认tree。
.. note::
1. 只有请求者属于管理员角色时,才能处理shape=list的情况,非管理员给出本参数时要拒绝。
#. 只有请求者属于管理员角色时,才能处理给出role参数的情况,非管理员给出role参数时要拒绝。
.. note::
1. 当请求不给出role参数时,后台只需给出atoken对应的用户所属角色的可操作性菜单的并集,以树的形式返回。
2. 当请求给出role参数时,后台认为请求用户希望编辑菜单,这时首先要检查该用户是否属于管理员组,如果不属于管理员组则拒绝。否则给出完整的菜单树,但是要指出每个菜单项对该角色是否可访问。
以下参数只有在shape=tree时才有作用。
- role, 表示获取指定角色的允许访问的菜单的树形结构,如果没有本参数则给出完整菜单树。
以下参数只有在shape=list时才有作用。
- name, name__like: 分别表示精确和模糊匹配
- offset:起始偏移量,默认0
- limit:本次返回最大值,默认100
Response Body:
shape==tree时,
.. code-block:: python
{
"app_unid": "xxxx",
"app_name": "xxxx",
"menu_tree": [ # 列表顺序按照position从小到大排列。
{
"position": 1,
"unid": "xxxx",
"name":"xxxx",
"note":"xxxx",
"perm_unid": "xxxx",
"is_usable": true, # 本菜单项对指定角色是否可用
"child": [],
},
{...}
]
}
shape==list时,
.. code-block:: python
{
"total_num": 100, # 总数量
"list_size": 10, # 本次返回的列表项数量
"offset": 10, # 本次返回项目的起始索引
"list_data":[
{
"unid": "xxx", # 必填,认证服务分配的菜单unid
"position": 1, # 必填,菜单项的相对位置
"name": "xxx", # 必填,菜单项显示的名称
"note": "xxx" # 可选,菜单项说明
"parent": "xxx" # 可选,父节点菜单项的unid,没有表示虚拟根节点。
"perm_unid": "xxxx",
},
...
}
修改菜单
^^^^^^^^^^^^^^^
| ``Verb:`` POST
| ``Path:`` /api/v1/auth/apps/{$app_unid}/menus/{$menu_unid}
| ``Header:`` (authorization, {$atoken})
Request Body:
.. code-block:: python
{
"position": 1, # 可选,菜单项的相对位置
"name": "xxx", # 可选,菜单项显示的名称
"note": "xxx" # 可选,菜单项说明
"parent": "xxx" # 可选,父节点菜单项的unid,没有表示虚拟根节点。
}
Response Body:
.. code-block:: python
{
"unid": "xxx", # 必填,认证服务分配的菜单unid
"position": 1, # 必填,菜单项的相对位置
"name": "xxx", # 必填,菜单项显示的名称
"note": "xxx" # 可选,菜单项说明
"parent": "xxx" # 可选,父节点菜单项的unid,没有表示虚拟根节点。
}
删除菜单
^^^^^^^^^^^^^^^
| ``Verb:`` DELETE
| ``Path:`` /api/v1/auth/apps/{$app_unid}/menus/{$menu_unid}
| ``Header:`` (authorization, {$atoken})
.. attention:: 如果该菜单下有子菜单,那么删除失败,否则成功。注意同时也要删除对应的权限。
Request Body:无
Response Body: 正确无,错误返回相应的结构。
替换某个角色在某个应用的菜单
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ``Verb:`` POST
| ``Path:`` /api/v1/auth/roles/{$role_id}/apps/{$app_unid}/menus
| ``Header:`` (authorization, {$atoken}), (Content-Type: application/json)
Request Body:
.. code-block:: python
{
"list_size": 10, # 菜单项数量
"list_data":[
{
"unid": "xxx", # 必填,认证服务分配的菜单unid
"perm_unid": "xxxx",
},
...
}
Response Body:
.. code-block:: python
{
"code": 200,
"enote": "OK"
}
修订历史
=============
2017.3.29
------------
1. 第一版,完成概述,数据库,平台和设备接入服务的接口定义三部分内容。
2017.3.30
------------
1. 修改自己的的密码接口:atoken改为auth_atoken。
#. 新增“请求授权接口”。
2017.4.05
------------
1. 把url改为 Verb和Path,前者表示http动词,例如GET, POST,后者表示不含主机地址和端口的url路径。
2. 把认证和授权的token参数放到了http header的authorization中,而不是在参数列表或查询参数中出现。
2017.4.25
------------
- 数据库表修改
1. 用户表(tb_auth_user)去掉了username和password字段,新增了type, is_active和create_dt字段。用于支持多种用户的情况。
2. 新增了普通用户表(tb_auth_user_norm),该表和用户表关联。它的每一条记录在tb_auth_user表有对应的记录,但反之不然。
3. 新增用户组表(tb_base_auth_ugrp)。
4. 角色表和权限表新增了is_active和create_dt字段。
5. 新增了用户和组关联表(tb_auth_user_ugrp)
- API修改
1. api的根路径由"/api-auth/v1"改为"/api/v1/auth"
#. 新增了用户组的相关接口。
#. 所有列出接口的返回内容格式作了修改,在列表外包了一个结构体。
#. 获取,列出用户,角色和权限等接口的返回值新增了is_active和create_dt字段。
#. 列出用户,角色和权限等接口的请求新增了is_active,order和sortby字段及其说明。
#. 去掉了所有删除接口,修改接口新增了is_active字段,可以设置用户,用户组,权限和角色为无效。
#. 所有修改接口的动词由PATCH改为POST。
#. 新增了用户和组的关联操作接口。
#. 新增了用户组和角色的关系管理接口。
2017.5.15
------------
1. 数据库新增了"tb_auth_user_dev"设备表和"tb_auth_user_service"服务表。
2. "用户管理"所有接口新增了对设备和服务型用户的支持,相关接口的返回值新增了user_type字段。
3. "用户登录","根据rtoken获取atoken"和"鉴权"接口新增了对设备和服务的支持,相关的返回接口新增了user_type字段。
2017.6.7
------------
1. 服务表的serv_name改为唯一,serv_key改为非唯一。
2. 修改用户改为serv_key可修改,serv_name不可修改。
3. 角色表,权限表,用户组表去掉了aname和cname,改为name。
4. 修改了API表:
- auth_perm字段修改为可以为空。
- 新增了is_in_perm字段,表示该API是否纳入权限控制,默认为false。
- 新增了name字段。
- 新增了serv_type字段。
5. API修改
- 角色表,权限表,用户组表的GET列表接口新增了name参数,可以模糊搜索
- 修改了角色表,权限表,用户组表的操作接口的请求和响应值,把aname和cname去掉,换成name
- 新增了"API的相关操作"部分,共两个接口,具体参见文档。
- 修改了"权限的相关操作"部分,共4个接口,具体参见文档。
2017.6.14
------------
1. 修改了列出用户,权限,角色和用户组的api接口,新增了模糊搜索功能。
2. 概述部分新增了授权过程的描述。
2017.6.16
------------
1. 新增了菜单项授权过程描述。
2017.7.10
------------
1. 重新整理了文档结构。
2. 在“基本管理接口”->“权限的相关操作”中新增了“创建菜单权限”的接口。
3. 新增了“菜单管理”的相关接口。
4. 数据库新增了菜单表和应用表。
2017.07.28
------------
1. 修改用户的基本信息,新增普通用户,增加了 truename(用户的真实姓名)、sex(性别)、phone_number(手机号码)、telephone_number(固定电话)、fax_number(传真号码)、mail(邮箱)
相关修改有:数据库普通用户表;接口中:创建用户、列出用户、读取用户、修改用户、列出一个组的所有用户、列出一个角色的所有用户
2017.07.29
------------
1. 修改用户组数据表结构,增加类型字段type,
2. 增加用户组与地点关系表,同时增加*用户组(单位)与地点的关系管理*的相关接口
3. 相关接口为:*用户组管理*、*列出一个用户的所有组*、*列出一个角色的所有用户组*、*用户组(单位)与地点的关系管理*、*取消关联一个地点的所有关系*、*根据用户组(单位)unid获取和地点的关联信息*
2017.07.29.2
--------------
1. 所有的addr_id改为addr_unid。
2017.08.18
--------------
1. 普通用户表(tb_auth_user_norm)新增了is_sysuser字段,表示是否是系统用户,默认为false。相应的创建,修改,列出和获取用户的接口也新增了这个字段。
2017.09.26
--------------
1. 概述部分简化了“菜单授权”的描述。
2. 修改了数据库的菜单表和应用表,菜单表去掉了refid,新增了position,auth_perm和parent字段,应用表新增了menu_root字段。
3. “登录认证接口”新增了“获取app菜单树”接口。
2017.10.30
--------------
1. 创建和删除菜单的同时需要创建和删除与其对应的权限。
2017.10.31
--------------
1. 去掉了app表的menu_root字段。
2017.11.03
--------------
1. 创建菜单和列出菜单的返回值新增了perm_unid字段。
2017.11.08
--------------
1. 新增替换某个角色在某个应用的菜单接口。
2017.11.10
--------------
1. 新增了修改自己密码的接口。
2018.01.23
--------------
1. "4.2. 列出API"接口新增了verb和path查询参数。
2018.05.03
--------------
1. 新增“6.1.5. 批量获取用户”接口。
2018.07.03
--------------
1. “普通用户表(tb_auth_user_norm)”表新增了"jgpush_userid"字段。
2. "用户组表(tb_base_auth_ugrp)"表新增了“org_unid”字段。
3. “6.1.2. 列出用户”,“6.1.3. 读取用户”,“6.1.4. 修改用户”和“6.1.5. 批量获取用户”接口都新增了“jgpush_userid”字段。
4. “6.2.2. 列出用户组”,“6.2.3. 读取用户组”和“6.2.4. 修改用户组”接口都新增了"org_unid"接口。
5. 用户组的“unit_property”字段的“start_time”和“end_time”字段含义改为本地时间,而不是日期时间。
2018.07.05
--------------
1. “3.1. 用户登录” user类型中添加mphone和sms_code登录字段。
2. 新增“3.2.根据用户注册手机号获取短信验证码”接口。
3. 新增“3.3. 短信重置密码(前提为在3.3接口校验成功后才能调用”接口。
.. vpilot_design documentation master file, created by
sphinx-quickstart on Tue Mar 14 15:48:58 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
认证和授权服务设计
======================
.. toctree::
:maxdepth: 4
:numbered:
:caption: 目录:
01-summary
02-db
10-api-login
21-auth-api
22-auth-menu
30-api-base
99-history
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
/*
* basic.css
* ~~~~~~~~~
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/* -- main layout ----------------------------------------------------------- */
div.clearer {
clear: both;
}
/* -- relbar ---------------------------------------------------------------- */
div.related {
width: 100%;
font-size: 90%;
}
div.related h3 {
display: none;
}
div.related ul {
margin: 0;
padding: 0 0 0 10px;
list-style: none;
}
div.related li {
display: inline;
}
div.related li.right {
float: right;
margin-right: 5px;
}
/* -- sidebar --------------------------------------------------------------- */
div.sphinxsidebarwrapper {
padding: 10px 5px 0 10px;
}
div.sphinxsidebar {
float: left;
width: 230px;
margin-left: -100%;
font-size: 90%;
word-wrap: break-word;
overflow-wrap : break-word;
}
div.sphinxsidebar ul {
list-style: none;
}
div.sphinxsidebar ul ul,
div.sphinxsidebar ul.want-points {
margin-left: 20px;
list-style: square;
}
div.sphinxsidebar ul ul {
margin-top: 0;
margin-bottom: 0;
}
div.sphinxsidebar form {
margin-top: 10px;
}
div.sphinxsidebar input {
border: 1px solid #98dbcc;
font-family: sans-serif;
font-size: 1em;
}
div.sphinxsidebar #searchbox input[type="text"] {
width: 170px;
}
img {
border: 0;
max-width: 100%;
}
/* -- search page ----------------------------------------------------------- */
ul.search {
margin: 10px 0 0 20px;
padding: 0;
}
ul.search li {
padding: 5px 0 5px 20px;
background-image: url(file.png);
background-repeat: no-repeat;
background-position: 0 7px;
}
ul.search li a {
font-weight: bold;
}
ul.search li div.context {
color: #888;
margin: 2px 0 0 30px;
text-align: left;
}
ul.keywordmatches li.goodmatch a {
font-weight: bold;
}
/* -- index page ------------------------------------------------------------ */
table.contentstable {
width: 90%;
margin-left: auto;
margin-right: auto;
}
table.contentstable p.biglink {
line-height: 150%;
}
a.biglink {
font-size: 1.3em;
}
span.linkdescr {
font-style: italic;
padding-top: 5px;
font-size: 90%;
}
/* -- general index --------------------------------------------------------- */
table.indextable {
width: 100%;
}
table.indextable td {
text-align: left;
vertical-align: top;
}
table.indextable ul {
margin-top: 0;
margin-bottom: 0;
list-style-type: none;
}
table.indextable > tbody > tr > td > ul {
padding-left: 0em;
}
table.indextable tr.pcap {
height: 10px;
}
table.indextable tr.cap {
margin-top: 10px;
background-color: #f2f2f2;
}
img.toggler {
margin-right: 3px;
margin-top: 3px;
cursor: pointer;
}
div.modindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}
div.genindex-jumpbox {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 1em 0 1em 0;
padding: 0.4em;
}
/* -- domain module index --------------------------------------------------- */
table.modindextable td {
padding: 2px;
border-collapse: collapse;
}
/* -- general body styles --------------------------------------------------- */
div.body p, div.body dd, div.body li, div.body blockquote {
-moz-hyphens: auto;
-ms-hyphens: auto;
-webkit-hyphens: auto;
hyphens: auto;
}
a.headerlink {
visibility: hidden;
}
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
h4:hover > a.headerlink,
h5:hover > a.headerlink,
h6:hover > a.headerlink,
dt:hover > a.headerlink,
caption:hover > a.headerlink,
p.caption:hover > a.headerlink,
div.code-block-caption:hover > a.headerlink {
visibility: visible;
}
div.body p.caption {
text-align: inherit;
}
div.body td {
text-align: left;
}
.first {
margin-top: 0 !important;
}
p.rubric {
margin-top: 30px;
font-weight: bold;
}
img.align-left, .figure.align-left, object.align-left {
clear: left;
float: left;
margin-right: 1em;
}
img.align-right, .figure.align-right, object.align-right {
clear: right;
float: right;
margin-left: 1em;
}
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left;
}
.align-center {
text-align: center;
}
.align-right {
text-align: right;
}
/* -- sidebars -------------------------------------------------------------- */
div.sidebar {
margin: 0 0 0.5em 1em;
border: 1px solid #ddb;
padding: 7px 7px 0 7px;
background-color: #ffe;
width: 40%;
float: right;
}
p.sidebar-title {
font-weight: bold;
}
/* -- topics ---------------------------------------------------------------- */
div.topic {
border: 1px solid #ccc;
padding: 7px 7px 0 7px;
margin: 10px 0 10px 0;
}
p.topic-title {
font-size: 1.1em;
font-weight: bold;
margin-top: 10px;
}
/* -- admonitions ----------------------------------------------------------- */
div.admonition {
margin-top: 10px;
margin-bottom: 10px;
padding: 7px;
}
div.admonition dt {
font-weight: bold;
}
div.admonition dl {
margin-bottom: 0;
}
p.admonition-title {
margin: 0px 10px 5px 0px;
font-weight: bold;
}
div.body p.centered {
text-align: center;
margin-top: 25px;
}
/* -- tables ---------------------------------------------------------------- */
table.docutils {
border: 0;
border-collapse: collapse;
}
table caption span.caption-number {
font-style: italic;
}
table caption span.caption-text {
}
table.docutils td, table.docutils th {
padding: 1px 8px 1px 5px;
border-top: 0;
border-left: 0;
border-right: 0;
border-bottom: 1px solid #aaa;
}
table.footnote td, table.footnote th {
border: 0 !important;
}
th {
text-align: left;
padding-right: 5px;
}
table.citation {
border-left: solid 1px gray;
margin-left: 1px;
}
table.citation td {
border-bottom: none;
}
/* -- figures --------------------------------------------------------------- */
div.figure {
margin: 0.5em;
padding: 0.5em;
}
div.figure p.caption {
padding: 0.3em;
}
div.figure p.caption span.caption-number {
font-style: italic;
}
div.figure p.caption span.caption-text {
}
/* -- field list styles ----------------------------------------------------- */
table.field-list td, table.field-list th {
border: 0 !important;
}
.field-list ul {
margin: 0;
padding-left: 1em;
}
.field-list p {
margin: 0;
}
/* -- other body styles ----------------------------------------------------- */
ol.arabic {
list-style: decimal;
}
ol.loweralpha {
list-style: lower-alpha;
}
ol.upperalpha {
list-style: upper-alpha;
}
ol.lowerroman {
list-style: lower-roman;
}
ol.upperroman {
list-style: upper-roman;
}
dl {
margin-bottom: 15px;
}
dd p {
margin-top: 0px;
}
dd ul, dd table {
margin-bottom: 10px;
}
dd {
margin-top: 3px;
margin-bottom: 10px;
margin-left: 30px;
}
dt:target, .highlighted {
background-color: #fbe54e;
}
dl.glossary dt {
font-weight: bold;
font-size: 1.1em;
}
.optional {
font-size: 1.3em;
}
.sig-paren {
font-size: larger;
}
.versionmodified {
font-style: italic;
}
.system-message {
background-color: #fda;
padding: 5px;
border: 3px solid red;
}
.footnote:target {
background-color: #ffa;
}
.line-block {
display: block;
margin-top: 1em;
margin-bottom: 1em;
}
.line-block .line-block {
margin-top: 0;
margin-bottom: 0;
margin-left: 1.5em;
}
.guilabel, .menuselection {
font-family: sans-serif;
}
.accelerator {
text-decoration: underline;
}
.classifier {
font-style: oblique;
}
abbr, acronym {
border-bottom: dotted 1px;
cursor: help;
}
/* -- code displays --------------------------------------------------------- */
pre {
overflow: auto;
overflow-y: hidden; /* fixes display issues on Chrome browsers */
}
span.pre {
-moz-hyphens: none;
-ms-hyphens: none;
-webkit-hyphens: none;
hyphens: none;
}
td.linenos pre {
padding: 5px 0px;
border: 0;
background-color: transparent;
color: #aaa;
}
table.highlighttable {
margin-left: 0.5em;
}
table.highlighttable td {
padding: 0 0.5em 0 0.5em;
}
div.code-block-caption {
padding: 2px 5px;
font-size: small;
}
div.code-block-caption code {
background-color: transparent;
}
div.code-block-caption + div > div.highlight > pre {
margin-top: 0;
}
div.code-block-caption span.caption-number {
padding: 0.1em 0.3em;
font-style: italic;
}
div.code-block-caption span.caption-text {
}
div.literal-block-wrapper {
padding: 1em 1em 0;
}
div.literal-block-wrapper div.highlight {
margin: 0;
}
code.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
code.descclassname {
background-color: transparent;
}
code.xref, a code {
background-color: transparent;
font-weight: bold;
}
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
background-color: transparent;
}
.viewcode-link {
float: right;
}
.viewcode-back {
float: right;
font-family: sans-serif;
}
div.viewcode-block:target {
margin: -1px -10px;
padding: 0 10px;
}
/* -- math display ---------------------------------------------------------- */
img.math {
vertical-align: middle;
}
div.body div.math p {
text-align: center;
}
span.eqno {
float: right;
}
span.eqno a.headerlink {
position: relative;
left: 0px;
z-index: 1;
}
div.math:hover a.headerlink {
visibility: visible;
}
/* -- printout stylesheet --------------------------------------------------- */
@media print {
div.document,
div.documentwrapper,
div.bodywrapper {
margin: 0 !important;
width: 100%;
}
div.sphinxsidebar,
div.related,
div.footer,
#top-link {
display: none;
}
}
\ No newline at end of file
.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../font/fontawesome_webfont.eot");src:url("../font/fontawesome_webfont.eot?#iefix") format("embedded-opentype"),url("../font/fontawesome_webfont.woff") format("woff"),url("../font/fontawesome_webfont.ttf") format("truetype"),url("../font/fontawesome_webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:0.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}
/*# sourceMappingURL=badge_only.css.map */
This diff could not be displayed because it is too large.
/*
* doctools.js
* ~~~~~~~~~~~
*
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/**
* select a different prefix for underscore
*/
$u = _.noConflict();
/**
* make the code below compatible with browsers without
* an installed firebug like debugger
if (!window.console || !console.firebug) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
"dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
"profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {};
}
*/
/**
* small helper function to urldecode strings
*/
jQuery.urldecode = function(x) {
return decodeURIComponent(x).replace(/\+/g, ' ');
};
/**
* small helper function to urlencode strings
*/
jQuery.urlencode = encodeURIComponent;
/**
* This function returns the parsed url parameters of the
* current request. Multiple values per key are supported,
* it will always return arrays of strings for the value parts.
*/
jQuery.getQueryParameters = function(s) {
if (typeof s == 'undefined')
s = document.location.search;
var parts = s.substr(s.indexOf('?') + 1).split('&');
var result = {};
for (var i = 0; i < parts.length; i++) {
var tmp = parts[i].split('=', 2);
var key = jQuery.urldecode(tmp[0]);
var value = jQuery.urldecode(tmp[1]);
if (key in result)
result[key].push(value);
else
result[key] = [value];
}
return result;
};
/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
*/
jQuery.fn.highlightText = function(text, className) {
function highlight(node) {
if (node.nodeType == 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
var span = document.createElement("span");
span.className = className;
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
node.nextSibling));
node.nodeValue = val.substr(0, pos);
}
}
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
highlight(this);
});
}
}
return this.each(function() {
highlight(this);
});
};
/*
* backward compatibility for jQuery.browser
* This will be supported until firefox bug is fixed.
*/
if (!jQuery.browser) {
jQuery.uaMatch = function(ua) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
jQuery.browser = {};
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
}
/**
* Small JavaScript module for the documentation.
*/
var Documentation = {
init : function() {
this.fixFirefoxAnchorBug();
this.highlightSearchWords();
this.initIndexTable();
},
/**
* i18n support
*/
TRANSLATIONS : {},
PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
LOCALE : 'unknown',
// gettext and ngettext don't access this so that the functions
// can safely bound to a different name (_ = Documentation.gettext)
gettext : function(string) {
var translated = Documentation.TRANSLATIONS[string];
if (typeof translated == 'undefined')
return string;
return (typeof translated == 'string') ? translated : translated[0];
},
ngettext : function(singular, plural, n) {
var translated = Documentation.TRANSLATIONS[singular];
if (typeof translated == 'undefined')
return (n == 1) ? singular : plural;
return translated[Documentation.PLURALEXPR(n)];
},
addTranslations : function(catalog) {
for (var key in catalog.messages)
this.TRANSLATIONS[key] = catalog.messages[key];
this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
this.LOCALE = catalog.locale;
},
/**
* add context elements like header anchor links
*/
addContextElements : function() {
$('div[id] > :header:first').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this headline')).
appendTo(this);
});
$('dt[id]').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this definition')).
appendTo(this);
});
},
/**
* workaround a firefox stupidity
* see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
*/
fixFirefoxAnchorBug : function() {
if (document.location.hash)
window.setTimeout(function() {
document.location.href += '';
}, 10);
},
/**
* highlight the search words provided in the url in the text
*/
highlightSearchWords : function() {
var params = $.getQueryParameters();
var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
if (terms.length) {
var body = $('div.body');
if (!body.length) {
body = $('body');
}
window.setTimeout(function() {
$.each(terms, function() {
body.highlightText(this.toLowerCase(), 'highlighted');
});
}, 10);
$('<p class="highlight-link"><a href="javascript:Documentation.' +
'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
.appendTo($('#searchbox'));
}
},
/**
* init the domain index toggle buttons
*/
initIndexTable : function() {
var togglers = $('img.toggler').click(function() {
var src = $(this).attr('src');
var idnum = $(this).attr('id').substr(7);
$('tr.cg-' + idnum).toggle();
if (src.substr(-9) == 'minus.png')
$(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
else
$(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
}).css('display', '');
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
togglers.click();
}
},
/**
* helper function to hide the search marks again
*/
hideSearchWords : function() {
$('#searchbox .highlight-link').fadeOut(300);
$('span.highlighted').removeClass('highlighted');
},
/**
* make the url absolute
*/
makeURL : function(relativeURL) {
return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
},
/**
* get the current relative url
*/
getCurrentURL : function() {
var path = document.location.pathname;
var parts = path.split(/\//);
$.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
if (this == '..')
parts.pop();
});
var url = parts.join('/');
return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
},
initOnKeyListeners: function() {
$(document).keyup(function(event) {
var activeElementType = document.activeElement.tagName;
// don't navigate when in search box or textarea
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
switch (event.keyCode) {
case 37: // left
var prevHref = $('link[rel="prev"]').prop('href');
if (prevHref) {
window.location.href = prevHref;
return false;
}
case 39: // right
var nextHref = $('link[rel="next"]').prop('href');
if (nextHref) {
window.location.href = nextHref;
return false;
}
}
}
});
}
};
// quick alias for translations
_ = Documentation.gettext;
$(document).ready(function() {
Documentation.init();
});
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"sphinx-rtd-theme":[function(require,module,exports){
var jQuery = (typeof(window) != 'undefined') ? window.jQuery : require('jquery');
// Sphinx theme nav state
function ThemeNav () {
var nav = {
navBar: null,
win: null,
winScroll: false,
winResize: false,
linkScroll: false,
winPosition: 0,
winHeight: null,
docHeight: null,
isRunning: false
};
nav.enable = function () {
var self = this;
if (!self.isRunning) {
self.isRunning = true;
jQuery(function ($) {
self.init($);
self.reset();
self.win.on('hashchange', self.reset);
// Set scroll monitor
self.win.on('scroll', function () {
if (!self.linkScroll) {
self.winScroll = true;
}
});
setInterval(function () { if (self.winScroll) self.onScroll(); }, 25);
// Set resize monitor
self.win.on('resize', function () {
self.winResize = true;
});
setInterval(function () { if (self.winResize) self.onResize(); }, 25);
self.onResize();
});
};
};
nav.init = function ($) {
var doc = $(document),
self = this;
this.navBar = $('div.wy-side-scroll:first');
this.win = $(window);
// Set up javascript UX bits
$(document)
// Shift nav in mobile when clicking the menu.
.on('click', "[data-toggle='wy-nav-top']", function() {
$("[data-toggle='wy-nav-shift']").toggleClass("shift");
$("[data-toggle='rst-versions']").toggleClass("shift");
})
// Nav menu link click operations
.on('click', ".wy-menu-vertical .current ul li a", function() {
var target = $(this);
// Close menu when you click a link.
$("[data-toggle='wy-nav-shift']").removeClass("shift");
$("[data-toggle='rst-versions']").toggleClass("shift");
// Handle dynamic display of l3 and l4 nav lists
self.toggleCurrent(target);
self.hashChange();
})
.on('click', "[data-toggle='rst-current-version']", function() {
$("[data-toggle='rst-versions']").toggleClass("shift-up");
})
// Make tables responsive
$("table.docutils:not(.field-list)")
.wrap("<div class='wy-table-responsive'></div>");
// Add expand links to all parents of nested ul
$('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {
var link = $(this);
expand = $('<span class="toctree-expand"></span>');
expand.on('click', function (ev) {
self.toggleCurrent(link);
ev.stopPropagation();
return false;
});
link.prepend(expand);
});
};
nav.reset = function () {
// Get anchor from URL and open up nested nav
var anchor = encodeURI(window.location.hash);
if (anchor) {
try {
var link = $('.wy-menu-vertical')
.find('[href="' + anchor + '"]');
// If we didn't find a link, it may be because we clicked on
// something that is not in the sidebar (eg: when using
// sphinxcontrib.httpdomain it generates headerlinks but those
// aren't picked up and placed in the toctree). So let's find
// the closest header in the document and try with that one.
if (link.length === 0) {
var doc_link = $('.document a[href="' + anchor + '"]');
var closest_section = doc_link.closest('div.section');
// Try again with the closest section entry.
link = $('.wy-menu-vertical')
.find('[href="#' + closest_section.attr("id") + '"]');
}
$('.wy-menu-vertical li.toctree-l1 li.current')
.removeClass('current');
link.closest('li.toctree-l2').addClass('current');
link.closest('li.toctree-l3').addClass('current');
link.closest('li.toctree-l4').addClass('current');
}
catch (err) {
console.log("Error expanding nav for anchor", err);
}
}
};
nav.onScroll = function () {
this.winScroll = false;
var newWinPosition = this.win.scrollTop(),
winBottom = newWinPosition + this.winHeight,
navPosition = this.navBar.scrollTop(),
newNavPosition = navPosition + (newWinPosition - this.winPosition);
if (newWinPosition < 0 || winBottom > this.docHeight) {
return;
}
this.navBar.scrollTop(newNavPosition);
this.winPosition = newWinPosition;
};
nav.onResize = function () {
this.winResize = false;
this.winHeight = this.win.height();
this.docHeight = $(document).height();
};
nav.hashChange = function () {
this.linkScroll = true;
this.win.one('hashchange', function () {
this.linkScroll = false;
});
};
nav.toggleCurrent = function (elem) {
var parent_li = elem.closest('li');
parent_li.siblings('li.current').removeClass('current');
parent_li.siblings().find('li.current').removeClass('current');
parent_li.find('> ul li.current').removeClass('current');
parent_li.toggleClass('current');
}
return nav;
};
module.exports.ThemeNav = ThemeNav();
if (typeof(window) != 'undefined') {
window.SphinxRtdTheme = { StickyNav: module.exports.ThemeNav };
}
},{"jquery":"jquery"}]},{},["sphinx-rtd-theme"]);
.highlight .hll { background-color: #ffffcc }
.highlight { background: #eeffcc; }
.highlight .c { color: #408090; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #007020 } /* Comment.Preproc */
.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #333333 } /* Generic.Output */
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0044DD } /* Generic.Traceback */
.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #007020 } /* Keyword.Pseudo */
.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #902000 } /* Keyword.Type */
.highlight .m { color: #208050 } /* Literal.Number */
.highlight .s { color: #4070a0 } /* Literal.String */
.highlight .na { color: #4070a0 } /* Name.Attribute */
.highlight .nb { color: #007020 } /* Name.Builtin */
.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.highlight .no { color: #60add5 } /* Name.Constant */
.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #007020 } /* Name.Exception */
.highlight .nf { color: #06287e } /* Name.Function */
.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #bb60d5 } /* Name.Variable */
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #208050 } /* Literal.Number.Bin */
.highlight .mf { color: #208050 } /* Literal.Number.Float */
.highlight .mh { color: #208050 } /* Literal.Number.Hex */
.highlight .mi { color: #208050 } /* Literal.Number.Integer */
.highlight .mo { color: #208050 } /* Literal.Number.Oct */
.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.highlight .sx { color: #c65d09 } /* Literal.String.Other */
.highlight .sr { color: #235388 } /* Literal.String.Regex */
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #06287e } /* Name.Function.Magic */
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
\ No newline at end of file
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index &mdash; auth_serv 1.0 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="#"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="auth_serv 1.0 documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> auth_serv
</a>
<div class="version">
1.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">目录:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="01-summary.html">1. 概述</a></li>
<li class="toctree-l1"><a class="reference internal" href="02-db.html">2. 数据库设计</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-api-login.html">3. 登录认证接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="21-auth-api.html">4. API管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="22-auth-menu.html">5. 菜单管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="30-api-base.html">6. 基本管理接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="99-history.html">7. 修订历史</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">auth_serv</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Index</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<h1 id="index">Index</h1>
<div class="genindex-jumpbox">
</div>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2017, yuanchao.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
No preview for this file type
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search &mdash; auth_serv 1.0 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="#"/>
<link rel="top" title="auth_serv 1.0 documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> auth_serv
</a>
<div class="version">
1.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="#" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">目录:</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="01-summary.html">1. 概述</a></li>
<li class="toctree-l1"><a class="reference internal" href="02-db.html">2. 数据库设计</a></li>
<li class="toctree-l1"><a class="reference internal" href="10-api-login.html">3. 登录认证接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="21-auth-api.html">4. API管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="22-auth-menu.html">5. 菜单管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="30-api-base.html">6. 基本管理接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="99-history.html">7. 修订历史</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">auth_serv</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Search</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<noscript>
<div id="fallback" class="admonition warning">
<p class="last">
Please activate JavaScript to enable the search
functionality.
</p>
</div>
</noscript>
<div id="search-results">
</div>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2017, yuanchao.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/searchtools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
<script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); });
</script>
<script type="text/javascript" id="searchindexloader"></script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>1. 概述 &mdash; code_serv 1.0 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="code_serv 1.0 documentation" href="index.html"/>
<link rel="next" title="2. 数据库设计" href="20-db.html"/>
<link rel="prev" title="公共编码服务" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> code_serv
</a>
<div class="version">
1.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">1. 概述</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id2">1.1. 概述</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">1.2. 术语</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id4">1.3. 关于接口返回内容的统一说明</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="20-db.html">2. 数据库设计</a></li>
<li class="toctree-l1"><a class="reference internal" href="30-api-simple.html">3. 简单编码接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="40-api-event.html">4. 事件分类编码接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="41-api-place.html">5. 地区类型编码接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="42-api-traffic.html">6. 交通相关分类编码接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="50-api-custom.html">7. 自定义编码接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="99-history.html">8. 修订历史</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">code_serv</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>1. 概述</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/10-summary.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="id1">
<h1>1. 概述<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h1>
<div class="section" id="id2">
<h2>1.1. 概述<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h2>
<blockquote>
<div>本服务用于为平台的各项服务提供统一的编码。</div></blockquote>
</div>
<div class="section" id="id3">
<h2>1.2. 术语<a class="headerlink" href="#id3" title="Permalink to this headline"></a></h2>
<blockquote>
<div><ul class="simple">
<li>编码:对常用的公共内容进行编码。</li>
</ul>
</div></blockquote>
</div>
<div class="section" id="id4">
<h2>1.3. 关于接口返回内容的统一说明<a class="headerlink" href="#id4" title="Permalink to this headline"></a></h2>
<ol class="arabic simple">
<li>采用标准HTTP返回状态码向接口调用者指出操作是否成功,例如2xx均表示成功,4xx和5xx表示失败。</li>
<li>对于HTTP返回状态码2xx的情况,本文档各个接口分别规定了其响应内容的格式(即Response Body规定的格式)。</li>
<li>对于HTTP返回状态码非2xx的情况,可以不返回任何响应内容,即不含有Response Body。但是也可以返回一个以下格式的Response Body向调用者给出更详细的错误指示:</li>
</ol>
<blockquote>
<div><div class="line-block">
<div class="line">{</div>
<div class="line-block">
<div class="line">“ecode”: 0, # 整数类型,是平台自定义的错误码</div>
<div class="line">“enote”: “The camera is created ok.” # 字符串,关于错误的说明</div>
</div>
<div class="line">}</div>
</div>
</div></blockquote>
<ol class="arabic" start="4">
<li><p class="first">关于GET请求的统一参数的说明:</p>
<blockquote>
<div><blockquote>
<div><p>GET请求一般来说至少需要支持以下四个参数:</p>
</div></blockquote>
<ul class="simple">
<li>offset: 本次返回列表项的起始偏移量,用于分页,不出现为0</li>
<li>limit: 本次返回列表项的最大数量,用于分页,不出现为30</li>
<li>order: 排序方向,asc表示升序,desc表示降序,不出现为desc</li>
<li>sortby: 排序关键字,由各个接口决定,参见各个接口说明。</li>
</ul>
</div></blockquote>
</li>
</ol>
</div>
</div>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="20-db.html" class="btn btn-neutral float-right" title="2. 数据库设计" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="index.html" class="btn btn-neutral" title="公共编码服务" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2017, Yuan Chao.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>8. 修订历史 &mdash; code_serv 1.0 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="index" title="Index"
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="code_serv 1.0 documentation" href="index.html"/>
<link rel="prev" title="7. 自定义编码接口" href="50-api-custom.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> code_serv
</a>
<div class="version">
1.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="10-summary.html">1. 概述</a></li>
<li class="toctree-l1"><a class="reference internal" href="20-db.html">2. 数据库设计</a></li>
<li class="toctree-l1"><a class="reference internal" href="30-api-simple.html">3. 简单编码接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="40-api-event.html">4. 事件分类编码接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="41-api-place.html">5. 地区类型编码接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="42-api-traffic.html">6. 交通相关分类编码接口</a></li>
<li class="toctree-l1"><a class="reference internal" href="50-api-custom.html">7. 自定义编码接口</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">8. 修订历史</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id2">8.1. 2017.05.09</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">8.2. 2017.07.05</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id4">8.3. 2017.08.15</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id5">8.4. 2017.09.26</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id6">8.5. 2017.10.26</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id7">8.6. 2018.01.30</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">code_serv</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>8. 修订历史</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/99-history.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="id1">
<h1>8. 修订历史<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h1>
<div class="section" id="id2">
<h2>8.1. 2017.05.09<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h2>
<ol class="arabic simple">
<li>第一版</li>
</ol>
</div>
<div class="section" id="id3">
<h2>8.2. 2017.07.05<a class="headerlink" href="#id3" title="Permalink to this headline"></a></h2>
<ol class="arabic simple">
<li>新增了交通相关的编码表。</li>
<li>修改了简单编码表的API Path。</li>
<li>新增了交通编码表的API。</li>
</ol>
</div>
<div class="section" id="id4">
<h2>8.3. 2017.08.15<a class="headerlink" href="#id4" title="Permalink to this headline"></a></h2>
<ol class="arabic simple">
<li>新增了自定义编码表和接口。</li>
</ol>
</div>
<div class="section" id="id5">
<h2>8.4. 2017.09.26<a class="headerlink" href="#id5" title="Permalink to this headline"></a></h2>
<ol class="arabic simple">
<li>修改了“自定义编码类别表(tb_custom_cate)”,把app_name改为prj_name。</li>
<li>修改了”自定义编码接口”,把所有app_name字段改为prj_name。</li>
</ol>
</div>
<div class="section" id="id6">
<h2>8.5. 2017.10.26<a class="headerlink" href="#id6" title="Permalink to this headline"></a></h2>
<ol class="arabic simple">
<li>修改了“获取省列表”和“读取一个省”接口,可以指定depth参数,当depth=1时,给出下级市的列表。</li>
</ol>
</div>
<div class="section" id="id7">
<h2>8.6. 2018.01.30<a class="headerlink" href="#id7" title="Permalink to this headline"></a></h2>
<ol class="arabic simple">
<li>添加自定义编码修改接口7.3.5。</li>
</ol>
</div>
</div>
</div>
<div class="articleComments">
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="50-api-custom.html" class="btn btn-neutral" title="7. 自定义编码接口" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2017, Yuan Chao.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
\ No newline at end of file
概述
=======================
概述
-----------
本服务用于为平台的各项服务提供统一的编码。
术语
-----------
- 编码:对常用的公共内容进行编码。
关于接口返回内容的统一说明
----------------------------
1. 采用标准HTTP返回状态码向接口调用者指出操作是否成功,例如2xx均表示成功,4xx和5xx表示失败。
2. 对于HTTP返回状态码2xx的情况,本文档各个接口分别规定了其响应内容的格式(即Response Body规定的格式)。
3. 对于HTTP返回状态码非2xx的情况,可以不返回任何响应内容,即不含有Response Body。但是也可以返回一个以下格式的Response Body向调用者给出更详细的错误指示:
| {
| "ecode": 0, # 整数类型,是平台自定义的错误码
| "enote": "The camera is created ok." # 字符串,关于错误的说明
| }
4. 关于GET请求的统一参数的说明:
GET请求一般来说至少需要支持以下四个参数:
- offset: 本次返回列表项的起始偏移量,用于分页,不出现为0
- limit: 本次返回列表项的最大数量,用于分页,不出现为30
- order: 排序方向,asc表示升序,desc表示降序,不出现为desc
- sortby: 排序关键字,由各个接口决定,参见各个接口说明。
简单编码接口
=======================
术语
---------
- 简单编码:是指简单的{code:name}映射关系,不会再有下级分类,例如性别。
- 简单编码类别:简单编码的类别,例如性别,证件类型,用一个字符串表示。
简单编码类别处理
------------------
添加简单编码类别
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/simple/cates
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
Request Body
.. code-block:: python
{
"cate_code": "sex",
"name": "性别",
"note": "人的性别",
}
Response Body
.. code-block:: python
{
"cate_unid": "xxxx",
"cate_code": "sex",
"name": "性别",
"note": "人的性别",
}
获取简单编码类别列表
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/simple/cates
| Header: (authorization, {$auth_atoken})
| Params:
Response Body
.. code-block:: python
{
"total_num": 10, # 总数量
"list_size": 10, # 本次返回的列表项数量
"offset": 0, # 本次返回项目的起始索引
"list_data": [
{
"cate_unid": "xxxx",
"cate_code": "sex",
"name": "性别",
"note": "人的性别",
},
{
"cate_unid": "xxxx",
"cate_code": "card_type",
"name": "证件类别",
"note": "证件的类型,例如身份证,护照"
}
...
]
}
读取简单编码类别
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/simple/cates/{$cate_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
Response Body
.. code-block:: python
{
"cate_unid": "xxxx",
"cate_code": "sex",
"name": "性别",
"note": "人的性别"
}
修改简单编码类别
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/simple/cates/{$cate_unid}
| Header: (authorization, {$auth_atoken})
| Params:
| Request Body
| {
| "cate_code": "sex",
| "name": "性别",
| "note": "人的性别",
| }
| Response Body
| {
| "cate_unid": "xxxx",
| "cate_code": "sex",
| "name": "性别",
| "note": "人的性别",
| }
删除简单编码类别
^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/simple/cates/{$cate_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
简单编码处理
------------------
添加简单编码
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/simple/cates/{$cate_unid}/codes
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body
| {
| "code": "1",
| "name": "性别",
| "note": "人的性别",
| }
| Response Body
| {
| "code_unid": "xxxx",
| "code": "1",
| "name": "性别",
| "note": "人的性别",
| }
获取简单编码列表
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/simple/cates/{$cate_unid}/codes
| Header: (authorization, {$auth_atoken})
| Params:
| Response Body
| {
| "total_num": 10, # 总数量
| "list_size": 10, # 本次返回的列表项数量
| "offset": 0, # 本次返回项目的起始索引
| "list_data":[
| {
| "code_unid": "xxxx",
| "code": "1",
| "name": "男",
| "note": "男性",
| }
| ...
| ]
| }
读取一个简单编码
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/simple/cates/{$cate_unid}/codes/{$code_unid}
| Header: (authorization, {$auth_atoken})
| Params:
| Response Body
| {
| "code_unid": "xxxx",
| "code": "1",
| "name": "男",
| "note": "男性",
| }
修改简单编码
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/simple/cates/{$cate_unid}/codes/{$code_unid}
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Params:
| Request Body
| {
| "code": "1",
| "name": "男",
| "note": "男性",
| }
| Response Body
| {
| "code_unid": "xxxx",
| "code": "1",
| "name": "男",
| "note": "男性",
| }
删除简单编码
^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/simple/cates/{$cate_unid}/codes/{$code_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
事件分类编码接口
=======================
术语
---------
- 事件分类:是指事件的大分类,例如人脸事件,用户一般不直接使用。
- 事件类型:事件的具体类型,例如越界,奔跑等。
事件分类
------------------
添加事件分类
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/event_cates
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body:
| {
| "code": "face",
| "name": "人脸事件",
| "note": "人脸检测事件",
| }
| Response Body:
| {
| "event_cate_unid": "xxxx",
| "code": "face",
| "name": "人脸事件",
| "note": "人脸检测事件",
| }
获取事件分类列表
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/event_cates
| Header: (authorization, {$auth_atoken})
| Response Body:
| {
| "total_num": 10, # 总数量
| "list_size": 10, # 本次返回的列表项数量
| "offset": 0, # 本次返回项目的起始索引
| "list_data":[
| {
| "event_cate_unid": "xxxx",
| "code": "face",
| "name": "人脸事件",
| "note": "人脸检测事件",
| },
| {
| "event_cate_unid": "xxxx",
| "code": "border",
| "name": "周界事件",
| },
| ...
| ]
| }
修改事件分类
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/event_cates/{$event_cate_unid}
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body
| {
| "code": "face",
| "name": "人脸事件",
| "note": "人脸检测事件",
| }
| Response Body
| {
| "event_cate_unid": "xxxx",
| "code": "face",
| "name": "人脸事件",
| "note": "人脸检测事件",
| }
删除事件分类
^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/event_cates/{$event_cate_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
事件类型
------------------
添加类型
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/event_types
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body
| {
| "event_cate_unid": "xxxx",
| "code": "1",
| "name": "双向越界",
| "note": "",
| }
| Response Body
| {
| "event_cate_unid": "xxxx",
| "event_type_unid": "xxxx",
| "code": "1",
| "name": "双向越界",
| "note": "",
| }
获取类型列表
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/event_types
| Header: (authorization, {$auth_atoken})
| Param:
| ?event_cate={$event_cate_unid}
| Response Body
| {
| "total_num": 10, # 总数量
| "list_size": 10, # 本次返回的列表项数量
| "offset": 0, # 本次返回项目的起始索引
| "list_data":[
| {
| "event_cate_unid": "xxxx",
| "event_type_unid": "xxxx",
| "code": "1",
| "name": "双向越界",
| }
| ...
| ]
| }
读取一个类型
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/event_types/{$event_type_unid}
| Header: (authorization, {$auth_atoken})
| Response Body:
| {
| "event_cate_unid": "xxxx",
| "event_type_unid": "xxxx",
| "code": "1",
| "name": "双向越界",
| "note": "",
| }
修改类型
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/event_types/{$event_type_unid}
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body
| {
| "event_cate_unid": "xxxx",
| "code": "1",
| "name": "双向越界",
| "note": "",
| }
| Response Body
| {
| "event_type_unid": "xxxx",
| "event_cate_unid": "xxxx",
| "code": "1",
| "name": "双向越界",
| "note": "",
| }
删除类型
^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/event_types/{$event_type_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
地区类型编码接口
=======================
地区结构
---------
country(国家) -> province (省) -> city(市) ->(区/县)
国家
------------------
添加国家
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/countries
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body
| {
| "code": "CN",
| "name": "中国",
| "note": "中华人民共和国",
| }
| Response Body
| {
| "country_unid": "xxxx",
| "code": "CN",
| "name": "中国",
| "note": "中华人民共和国",
| }
获取国家列表
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/countries
| Header: (authorization, {$auth_atoken})
| Params:
| Response Body
| {
| "total_num": 10, # 总数量
| "list_size": 10, # 本次返回的列表项数量
| "offset": 0, # 本次返回项目的起始索引
| "list_data":[
| {
| "country_unid": "xxxx",
| "code": "CN",
| "name": "中国",
| "note": "中华人民共和国",
| },
| ...
| ]
| }
修改国家
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/countries/{$country_unid}
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Params:
| Request Body
| {
| "code": "CN",
| "name": "中国",
| "note": "中华人民共和国",
| }
| Response Body
| {
| "country_unid": "xxxx",
| "code": "CN",
| "name": "中国",
| "note": "中华人民共和国",
| }
删除国家
^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/countries/{$country_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
省/直辖市/自治区
------------------
添加省
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/countries/{$country_unid}/provinces
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body
| {
| "code": "BJ",
| "name": "北京",
| "note": ""
| }
| Response Body
| {
| "province_unid": "xxxx",
| "code": "BJ",
| "name": "北京",
| "note": ""
| }
获取省列表
^^^^^^^^^^^^^^^^^^^^^
| ``Verb: GET``
| ``Path:`` /api/v1/codes/countries/{$country_unid}/provinces
| ``Header:`` (authorization, {$auth_atoken})
| ``Request Params:``
- depth: 表示获取下级子节点的深度,默认为0,仅获取省列表,为1表示同时获取省的下一级市的列表。
| ``Response Body``
当depth=0或depth参数不存在时:
.. code-block:: python
{
"total_num": 10, # 总数量
"list_size": 10, # 本次返回的列表项数量
"offset": 0, # 本次返回项目的起始索引
"list_data":[
{
"province_unid": "xxxx",
"code": "BJ",
"name": "北京",
"note": ""
}
...
]
}
当depth=1时:
.. code-block:: python
{
"total_num": 10, # 总数量
"list_size": 10, # 本次返回的列表项数量
"offset": 0, # 本次返回项目的起始索引
"list_data":[
{
"province_unid": "xxxx",
"code": "BJ",
"name": "北京",
"note": "",
"cities": {
"total_num": 10, # 总数量
"list_size": 10, # 本次返回的列表项数量
"offset": 0, # 本次返回项目的起始索引
"list_data":[
{
"city_unid": "xxxx",
"code": "Hebi",
"name": "鹤壁"
}
...
]
}
}
...
]
}
读取一个省
^^^^^^^^^^^^^^^^^^^^^
| ``Verb: GET``
| ``Path:`` /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}
| ``Header:`` (authorization, {$auth_atoken})
| ``Request Params:``
| ``Response Body``
.. code-block:: python
Response Body
{
"province_unid": "xxxx",
"code": "BJ",
"name": "北京",
"note": ""
}
修改省
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Params:
| Request Body
| {
| "code": "BJ",
| "name": "北京",
| "note": "",
| }
| Response Body
| {
| "province_unid": "xxxx",
| "code": "BJ",
| "name": "北京",
| "note": "",
| }
删除省
^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
地市/自治州
------------------
添加市
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}/cities
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body
| {
| "code": "Hebi",
| "name": "鹤壁",
| "note": "",
| }
| Response Body
| {
| "city_unid": "xxxx",
| "code": "Hebi",
| "name": "鹤壁",
| "note": "",
| }
获取市列表
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}/cities
| Header: (authorization, {$auth_atoken})
| Params:
| Response Body
| {
| "total_num": 10, # 总数量
| "list_size": 10, # 本次返回的列表项数量
| "offset": 0, # 本次返回项目的起始索引
| "list_data":[
| {
| "city_unid": "xxxx",
| "code": "Hebi",
| "name": "鹤壁",
| }
| ...
| ]
| }
读取一个市
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}/cities/{$city_unid}
| Header: (authorization, {$auth_atoken})
| Params:
| Response Body
| {
| "city_unid": "xxxx",
| "code": "Hebi",
| "name": "鹤壁",
| "note": "",
| }
修改市
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}/cities/{$city_unid}
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Params:
| Request Body
| {
| "code": "Hebi",
| "name": "鹤壁",
| "note": "",
| }
| Response Body
| {
| "city_unid": "xxxx",
| "code": "Hebi",
| "name": "鹤壁",
| "note": "",
| }
删除市
^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}/cities/{$city_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
区/县
------------------
添加区县
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}/cities/{$city_unid}/counties
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body
| {
| "code": "321102",
| "name": "京口区",
| "note": "",
| }
| Response Body
| {
| "county_unid": "xxxx",
| "code": "321102",
| "name": "京口区",
| "note": "",
| }
获取区县列表
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}/cities/{$city_unid}/counties
| Header: (authorization, {$auth_atoken})
| Params:
| Response Body
| {
| "total_num": 10, # 总数量
| "list_size": 10, # 本次返回的列表项数量
| "offset": 0, # 本次返回项目的起始索引
| "list_data":[
| {
| "county_unid": "xxxx",
| "code": "321102",
| "name": "京口区",
| }
| ...
| ]
| }
读取一个区县
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}/cities/{$city_unid}/counties/{$county_unid}
| Header: (authorization, {$auth_atoken})
| Params:
| Response Body
| {
| "county_unid": "xxxx",
| "code": "321102",
| "name": "京口区",
| "note": "",
| }
修改区县
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}/cities/{$city_unid}/counties/{$county_unid}
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Params:
| Request Body
| {
| "code": "321102",
| "name": "京口区",
| "note": "",
| }
| Response Body
| {
| "county_unid": "xxxx",
| "code": "321102",
| "name": "京口区",
| "note": "",
| }
删除区县
^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/countries/{$country_unid}/provinces/{$province_unid}/cities/{$city_unid}/counties/{$county_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
交通相关分类编码接口
=======================
术语
---------
- 交通相关分类:是指交通相关的大分类,例如车牌颜色,车辆类型等。
- 交通相关类型:交通相关的具体类型,例如蓝色车牌,黄色车牌等。
交通相关分类
------------------
添加交通相关分类
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/traffic/cates
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body:
.. code-block:: python
{
"cate_code": "plate_color", # 取值参见编码文档
"name": "车牌颜色",
"note": "车牌颜色",
}
Response Body:
{
"cate_unid": "xxxx",
"cate_code": "plate_color",
"name": "车牌颜色",
"note": "车牌颜色",
}
获取交通相关分类列表
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/traffic/cates
| Header: (authorization, {$auth_atoken})
| Response Body:
.. code-block:: python
{
"total_num": 10, # 总数量
"list_size": 10, # 本次返回的列表项数量
"offset": 0, # 本次返回项目的起始索引
"list_data":[
{
"cate_unid": "xxxx",
"cate_code": "plate_color",
"name": "车牌颜色",
"note": "车牌颜色",
},
...
]
}
读取交通一个相关分类
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/traffic/cates/{$cate_unid}
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body: 无
| Response Body:
.. code-block:: python
{
"cate_unid": "xxxx",
"cate_code": "plate_color",
"name": "车牌颜色",
"note": "车牌颜色",
}
修改交通相关分类
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/traffic/cates/{$cate_unid}
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body
.. code-block:: python
{
"cate_code": "plate_color",
"name": "车牌颜色",
"note": "车牌颜色",
}
Response Body
.. code-block:: python
{
"cate_unid": "xxxx",
"cate_code": "plate_color",
"name": "车牌颜色",
"note": "车牌颜色",
}
删除交通相关分类
^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/traffic/cates/{$cate_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
交通相关编码
------------------
添加编码
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/traffic/cates/{$cate_unid}/codes
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body
.. code-block:: python
{
"cate_unid": "xxxx",
"code": "1",
"name": "双向越界",
"note": "",
}
Response Body
.. code-block:: python
{
"cate_unid": "xxxx",
"code_unid": "xxxx",
"code": "1",
"name": "双向越界",
"note": "",
}
获取编码列表
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/traffic/cates/{$cate_unid}/codes
| Header: (authorization, {$auth_atoken})
| Response Body
.. code-block:: python
{
"total_num": 10, # 总数量
"list_size": 10, # 本次返回的列表项数量
"offset": 0, # 本次返回项目的起始索引
"list_data":[
{
"code_unid": "xxxx",
"code": "1",
"name": "双向越界",
}
...
]
}
读取一个编码
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/traffic/cates/{$cate_unid}}/codes/{$code_unid}
| Header: (authorization, {$auth_atoken})
| Response Body:
.. code-block:: python
{
"code_unid": "xxxx",
"code": "1",
"name": "双向越界",
"note": "",
}
修改编码
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/traffic/cates/{$cate_unid}}/codes/{$code_unid}
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
| Request Body
.. code-block:: python
{
"code": "1",
"name": "双向越界",
"note": "",
}
Response Body
.. code-block:: python
{
"code_unid": "xxxx",
"code": "1",
"name": "双向越界",
"note": "",
}
删除编码
^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/traffic/cates/{$cate_unid}}/codes/{$code_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
自定义编码接口
=======================
术语
---------
- 自定义编码:是指用户自定义的编码表,不是所有业务通用的。例如人脸库,对于不同的项目是不同的。
自定义编码类别处理
--------------------
添加自定义编码类别
^^^^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/custom/cates
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
Request Body
.. code-block:: python
{
"prj_name": "nanyang_face", # 项目名称,不同项目有不同的名称,由项目决定。
"cate": "face_lib",
"name": "人脸库",
"note": "人脸库",
}
Response Body:无或者错误指示的json结构体。
获取自定义编码类别列表
^^^^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/custom/cates
| Header: (authorization, {$auth_atoken})
| Params:
| prj_name: 必填,项目名称
Response Body
.. code-block:: python
{
"total_num": 10, # 总数量
"list_size": 10, # 本次返回的列表项数量
"offset": 0, # 本次返回项目的起始索引
"list_data": [
{
"unid": "xxxx",
"prj_name": "nanyang_face", # 项目名称,不同项目有不同的名称,由项目决定。
"cate": "face_lib",
"name": "人脸库",
"note": "人脸库",
},
...
]
}
读取自定义编码类别
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/custom/cates/{$cate_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
Response Body
.. code-block:: python
{
"unid": "xxxx",
"prj_name": "nanyang_face", # 项目名称,不同项目有不同的名称,由项目决定。
"cate": "face_lib",
"name": "人脸库",
"note": "人脸库",
}
删除自定义编码类别
^^^^^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/custom/cates/{$cate_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
**如果有外键关联,则删除失败。**
自定义编码处理
------------------
添加自定义编码
^^^^^^^^^^^^^^^^^^
| Verb: POST
| Path: /api/v1/codes/custom/cates/{$cate_unid}/codes
| Header: (authorization, {$auth_atoken}) (Content-Type, json)
Request Body
.. code-block:: python
{
"code": "1",
"name": "性别",
"note": "人的性别"
}
Response Body:无或者错误指示的json结构体。
获取自定义编码列表
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/custom/cates/{$cate_unid}/codes
| Header: (authorization, {$auth_atoken})
| Params:
| Response Body
.. code-block:: python
{
"total_num": 10, # 总数量
"list_size": 10, # 本次返回的列表项数量
"offset": 0, # 本次返回项目的起始索引
"list_data":[
{
"unid": "xxxx",
"code": "black",
"name": "黑名单",
"note": "黑名单库"
}
...
]
}
读取一个自定义编码
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/custom/cates/{$cate_unid}/codes/{$code_unid}
| Header: (authorization, {$auth_atoken})
| Params:
| Response Body
.. code-block:: python
{
"unid": "xxxx",
"code": "black",
"name": "黑名单",
"note": "黑名单库"
}
删除自定义编码
^^^^^^^^^^^^^^^^
| Verb: DELETE
| Path: /api/v1/codes/custom/cates/{$cate_unid}/codes/{$code_unid}
| Header: (authorization, {$auth_atoken})
| Request Body:无
| Response Body:无或者错误指示的json结构体
修改一个自定义编码
^^^^^^^^^^^^^^^^^^^^^
| Verb: GET
| Path: /api/v1/codes/custom/cates/{$cate_unid}/codes/{$code_unid}
| Header: (authorization, {$auth_atoken})
| Params:
| Response Body
.. code-block:: python
{
"code": "black",
"name": "黑名单",
"note": "黑名单库"
}
修订历史
==========
2017.05.09
------------
1. 第一版
2017.07.05
------------
1. 新增了交通相关的编码表。
2. 修改了简单编码表的API Path。
3. 新增了交通编码表的API。
2017.08.15
------------
1. 新增了自定义编码表和接口。
2017.09.26
------------
1. 修改了“自定义编码类别表(tb_custom_cate)”,把app_name改为prj_name。
2. 修改了"自定义编码接口",把所有app_name字段改为prj_name。
2017.10.26
------------
1. 修改了“获取省列表”和“读取一个省”接口,可以指定depth参数,当depth=1时,给出下级市的列表。
2018.01.30
------------
1. 添加自定义编码修改接口7.3.5。
.. code_serv documentation master file, created by
sphinx-quickstart on Tue May 9 11:59:12 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
公共编码服务
========================
.. toctree::
:maxdepth: 3
:numbered:
:caption: Contents:
10-summary
20-db
30-api-simple
40-api-event
41-api-place
42-api-traffic
50-api-custom
99-history
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
.fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../font/fontawesome_webfont.eot");src:url("../font/fontawesome_webfont.eot?#iefix") format("embedded-opentype"),url("../font/fontawesome_webfont.woff") format("woff"),url("../font/fontawesome_webfont.ttf") format("truetype"),url("../font/fontawesome_webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:0.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}
/*# sourceMappingURL=badge_only.css.map */
This diff could not be displayed because it is too large.
/*
* doctools.js
* ~~~~~~~~~~~
*
* Sphinx JavaScript utilities for all documentation.
*
* :copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
/**
* select a different prefix for underscore
*/
$u = _.noConflict();
/**
* make the code below compatible with browsers without
* an installed firebug like debugger
if (!window.console || !console.firebug) {
var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
"dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
"profile", "profileEnd"];
window.console = {};
for (var i = 0; i < names.length; ++i)
window.console[names[i]] = function() {};
}
*/
/**
* small helper function to urldecode strings
*/
jQuery.urldecode = function(x) {
return decodeURIComponent(x).replace(/\+/g, ' ');
};
/**
* small helper function to urlencode strings
*/
jQuery.urlencode = encodeURIComponent;
/**
* This function returns the parsed url parameters of the
* current request. Multiple values per key are supported,
* it will always return arrays of strings for the value parts.
*/
jQuery.getQueryParameters = function(s) {
if (typeof s == 'undefined')
s = document.location.search;
var parts = s.substr(s.indexOf('?') + 1).split('&');
var result = {};
for (var i = 0; i < parts.length; i++) {
var tmp = parts[i].split('=', 2);
var key = jQuery.urldecode(tmp[0]);
var value = jQuery.urldecode(tmp[1]);
if (key in result)
result[key].push(value);
else
result[key] = [value];
}
return result;
};
/**
* highlight a given string on a jquery object by wrapping it in
* span elements with the given class name.
*/
jQuery.fn.highlightText = function(text, className) {
function highlight(node) {
if (node.nodeType == 3) {
var val = node.nodeValue;
var pos = val.toLowerCase().indexOf(text);
if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
var span = document.createElement("span");
span.className = className;
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
node.nextSibling));
node.nodeValue = val.substr(0, pos);
}
}
else if (!jQuery(node).is("button, select, textarea")) {
jQuery.each(node.childNodes, function() {
highlight(this);
});
}
}
return this.each(function() {
highlight(this);
});
};
/*
* backward compatibility for jQuery.browser
* This will be supported until firefox bug is fixed.
*/
if (!jQuery.browser) {
jQuery.uaMatch = function(ua) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
return {
browser: match[ 1 ] || "",
version: match[ 2 ] || "0"
};
};
jQuery.browser = {};
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
}
/**
* Small JavaScript module for the documentation.
*/
var Documentation = {
init : function() {
this.fixFirefoxAnchorBug();
this.highlightSearchWords();
this.initIndexTable();
},
/**
* i18n support
*/
TRANSLATIONS : {},
PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
LOCALE : 'unknown',
// gettext and ngettext don't access this so that the functions
// can safely bound to a different name (_ = Documentation.gettext)
gettext : function(string) {
var translated = Documentation.TRANSLATIONS[string];
if (typeof translated == 'undefined')
return string;
return (typeof translated == 'string') ? translated : translated[0];
},
ngettext : function(singular, plural, n) {
var translated = Documentation.TRANSLATIONS[singular];
if (typeof translated == 'undefined')
return (n == 1) ? singular : plural;
return translated[Documentation.PLURALEXPR(n)];
},
addTranslations : function(catalog) {
for (var key in catalog.messages)
this.TRANSLATIONS[key] = catalog.messages[key];
this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
this.LOCALE = catalog.locale;
},
/**
* add context elements like header anchor links
*/
addContextElements : function() {
$('div[id] > :header:first').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this headline')).
appendTo(this);
});
$('dt[id]').each(function() {
$('<a class="headerlink">\u00B6</a>').
attr('href', '#' + this.id).
attr('title', _('Permalink to this definition')).
appendTo(this);
});
},
/**
* workaround a firefox stupidity
* see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
*/
fixFirefoxAnchorBug : function() {
if (document.location.hash)
window.setTimeout(function() {
document.location.href += '';
}, 10);
},
/**
* highlight the search words provided in the url in the text
*/
highlightSearchWords : function() {
var params = $.getQueryParameters();
var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
if (terms.length) {
var body = $('div.body');
if (!body.length) {
body = $('body');
}
window.setTimeout(function() {
$.each(terms, function() {
body.highlightText(this.toLowerCase(), 'highlighted');
});
}, 10);
$('<p class="highlight-link"><a href="javascript:Documentation.' +
'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
.appendTo($('#searchbox'));
}
},
/**
* init the domain index toggle buttons
*/
initIndexTable : function() {
var togglers = $('img.toggler').click(function() {
var src = $(this).attr('src');
var idnum = $(this).attr('id').substr(7);
$('tr.cg-' + idnum).toggle();
if (src.substr(-9) == 'minus.png')
$(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
else
$(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
}).css('display', '');
if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
togglers.click();
}
},
/**
* helper function to hide the search marks again
*/
hideSearchWords : function() {
$('#searchbox .highlight-link').fadeOut(300);
$('span.highlighted').removeClass('highlighted');
},
/**
* make the url absolute
*/
makeURL : function(relativeURL) {
return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
},
/**
* get the current relative url
*/
getCurrentURL : function() {
var path = document.location.pathname;
var parts = path.split(/\//);
$.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
if (this == '..')
parts.pop();
});
var url = parts.join('/');
return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
},
initOnKeyListeners: function() {
$(document).keyup(function(event) {
var activeElementType = document.activeElement.tagName;
// don't navigate when in search box or textarea
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
switch (event.keyCode) {
case 37: // left
var prevHref = $('link[rel="prev"]').prop('href');
if (prevHref) {
window.location.href = prevHref;
return false;
}
case 39: // right
var nextHref = $('link[rel="next"]').prop('href');
if (nextHref) {
window.location.href = nextHref;
return false;
}
}
}
});
}
};
// quick alias for translations
_ = Documentation.gettext;
$(document).ready(function() {
Documentation.init();
});
\ No newline at end of file
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
This diff could not be displayed because it is too large.
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!