yapi/doc/build/api.html
2017-07-10 21:17:49 +08:00

1637 lines
70 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta name="format-detection" content="telephone=no,email=no" />
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1">
<meta name="description" content="description of your site">
<meta name="author" content="author of the site">
<title>yapi api文档</title>
<link rel="stylesheet" href="source/main.css" />
</head>
<body>
<div class="ydoc">
<header class="ydoc-header">
<div class="ydoc-header-area">
<a href="http://ued.qunar.com/ymfe/" class="navbar-brand">YMFE</a>
<button class="ydocIcon navbar-toggle">&#xf020;</button>
<nav class="ydoc-nav">
<ul class="navbar-left">
<li class="">
<a href="index.html">首页</a>
</li>
<li class="active">
<a href="api.html">api文档</a>
</li>
</ul>
</nav>
</div>
</header>
<!-- <header style="height:20px"></header> -->
<!-- Docs page layout -->
<div class="ydoc-banner-bg">
<div class="ydoc-banner ">
<div class="ydoc-banner-area">
<h1 >api</h1>
<p class="desc ">api文档</p>
</div>
</div>
<div class="ydoc-container">
<div class="ydoc-container-content ">
<div class="content-left staticsidenav" role="complementary">
<nav class="docs-sidebar hidden-print hidden-xs hidden-sm">
<ul class="nav docs-sidenav">
<!-- <li > -->
<li >
<a href="#group">group</a>
</li>
<ul class="nav docs-sidenav-extend" >
<li >
<a href="#-group-add">/group/add</a>
</li>
<li >
<a href="#-group-list">/group/list</a>
</li>
<li >
<a href="#-group-del">/group/del</a>
</li>
<li >
<a href="#-group-up">/group/up</a>
</li>
</ul>
<!-- <li > -->
<li >
<a href="#user">user</a>
</li>
<!-- <li > -->
<li >
<a href="#project">project</a>
</li>
<ul class="nav docs-sidenav-extend" >
<li >
<a href="#-project-add">/project/add</a>
</li>
<li >
<a href="#-project-add_member">/project/add_member</a>
</li>
<li >
<a href="#-project-del_member">/project/del_member</a>
</li>
<li >
<a href="#-project-get">/project/get</a>
</li>
<li >
<a href="#-project-list">/project/list</a>
</li>
<li >
<a href="#-project-del">/project/del</a>
</li>
<li >
<a href="#-project-up">/project/up</a>
</li>
</ul>
<!-- <li > -->
<li >
<a href="#interface">interface</a>
</li>
<ul class="nav docs-sidenav-extend" >
<li >
<a href="#-interface-add">/interface/add</a>
</li>
</ul>
</ul>
</nav>
</div>
<div class="content-right markdown-body use-sidebar" role="main">
<div class="docs-section">
<h2 id="group" class="page-header subject">group<a class="hashlink" href="#group">#</a></h2>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-group-add" class="page-header subject">
/group/add
<span class="ui-badge">POST</span>
<a class="hashlink" href="#-group-add">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
添加项目分组
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/group.js.html#12" target="_blank">./server/controllers/group.js:12</a>
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>group_name</td>
<td>String</td>
<td>项目分组名称,不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>group_desc</td>
<td>String</td>
<td>项目分组描述</td>
<td>
</td>
<td></td>
</tr>
</table>
</div>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token number">4</span><span class="token punctuation">,</span>
<span class="token string">"group_name"</span><span class="token punctuation">:</span> <span class="token string">"大数据5"</span><span class="token punctuation">,</span>
<span class="token string">"group_desc"</span><span class="token punctuation">:</span> <span class="token string">"大数据5"</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
</div>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-group-list" class="page-header subject">
/group/list
<span class="ui-badge">get</span>
<a class="hashlink" href="#-group-list">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
获取项目分组列表
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/group.js.html#51" target="_blank">./server/controllers/group.js:51</a>
</p>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span class="token punctuation">{</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"group_name"</span><span class="token punctuation">:</span> <span class="token string">"大数据2"</span><span class="token punctuation">,</span>
<span class="token string">"group_desc"</span><span class="token punctuation">:</span> <span class="token string">"大数据2"</span><span class="token punctuation">,</span>
<span class="token string">"add_time"</span><span class="token punctuation">:</span> <span class="token number">1499244581</span><span class="token punctuation">,</span>
<span class="token string">"up_time"</span><span class="token punctuation">:</span> <span class="token number">1499244581</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token number">2</span><span class="token punctuation">,</span>
<span class="token string">"group_name"</span><span class="token punctuation">:</span> <span class="token string">"大数据3"</span><span class="token punctuation">,</span>
<span class="token string">"group_desc"</span><span class="token punctuation">:</span> <span class="token string">"大数据3"</span><span class="token punctuation">,</span>
<span class="token string">"add_time"</span><span class="token punctuation">:</span> <span class="token number">1499244588</span><span class="token punctuation">,</span>
<span class="token string">"up_time"</span><span class="token punctuation">:</span> <span class="token number">1499244588</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token number">3</span><span class="token punctuation">,</span>
<span class="token string">"group_name"</span><span class="token punctuation">:</span> <span class="token string">"大数据4"</span><span class="token punctuation">,</span>
<span class="token string">"group_desc"</span><span class="token punctuation">:</span> <span class="token string">"大数据4"</span><span class="token punctuation">,</span>
<span class="token string">"add_time"</span><span class="token punctuation">:</span> <span class="token number">1499244652</span><span class="token punctuation">,</span>
<span class="token string">"up_time"</span><span class="token punctuation">:</span> <span class="token number">1499244652</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token number">4</span><span class="token punctuation">,</span>
<span class="token string">"group_name"</span><span class="token punctuation">:</span> <span class="token string">"大数据5"</span><span class="token punctuation">,</span>
<span class="token string">"group_desc"</span><span class="token punctuation">:</span> <span class="token string">"大数据5"</span><span class="token punctuation">,</span>
<span class="token string">"add_time"</span><span class="token punctuation">:</span> <span class="token number">1499328065</span><span class="token punctuation">,</span>
<span class="token string">"up_time"</span><span class="token punctuation">:</span> <span class="token number">1499328065</span>
<span class="token punctuation">}</span>
<span class="token punctuation">]</span>
<span class="token punctuation">}</span></code></pre>
</div>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-group-del" class="page-header subject">
/group/del
<span class="ui-badge">post</span>
<a class="hashlink" href="#-group-del">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
删除项目分组
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/group.js.html#71" target="_blank">./server/controllers/group.js:71</a>
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>id</td>
<td>String</td>
<td>项目分组id</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
</table>
</div>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"n"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"ok"</span><span class="token punctuation">:</span> <span class="token number">1</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
</div>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-group-up" class="page-header subject">
/group/up
<span class="ui-badge">post</span>
<a class="hashlink" href="#-group-up">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
更新项目分组
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/group.js.html#93" target="_blank">./server/controllers/group.js:93</a>
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>id</td>
<td>String</td>
<td>项目分组id</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>group_name</td>
<td>String</td>
<td>项目分组名称</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>group_desc</td>
<td>String</td>
<td>项目分组描述</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
</table>
</div>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"n"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"nModified"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"ok"</span><span class="token punctuation">:</span> <span class="token number">1</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
</div>
<h2 id="user" class="page-header subject">user<a class="hashlink" href="#user">#</a></h2>
<h2 id="project" class="page-header subject">project<a class="hashlink" href="#project">#</a></h2>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-project-add" class="page-header subject">
/project/add
<span class="ui-badge">POST</span>
<a class="hashlink" href="#-project-add">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
添加项目分组
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#11" target="_blank">./server/controllers/project.js:11</a>
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>name</td>
<td>String</td>
<td>项目名称,不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>basepath</td>
<td>String</td>
<td>项目基本路径,不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>prd_host</td>
<td>String</td>
<td>项目线上域名不能为空。可通过配置的域名访问到mock数据</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>group_id</td>
<td>Number</td>
<td>项目分组id不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>desc</td>
<td>String</td>
<td>项目描述</td>
<td>
</td>
<td></td>
</tr>
</table>
</div>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"__v"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token number">8</span><span class="token punctuation">,</span>
<span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"project_a2"</span><span class="token punctuation">,</span>
<span class="token string">"desc"</span><span class="token punctuation">:</span> <span class="token string">"tttttt"</span><span class="token punctuation">,</span>
<span class="token string">"prd_host"</span><span class="token punctuation">:</span> <span class="token string">"project.a2.cc"</span><span class="token punctuation">,</span>
<span class="token string">"basepath"</span><span class="token punctuation">:</span> <span class="token string">"/a1"</span><span class="token punctuation">,</span>
<span class="token string">"uid"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"group_id"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"add_time"</span><span class="token punctuation">:</span> <span class="token number">1499331387</span><span class="token punctuation">,</span>
<span class="token string">"up_time"</span><span class="token punctuation">:</span> <span class="token number">1499331387</span><span class="token punctuation">,</span>
<span class="token string">"members"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span class="token number">0</span>
<span class="token punctuation">]</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
</div>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-project-add_member" class="page-header subject">
/project/add_member
<span class="ui-badge">POST</span>
<a class="hashlink" href="#-project-add_member">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
添加项目
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#73" target="_blank">./server/controllers/project.js:73</a>
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>id</td>
<td>Number</td>
<td>项目id不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>uid</td>
<td>member_uid</td>
<td>项目成员uid,不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
</table>
</div>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"n"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"ok"</span><span class="token punctuation">:</span> <span class="token number">1</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
</div>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-project-del_member" class="page-header subject">
/project/del_member
<span class="ui-badge">POST</span>
<a class="hashlink" href="#-project-del_member">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
添加项目
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#105" target="_blank">./server/controllers/project.js:105</a>
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>id</td>
<td>Number</td>
<td>项目id不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>uid</td>
<td>member_uid</td>
<td>项目成员uid,不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
</table>
</div>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"n"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"ok"</span><span class="token punctuation">:</span> <span class="token number">1</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
</div>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-project-get" class="page-header subject">
/project/get
<span class="ui-badge">GET</span>
<a class="hashlink" href="#-project-get">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
添加项目
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#137" target="_blank">./server/controllers/project.js:137</a>
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>id</td>
<td>Number</td>
<td>项目id不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
</table>
</div>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token number">7</span><span class="token punctuation">,</span>
<span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"project_a1"</span><span class="token punctuation">,</span>
<span class="token string">"desc"</span><span class="token punctuation">:</span> <span class="token string">"tttttt"</span><span class="token punctuation">,</span>
<span class="token string">"prd_host"</span><span class="token punctuation">:</span> <span class="token string">"project.a1.cc"</span><span class="token punctuation">,</span>
<span class="token string">"basepath"</span><span class="token punctuation">:</span> <span class="token string">"/a1"</span><span class="token punctuation">,</span>
<span class="token string">"uid"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"group_id"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"add_time"</span><span class="token punctuation">:</span> <span class="token number">1499331378</span><span class="token punctuation">,</span>
<span class="token string">"up_time"</span><span class="token punctuation">:</span> <span class="token number">1499331378</span><span class="token punctuation">,</span>
<span class="token string">"__v"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"members"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span class="token number">0</span>
<span class="token punctuation">]</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
</div>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-project-list" class="page-header subject">
/project/list
<span class="ui-badge">GET</span>
<a class="hashlink" href="#-project-list">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
获取项目列表
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#161" target="_blank">./server/controllers/project.js:161</a>
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>group_id</td>
<td>Number</td>
<td>项目group_id不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
</table>
</div>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span class="token punctuation">{</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token number">7</span><span class="token punctuation">,</span>
<span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"project_a1"</span><span class="token punctuation">,</span>
<span class="token string">"desc"</span><span class="token punctuation">:</span> <span class="token string">"tttttt"</span><span class="token punctuation">,</span>
<span class="token string">"prd_host"</span><span class="token punctuation">:</span> <span class="token string">"project.a1.cc"</span><span class="token punctuation">,</span>
<span class="token string">"basepath"</span><span class="token punctuation">:</span> <span class="token string">"/a1"</span><span class="token punctuation">,</span>
<span class="token string">"uid"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"group_id"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"add_time"</span><span class="token punctuation">:</span> <span class="token number">1499331378</span><span class="token punctuation">,</span>
<span class="token string">"up_time"</span><span class="token punctuation">:</span> <span class="token number">1499331378</span><span class="token punctuation">,</span>
<span class="token string">"__v"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"members"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span class="token number">0</span>
<span class="token punctuation">]</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token number">8</span><span class="token punctuation">,</span>
<span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"project_a2"</span><span class="token punctuation">,</span>
<span class="token string">"desc"</span><span class="token punctuation">:</span> <span class="token string">"tttttt"</span><span class="token punctuation">,</span>
<span class="token string">"prd_host"</span><span class="token punctuation">:</span> <span class="token string">"project.a2.cc"</span><span class="token punctuation">,</span>
<span class="token string">"basepath"</span><span class="token punctuation">:</span> <span class="token string">"/a1"</span><span class="token punctuation">,</span>
<span class="token string">"uid"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"group_id"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"add_time"</span><span class="token punctuation">:</span> <span class="token number">1499331387</span><span class="token punctuation">,</span>
<span class="token string">"up_time"</span><span class="token punctuation">:</span> <span class="token number">1499331387</span><span class="token punctuation">,</span>
<span class="token string">"__v"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"members"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span class="token number">0</span>
<span class="token punctuation">]</span>
<span class="token punctuation">}</span>
<span class="token punctuation">]</span>
<span class="token punctuation">}</span></code></pre>
</div>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-project-del" class="page-header subject">
/project/del
<span class="ui-badge">POST</span>
<a class="hashlink" href="#-project-del">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
删除项目
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#185" target="_blank">./server/controllers/project.js:185</a>
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>id</td>
<td>Number</td>
<td>项目id不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
</table>
</div>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"n"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"ok"</span><span class="token punctuation">:</span> <span class="token number">1</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
</div>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-project-up" class="page-header subject">
/project/up
<span class="ui-badge">GET</span>
<a class="hashlink" href="#-project-up">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
编辑项目
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/project.js.html#212" target="_blank">./server/controllers/project.js:212</a>
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>id</td>
<td>Number</td>
<td>项目id不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>name</td>
<td>String</td>
<td>项目名称,不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>basepath</td>
<td>String</td>
<td>项目基本路径,不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>prd_host</td>
<td>String</td>
<td>项目线上域名不能为空。可通过配置的域名访问到mock数据</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>desc</td>
<td>String</td>
<td>项目描述</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>env</td>
<td>Array</td>
<td>项目环境配置</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>env[].name</td>
<td>String</td>
<td>环境名称</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>env[].host</td>
<td>String</td>
<td>环境域名</td>
<td>
</td>
<td></td>
</tr>
</table>
</div>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code>
<span class="token comment" spellcheck="true">//请求示例</span>
<span class="token punctuation">{</span>
<span class="token string">"id"</span><span class="token punctuation">:</span> <span class="token number">8</span><span class="token punctuation">,</span>
<span class="token string">"env"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
<span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"本地开发环境"</span><span class="token punctuation">,</span>
<span class="token string">"domain"</span><span class="token punctuation">:</span> <span class="token string">"http://api.quar.com"</span>
<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token string">"desc"</span><span class="token punctuation">:</span> <span class="token string">"yapi项目"</span>
<span class="token punctuation">}</span>
<span class="token comment" spellcheck="true">//返回示例</span>
<span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"n"</span><span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
<span class="token string">"ok"</span><span class="token punctuation">:</span> <span class="token number">1</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
</div>
<h2 id="interface" class="page-header subject">interface<a class="hashlink" href="#interface">#</a></h2>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-interface-add" class="page-header subject">
/interface/add
<span class="ui-badge">POST</span>
<a class="hashlink" href="#-interface-add">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
添加项目分组
</p>
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/interface.js.html#10" target="_blank">./server/controllers/interface.js:10</a>
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>project_id</td>
<td>Number</td>
<td>项目id不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>path</td>
<td>String</td>
<td>接口请求路径,不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>method</td>
<td>String</td>
<td>请求方式</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>req_headers</td>
<td>Array</td>
<td>请求的header信息</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>req_headers[].name</td>
<td>String</td>
<td>请求的header信息名</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>req_headers[].value</td>
<td>String</td>
<td>请求的header信息值</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>req_headers[].required</td>
<td>Boolean</td>
<td>是否是必须,默认为否</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>req_headers[].desc</td>
<td>String</td>
<td>header描述</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>req_params_type</td>
<td>String</td>
<td>请求参数方式,有["form", "json", "text", "xml"]四种</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>req_params</td>
<td>Mixed</td>
<td>请求参数,如果请求方式是form参数是Array数组其他格式请求参数是字符串</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>req_params[].name</td>
<td>String</td>
<td>请求参数名</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>req_params[].value</td>
<td>String</td>
<td>请求参数值可填写生成规则mock。如@email随机生成一条email</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>req_params[].type</td>
<td>String</td>
<td>请求参数类型,有["text", "file"]两种</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>res_body_type</td>
<td>String</td>
<td>相应信息的数据格式,有["json", "text", "xml"]三种</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>res_body</td>
<td>String</td>
<td>响应信息可填写任意字符串如果res_body_type是json,则会调用mock功能</td>
<td>
</td>
<td></td>
</tr>
<tr>
<td>desc</td>
<td>String</td>
<td>接口描述</td>
<td>
</td>
<td></td>
</tr>
</table>
</div>
<div>示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code>
<span class="token comment" spellcheck="true">//请求 /interface/add</span>
<span class="token comment" spellcheck="true">//header Content-Type:application/json</span>
<span class="token punctuation">{</span>
<span class="token string">"desc"</span><span class="token punctuation">:</span> <span class="token string">"api"</span><span class="token punctuation">,</span>
<span class="token string">"method"</span><span class="token punctuation">:</span> <span class="token string">"post"</span><span class="token punctuation">,</span>
<span class="token string">"path"</span><span class="token punctuation">:</span> <span class="token string">"/testapi"</span><span class="token punctuation">,</span>
<span class="token string">"project_id"</span><span class="token punctuation">:</span> <span class="token number">8</span><span class="token punctuation">,</span>
<span class="token string">"req_headers"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span class="token punctuation">{</span>
<span class="token string">"key"</span><span class="token punctuation">:</span> <span class="token string">"h"</span><span class="token punctuation">,</span>
<span class="token string">"value"</span><span class="token punctuation">:</span> <span class="token string">"t"</span>
<span class="token punctuation">}</span>
<span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token string">"req_params_type"</span><span class="token punctuation">:</span> <span class="token string">"form"</span><span class="token punctuation">,</span>
<span class="token string">"req_params"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span class="token punctuation">{</span>
<span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"uid"</span><span class="token punctuation">,</span>
<span class="token string">"value"</span><span class="token punctuation">:</span> <span class="token number">100</span><span class="token punctuation">,</span>
<span class="token string">"type"</span><span class="token punctuation">:</span> <span class="token string">"text"</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span>
<span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"gid"</span><span class="token punctuation">,</span>
<span class="token string">"value"</span><span class="token punctuation">:</span> <span class="token number">1001</span><span class="token punctuation">,</span>
<span class="token string">"type"</span><span class="token punctuation">:</span> <span class="token string">"text"</span>
<span class="token punctuation">}</span>
<span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token string">"res_body_type"</span><span class="token punctuation">:</span> <span class="token string">"json"</span><span class="token punctuation">,</span>
<span class="token string">"res_body"</span><span class="token punctuation">:</span> <span class="token string">"{\"tt\": 222}"</span>
<span class="token punctuation">}</span>
<span class="token comment" spellcheck="true">//返回结果</span>
<span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"__v"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token number">422</span><span class="token punctuation">,</span>
<span class="token string">"project_id"</span><span class="token punctuation">:</span> <span class="token number">8</span><span class="token punctuation">,</span>
<span class="token string">"path"</span><span class="token punctuation">:</span> <span class="token string">"/testapi"</span><span class="token punctuation">,</span>
<span class="token string">"desc"</span><span class="token punctuation">:</span> <span class="token string">"api"</span><span class="token punctuation">,</span>
<span class="token string">"method"</span><span class="token punctuation">:</span> <span class="token string">"post"</span><span class="token punctuation">,</span>
<span class="token string">"req_params_type"</span><span class="token punctuation">:</span> <span class="token string">"form"</span><span class="token punctuation">,</span>
<span class="token string">"res_body"</span><span class="token punctuation">:</span> <span class="token string">"{\"tt\": 222}"</span><span class="token punctuation">,</span>
<span class="token string">"res_body_type"</span><span class="token punctuation">:</span> <span class="token string">"json"</span><span class="token punctuation">,</span>
<span class="token string">"uid"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"add_time"</span><span class="token punctuation">:</span> <span class="token number">1499658569</span><span class="token punctuation">,</span>
<span class="token string">"up_time"</span><span class="token punctuation">:</span> <span class="token number">1499658569</span><span class="token punctuation">,</span>
<span class="token string">"req_params_form"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span class="token punctuation">{</span>
<span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"uid"</span><span class="token punctuation">,</span>
<span class="token string">"value"</span><span class="token punctuation">:</span> <span class="token string">"100"</span><span class="token punctuation">,</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token string">"5962f94940a7a5767088fcc0"</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">{</span>
<span class="token string">"name"</span><span class="token punctuation">:</span> <span class="token string">"gid"</span><span class="token punctuation">,</span>
<span class="token string">"value"</span><span class="token punctuation">:</span> <span class="token string">"1001"</span><span class="token punctuation">,</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token string">"5962f94940a7a5767088fcbf"</span>
<span class="token punctuation">}</span>
<span class="token punctuation">]</span><span class="token punctuation">,</span>
<span class="token string">"req_headers"</span><span class="token punctuation">:</span> <span class="token punctuation">[</span>
<span class="token punctuation">{</span>
<span class="token string">"value"</span><span class="token punctuation">:</span> <span class="token string">"t"</span><span class="token punctuation">,</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token string">"5962f94940a7a5767088fcc1"</span>
<span class="token punctuation">}</span>
<span class="token punctuation">]</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
</div>
<h2 id="user" class="page-header subject">user<a class="hashlink" href="#user">#</a></h2>
<div class="con-list-item">
<blockquote class="api">
<h3 id="-user-login" class="page-header subject">
/user/login
<span class="ui-badge">POST</span>
<a class="hashlink" href="#-user-login">#</a>
</h3>
</blockquote>
<p>
<small class="text-muted">描述:</small>
添加项目分组
</p>
<p>
<small class="text-muted">参数:</small>
</p>
<div class="docs-table">
<table class="yo-table yo-table-border">
<colgroup>
<col class="c1">
<col class="c2">
<col class="c3">
<col class="c4">
</colgroup>
<thead>
<tr class="active">
<th>参数名</th>
<th>类型</th>
<th>描述</th>
<th>必选</th>
<th>支持版本</th>
</tr>
</thead>
<tr>
<td>username</td>
<td>String</td>
<td>用户名称,不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
<tr>
<td>password</td>
<td>String</td>
<td>密码,不能为空</td>
<td>
<i class="yo-ico glyphicon glyphicon-ok text-success"></i>
</td>
<td></td>
</tr>
</table>
</div>
<div>返回示例:</div>
<pre class="ydoc-example" data-foldnumber=10><code><span class="token punctuation">{</span>
<span class="token string">"errcode"</span><span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
<span class="token string">"errmsg"</span><span class="token punctuation">:</span> <span class="token string">"success"</span><span class="token punctuation">,</span>
<span class="token string">"data"</span><span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">"_id"</span><span class="token punctuation">:</span> <span class="token number">4</span><span class="token punctuation">,</span>
<span class="token string">"username"</span><span class="token punctuation">:</span> <span class="token string">"testuser"</span><span class="token punctuation">,</span>
<span class="token string">"password"</span><span class="token punctuation">:</span> <span class="token string">"testpassword"</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="copyright">
&copy; 2016 <a href="http://ued.qunar.com/ymfe/">YMFE</a> Team. Build by <a href="http://ued.qunar.com/ydoc/">ydoc</a>.
</div>
</footer>
</div>
<div class="open-panel"></div>
<div class="mask"></div>
<script src="source/main.js"></script>
<script src="source/app.js"></script>
<script>
var lineHeight = 17.4;
var EXAMPLE_MAX_HEIGHT;
function fold() {
// 折叠code
$('.markdown-body pre').css({
"line-height": lineHeight + "px"
});
$('.markdown-body pre').map(function(i, item) {
var $item = $(item);
var foldnumber = $item.data('foldnumber');
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
if ($item.height() > EXAMPLE_MAX_HEIGHT) {
$item.css({
"padding-bottom": 30
});
$item.find('code').height(EXAMPLE_MAX_HEIGHT);
$item.append('<span class="extend">展开更多……</span>');
};
});
$('.ydoc-example').delegate('.extend', 'click', function() {
var $this = $(this);
$this.removeClass('extend').addClass('fold');
$this.html('折叠代码');
$this.prev().height('auto');
$this.prev().parent().height('auto');
});
$('.ydoc-example').delegate('.fold', 'click', function() {
var $this = $(this);
var foldnumber = $this.parent().data('foldnumber');
EXAMPLE_MAX_HEIGHT = lineHeight * (foldnumber || 6);
$this.removeClass('fold').addClass('extend');
$this.parent().height(EXAMPLE_MAX_HEIGHT); // pre
$this.prev().height(EXAMPLE_MAX_HEIGHT); // code
$this.html("展开更多……");
});
}
$(document).ready(fold);
</script>
</body>
</html>