mirror of
https://github.com/YMFE/yapi.git
synced 2025-01-06 12:45:22 +08:00
docs: 完善文档路径
This commit is contained in:
parent
41a67d533e
commit
4419b051af
235
static/doc/case.html
Normal file
235
static/doc/case.html
Normal file
@ -0,0 +1,235 @@
|
||||
<!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 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="index.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></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 >YApi</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="getfamiliar.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="quickstart.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage.html">管理分组与项目</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="project.html">项目操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="interface.html">接口操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="mock.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="case.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#介绍">介绍</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#添加测试集">添加测试集</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#添加接口用例">添加接口用例</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#查看接口用例">查看接口用例</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="data.html">数据导入</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="qa.html">常见问题</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<h2 class="subject" id="介绍">介绍 <a class="hashlink" href="#介绍">#</a></h2><p style='text-indent:2em;line-height:1.8em'>测试集是接口用例的集合。接口用例用来保存接口运行请求参数,方便我们下次再测试接口,无需再填请求参数。</p>
|
||||
|
||||
<h2 class="subject" id="添加测试集">添加测试集 <a class="hashlink" href="#添加测试集">#</a></h2><p>添加测试集,我们可以创建个人测试集、环境测试集或者功能测试集等等。每个测试集只是接口用例的集合,可以按照任何维度去创建。</p>
|
||||
<p>项目接口页面,测试集合 tab 下面『加号』按钮添加测试集。</p>
|
||||
<p><img src="./images/case_col_add.jpg" /></p>
|
||||
<p>添加测试集必须填写集合名,然后可以选填集合简介。</p>
|
||||
<p><img src="./images/case_col_add_modal.jpg" /></p>
|
||||
<h2 class="subject" id="添加接口用例">添加接口用例 <a class="hashlink" href="#添加接口用例">#</a></h2><p>当我们在运行、调试某个接口时,为了把当前的测试请求数据保存下来,方便下次测试。我们可以将接口当前的测试数据,保存为该接口的测试用例。</p>
|
||||
<p>在接口运行页面,点击保存按钮,添加接口用例。</p>
|
||||
<p><img src="./images/case_add.jpg" /></p>
|
||||
<p>然后选择用例需要添加到的集合。如何还没有集合,可以新建。</p>
|
||||
<p><img src="./images/case_add_modal.jpg" /></p>
|
||||
<h2 class="subject" id="查看接口用例">查看接口用例 <a class="hashlink" href="#查看接口用例">#</a></h2><p>添加完用例,我们可以在接口集合 tab 下面看到,当前项目的所有测试集合和接口用例。接口用例和接口运行一样,只不过默认带上了一些请求参数。
|
||||
<img src="./images/case_list.jpg" /></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 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 = 18;
|
||||
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.parent().children('.js-code').height('auto');
|
||||
$this.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.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
243
static/doc/data.html
Normal file
243
static/doc/data.html
Normal file
@ -0,0 +1,243 @@
|
||||
<!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 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="index.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></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 >YApi</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="getfamiliar.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="quickstart.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage.html">管理分组与项目</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="project.html">项目操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="interface.html">接口操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="mock.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="case.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="data.html">数据导入</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#介绍">介绍</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#Postman_数据导入">Postman 数据导入</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#HAR_数据导入">HAR 数据导入</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="qa.html">常见问题</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<h2 class="subject" id="介绍">介绍 <a class="hashlink" href="#介绍">#</a></h2><p >在数据管理可快速导入其他格式的接口数据,方便快速添加接口。</p>
|
||||
|
||||
<h2 class="subject" id="Postman_数据导入">Postman 数据导入 <a class="hashlink" href="#Postman_数据导入">#</a></h2><ol>
|
||||
<li>首先在postman导出接口</li></ol>
|
||||
<div><img class="doc-img" width="50%" src="./images/usage/postman-1.jpg" /></div>
|
||||
|
||||
<ol>
|
||||
<li>选择collection_v1,点击export导出接口到文件xxx</li></ol>
|
||||
<div><img class="doc-img" width="66%" src="./images/usage/postman-2.jpg" /></div>
|
||||
|
||||
<ol>
|
||||
<li>打开yapi平台,进入到项目页面,点击数据管理,选择相应的分组和postman导入方式,选择刚才保存的文件路径,开始导入数据</li></ol>
|
||||
<div><img class="doc-img" width="66%" src="./images/usage/postman-3.jpg" /></div>
|
||||
|
||||
<h2 class="subject" id="HAR_数据导入">HAR 数据导入 <a class="hashlink" href="#HAR_数据导入">#</a></h2><p>可用 chrome 实现录制接口数据的功能,方便开发者快速导入项目接口</p>
|
||||
|
||||
<ol>
|
||||
<li>打开 Chrome 浏览器开发者工具,点击network,首次使用请先clear所有请求信息,确保录制功能开启(红色为开启状态)</li></ol>
|
||||
<div><img class="doc-img" width="660%" src="./images/usage/chrome-1.jpg" /></div>
|
||||
|
||||
<ol>
|
||||
<li>操作页面实际功能,完成后点击save as HAR with content,将数据保存到文件xxx</li></ol>
|
||||
<div><img class="doc-img" width="66%" src="./images/usage/chrome-2.jpg" /></div>
|
||||
|
||||
<ol>
|
||||
<li>打开yapi平台,进入到项目页面,点击数据管理,选择相应的分组和har导入方式,选择刚才保存的文件路径,开始导入数据</li></ol>
|
||||
<div><img class="doc-img" width="50%" src="./images/usage/chrome-3.jpg" /></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 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 = 18;
|
||||
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.parent().children('.js-code').height('auto');
|
||||
$this.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.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
245
static/doc/getfamiliar.html
Normal file
245
static/doc/getfamiliar.html
Normal file
@ -0,0 +1,245 @@
|
||||
<!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 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="index.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></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 >YApi</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 class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="getfamiliar.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#登录与注册">登录与注册</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#首页">首页</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#项目页">项目页</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#个人中心">个人中心</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="quickstart.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage.html">管理分组与项目</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="project.html">项目操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="interface.html">接口操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="mock.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="case.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="data.html">数据导入</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="qa.html">常见问题</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<p>YApi 是高效、易用、功能强大的api管理平台。
|
||||
<!-- 它有扁平化的管理结构(`超管`-`组长`-`组员`),有清晰的接口组织方式(`分组`-`项目`-`接口`),有更方便的mock方案。 --></p>
|
||||
<p>在开始使用 YApi 之前,我们先来熟悉一下 YApi 的网站结构,这将让你快速了解YApi。</p>
|
||||
<h2 class="subject" id="登录与注册">登录与注册 <a class="hashlink" href="#登录与注册">#</a></h2><p>想要使用 YApi ,首先要拥有账号,目前支持注册账号登录与QSSO登录两种方式。</p>
|
||||
<p><img src="./images/usage/login.png" /></p>
|
||||
<h2 class="subject" id="首页">首页 <a class="hashlink" href="#首页">#</a></h2><p>登录后进入首页,首页展示了分组与项目。</p>
|
||||
<p>此时你作为新用户,没有任何分组与项目的权限,因此只能搜索、浏览 “公开项目” 的接口,如果在首页找不到任何项目,请联系管理员将你加入对应项目。</p>
|
||||
<p><span class="list-index">1</span>首页头部展示了当前所在的位置、搜索框、新建项目、查看文档和用户信息。</p>
|
||||
<p><span class="list-index">2</span>首页左侧展示分组信息,“分组”是“项目”的集合,只有超级管理员可以管理分组。</p>
|
||||
<p><span class="list-index">3</span>首页右侧是分组下的项目和成员列表,点击左侧的某个分组,右侧会出现该分组下的项目和成员信息。</p>
|
||||
<p><span class="list-index">4</span>点击项目右上角的星星即可关注项目,关注的项目可以在“我的关注”页面查看。</p>
|
||||
<p><img src="./images/usage/index.png" /></p>
|
||||
<h2 class="subject" id="项目页">项目页 <a class="hashlink" href="#项目页">#</a></h2><p>点击一个项目,进入项目页,项目页展示了属于该项目的全部接口,并提供项目、接口的全部操作。</p>
|
||||
<p>此时你作为新用户,只能浏览接口信息,不可以编辑项目或接口,如果需要编辑,请联系管理员将你加入该项目。</p>
|
||||
<p><span class="list-index">1</span>项目页左侧的 “接口列表” 展示了该项目下的所有接口,右侧默认显示该项目下所有接口的列表。</p>
|
||||
<p><span class="list-index">2</span>点击左侧的某个接口,右侧会出现“预览”、“编辑”和“运行”。</p>
|
||||
<p><span class="list-index">3</span>点击左侧的 “测试集合” 使用<a href="./case.html">测试集</a>功能。</p>
|
||||
<p><span class="list-index">4</span>点击二级导航的“设置”,项目组长即可编辑项目信息和管理成员列表。</p>
|
||||
<p><span class="list-index">5</span>点击二级导航的“动态”,即可查看项目的操作日志。</p>
|
||||
<p><img src="./images/usage/project.png" /></p>
|
||||
<h2 class="subject" id="个人中心">个人中心 <a class="hashlink" href="#个人中心">#</a></h2><p>鼠标移动到右上角的用户头像或用户名上,即可点击“个人中心”查看个人信息。</p>
|
||||
<p><img src="./images/usage/hover.png" /></p>
|
||||
<p>在个人信息页面可以查看并修改自己的用户名、密码等信息。</p>
|
||||
<p><img src="./images/usage/user.png" /></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 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 = 18;
|
||||
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.parent().children('.js-code').height('auto');
|
||||
$this.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.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
232
static/doc/interface.html
Normal file
232
static/doc/interface.html
Normal file
@ -0,0 +1,232 @@
|
||||
<!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 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="index.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></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 >YApi</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="getfamiliar.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="quickstart.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage.html">管理分组与项目</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="project.html">项目操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="interface.html">接口操作</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#接口配置">接口配置</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#接口运行">接口运行</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="mock.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="case.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="data.html">数据导入</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="qa.html">常见问题</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<p>进入项目页,可以看到项目下的所有接口,需要注意的是,YApi有 <code>接口集合</code> 和 <code>测试集合</code> 两个概念。</p>
|
||||
<ul>
|
||||
<li><code>接口集合</code> 将接口进行分类,使结构结构更清晰,一个接口只能属于一个集合,且不允许与其他接口重名。</li><li><code>测试集合</code> 为了方便我们测试接口,<code>测试集合</code> 将若干接口组合在一起,在这里一个接口可以属于不同集合。</li></ul>
|
||||
<h2 class="subject" id="接口配置">接口配置 <a class="hashlink" href="#接口配置">#</a></h2><p><a href="./quickstart.html#新建接口">新建接口</a> 后,点击新添加的接口,右侧可以看到接口的预览信息,点击右侧的 <code>编辑</code> Tab项进入编辑面板。</p>
|
||||
<p>在改面板中你可以看到接口的基本信息(接口名称、分类、路径),除此以外,你还可以完善以下接口信息:</p>
|
||||
<ul>
|
||||
<li>状态: 用于标识接口是否开发完成。</li><li>接口描述: 用简短的文字描述接口的作用。</li><li>query: 接口url的查询字符串。</li><li>请求 Headers: http 请求头字段。</li><li>请求 Body: http 请求 body 部分。</li><li>请求 Body: http 请求 body 部分。</li><li><p>响应 Body: 模拟返回结果。</p>
|
||||
<blockquote>
|
||||
<p>响应 Body 分为 <code>json</code> & <code>raw</code> 两种形式</p>
|
||||
</blockquote>
|
||||
</li><li><p>是否开启邮件通知:开启后将此次接口的改动以邮件的形式发送至项目组所有成员。</p>
|
||||
</li></ul>
|
||||
<h2 class="subject" id="接口运行">接口运行 <a class="hashlink" href="#接口运行">#</a></h2><p>接口运行功能,是用来测试真实接口的,类似『Postman』的功能。</p>
|
||||
<p>点击运行 tab ,可进入到接口测试页面,首先安装『chrome crossRequest』扩展,才可正常使用此功能。</p>
|
||||
<blockquote>
|
||||
<p>安装完插件记得刷新页面</p>
|
||||
</blockquote>
|
||||
<p><img src="./images/interface_run.jpg" /></p>
|
||||
<p>点击保存按钮可把当前测试保存到测试集,方便下次调试。</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 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 = 18;
|
||||
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.parent().children('.js-code').height('auto');
|
||||
$this.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.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
346
static/doc/manage.html
Normal file
346
static/doc/manage.html
Normal file
@ -0,0 +1,346 @@
|
||||
<!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 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="index.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></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 >YApi</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="getfamiliar.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="quickstart.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="manage.html">管理分组与项目</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#认识组长">认识组长</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#创建分组">创建分组</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#创建项目">创建项目</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#权限列表">权限列表</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="project.html">项目操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="interface.html">接口操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="mock.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="case.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="data.html">数据导入</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="qa.html">常见问题</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<p>接口管理的逻辑较为复杂,操作频率高,层层审批将严重拖慢生产效率,因此传统的金字塔管理模式并不适用。</p>
|
||||
<p>YApi 将扁平化管理模式的思想引入到产品的权限管理中,<code>超级管理员</code> 拥有最高的权限,并将权限分配给若干 <code>组长</code>,<code>超级管理员</code> 只需管理<code>组长</code> 即可,实际上管理YAPI各大分组与项目的是“<code>组长</code>”。<code>组长</code>对分组或项目负责,一般由BU负责人/项目负责人担任。</p>
|
||||
<h2 class="subject" id="认识组长">认识组长 <a class="hashlink" href="#认识组长">#</a></h2><p>组长分为 <code>分组组长</code> 与 <code>项目组长</code>,组长对分组或项目负责,拥有分组或项目下的所有权限,二者区别如下:</p>
|
||||
<p><code>分组组长</code> 有权限修改分组、删除分组,可以创建分组下的项目。一般来说,组长只需要对项目负责,将项目的操作任务安排给项目组长处理即可。</p>
|
||||
<p><code>项目组长</code> 无法操作分组,但拥有项目的全部权限,<code>项目组长</code> 是 YApi 的基层管理者,承担了 YApi 绝大部分的日常管理工作。</p>
|
||||
<h2 class="subject" id="创建分组">创建分组 <a class="hashlink" href="#创建分组">#</a></h2><p>只有 <code>超级管理员</code> 有权限创建分组</p>
|
||||
<ul>
|
||||
<li>联系超级管理员<code>(Qtalk: wenbo.dong; wenxiong.su; wenjie.zhang.)</code>,说明要创建的分组名称和自己的用户名。</li><li>分组一般以 BU 作为维度。</li></ul>
|
||||
<h2 class="subject" id="创建项目">创建项目 <a class="hashlink" href="#创建项目">#</a></h2><p>成为 <code>分组成员</code>,即可在分组中创建项目。</p>
|
||||
<p><img src="./images/usage/manage_ask_group.png" /></p>
|
||||
<blockquote>
|
||||
<p>想成为 <code>分组组长</code> ,在分组成员列表中找到 <code>分组组长</code>,联系 <code>分组组长</code> 将你设置为分组组长。</p>
|
||||
</blockquote>
|
||||
<p><a href="./qa.html#Q__怎样联系组长?">怎样联系组长?</a></p>
|
||||
<h2 class="subject" id="权限列表">权限列表 <a class="hashlink" href="#权限列表">#</a></h2><p>新用户未加入项目或分组时,我们称为 <code>“游客”</code>。</p>
|
||||
<h3 class="subject" id="项目权限">项目权限 <a class="hashlink" href="#项目权限">#</a></h3><table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:left">操作</th>
|
||||
<th style="text-align:center">游客</th>
|
||||
<th style="text-align:center">项目开发者</th>
|
||||
<th style="text-align:center">项目组长</th>
|
||||
<th style="text-align:center">超级管理员</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align:left">浏览公开项目与接口</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left">浏览私有项目与接口</td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left">编辑项目信息</td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left">新建接口</td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left">编辑接口</td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left">编辑项目头像</td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left">删除项目</td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 class="subject" id="分组权限">分组权限 <a class="hashlink" href="#分组权限">#</a></h3><table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:left">操作</th>
|
||||
<th style="text-align:center">游客</th>
|
||||
<th style="text-align:center">分组开发者</th>
|
||||
<th style="text-align:center">分组组长</th>
|
||||
<th style="text-align:center">超级管理员</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align:left">浏览分组</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left">在分组中新建项目</td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left">编辑分组信息</td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left">管理分组成员</td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left">删除分组</td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center"></td>
|
||||
<td style="text-align:center">✓</td>
|
||||
<td style="text-align:center">✓</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 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 = 18;
|
||||
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.parent().children('.js-code').height('auto');
|
||||
$this.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.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
390
static/doc/mock.html
Normal file
390
static/doc/mock.html
Normal file
@ -0,0 +1,390 @@
|
||||
<!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 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="index.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></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 >YApi</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="getfamiliar.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="quickstart.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage.html">管理分组与项目</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="project.html">项目操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="interface.html">接口操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="mock.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#Mock介绍">Mock介绍</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#定义mock数据示例">定义mock数据示例</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#YApi_Mock_跟_mockjs_区别">YApi Mock 跟 mockjs 区别</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#如何使用Mock?">如何使用Mock?</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#Mock语法规范">Mock语法规范</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="case.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="data.html">数据导入</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="qa.html">常见问题</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<h2 class="subject" id="Mock介绍">Mock介绍 <a class="hashlink" href="#Mock介绍">#</a></h2> <p style='text-indent:2em;line-height:1.8em'>YApi的Mock功能可以根据用户的输入接口信息如协议、URL、接口名、请求头、请求参数、mock规则(<a href="#mock">点击到Mock规则</a>)生成Mock接口,这些接口会自动生成模拟数据,创建者可以自由构造需要的数据。而且与常见的Mock方式如将Mock写在代码里和JS拦截等相比yapi的Mock在使用场景和效率和复杂度上是相差甚远的,正是由于yapi的Mock是一个第三方平台,那么在团队开发时任何人都可以权限许可下创建、修改接口信息等操作,这对于团队开发是很有好处的。 </p>
|
||||
|
||||
<p> <strong>mock地址解析</strong>:yapi平台网址+mock+<strong>您的项目id</strong>+<strong>接口实际请求path</strong></p>
|
||||
<pre><code>mockd地址: http<span class="token operator">:</span>//yapi.corp.qunar.com/mock/<span class="token number">29</span>/api/hackathon/login
|
||||
</code></pre><p> 注:项目id可以在项目设置里查看到</p>
|
||||
<h2 class="subject" id="定义mock数据示例">定义mock数据示例 <a class="hashlink" href="#定义mock数据示例">#</a></h2><pre><code><span class="token punctuation">{</span>
|
||||
<span class="token property">"status|0-1"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> //接口状态
|
||||
<span class="token property">"message"</span><span class="token operator">:</span> <span class="token string">"请求完成"</span><span class="token punctuation">,</span> //消息提示
|
||||
<span class="token property">"data"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
<span class="token property">"counts"</span><span class="token operator">:</span><span class="token string">"@integer"</span><span class="token punctuation">,</span> //统计数量
|
||||
<span class="token property">"totalSubjectType|4-10"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
|
||||
<span class="token punctuation">{</span>
|
||||
<span class="token property">"subjectName|regexp"</span><span class="token operator">:</span> <span class="token string">"大数据|机器学习|工具"</span><span class="token punctuation">,</span> //主题名
|
||||
<span class="token property">"subjectType|+1"</span><span class="token operator">:</span> <span class="token number">1</span> //类型
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">]</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"data"</span><span class="token operator">:</span><span class="token punctuation">[</span>
|
||||
<span class="token punctuation">{</span>
|
||||
<span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"@name"</span><span class="token punctuation">,</span> //用户名
|
||||
<span class="token property">"email"</span><span class="token operator">:</span> <span class="token string">"@email"</span><span class="token punctuation">,</span> //email
|
||||
<span class="token property">"time"</span><span class="token operator">:</span> <span class="token string">"@datetime"</span> //时间
|
||||
<span class="token punctuation">}</span>
|
||||
<span class="token punctuation">]</span><span class="token punctuation">}</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre><h2 class="subject" id="YApi_Mock_跟_mockjs_区别">YApi Mock 跟 mockjs 区别 <a class="hashlink" href="#YApi_Mock_跟_mockjs_区别">#</a></h2><p>1 因为 yapi 基于 json 定义 mock ,无法使用 mockjs 原有的函数功能,正则表达式需要基于 rule 书写,示例如下:</p>
|
||||
<pre><code><span class="token punctuation">{</span>
|
||||
<span class="token property">"name|regexp"</span><span class="token operator">:</span> <span class="token string">"[a-z0-9_]+?"</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"type|regexp"</span><span class="token operator">:</span> <span class="token string">"json|text|xml"</span> //枚举数据类型可这样实现
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre><p>2 支持替换请求的query,body参数</p>
|
||||
<pre><code><span class="token punctuation">{</span>
|
||||
<span class="token property">"name"</span><span class="token operator">:</span> <span class="token string">"${query.name}"</span><span class="token punctuation">,</span> //请求的url是/path?name=xiaoming<span class="token punctuation">,</span> 返回的name字段是xiaoming
|
||||
<span class="token property">"type"</span><span class="token operator">:</span> <span class="token string">"${body.type}"</span> //请求的requestBody type=<span class="token number">1</span><span class="token punctuation">,</span>返回的type字段是<span class="token number">1</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre><h2 class="subject" id="如何使用Mock?">如何使用Mock? <a class="hashlink" href="#如何使用Mock?">#</a></h2><h3 class="subject" id="1_在js代码直接请求yapi提供的mock地址(不用担心跨域问题)">1 在js代码直接请求yapi提供的mock地址(不用担心跨域问题) <a class="hashlink" href="#1_在js代码直接请求yapi提供的mock地址(不用担心跨域问题)">#</a></h3><p>在代码直接请求yapi提供的mock地址,以jQuery为例:</p>
|
||||
<pre><code class="lang-javascript"><span class="token keyword">let</span> prefix <span class="token operator">=</span> <span class="token string">'http://yapi.local.qunar.com:3000/mock/2817'</span>
|
||||
$<span class="token punctuation">.</span><span class="token function">post</span><span class="token punctuation">(</span>prefix<span class="token operator">+</span><span class="token string">'/baseapi/path'</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>username<span class="token punctuation">:</span> <span class="token string">'xxx'</span><span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token keyword">function</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span><span class="token punctuation">{</span>
|
||||
console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>res<span class="token punctuation">)</span> <span class="token comment" spellcheck="true">//返回上图预览部分的数据</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">)</span>
|
||||
</code></pre>
|
||||
<h3 class="subject" id="2_基于本地服务器反向代理">2 基于本地服务器反向代理 <a class="hashlink" href="#2_基于本地服务器反向代理">#</a></h3><p>优点:不用修改项目代码</p>
|
||||
<h4 class="subject" id="2.1_基于nginx反向代理">2.1 基于nginx反向代理 <a class="hashlink" href="#2.1_基于nginx反向代理">#</a></h4><pre><code class="lang-nginx"><span class="token keyword">location</span> <span class="token operator">/</span>baseapi
|
||||
<span class="token punctuation">{</span>
|
||||
<span class="token keyword">proxy_pass</span> <span class="token keyword">http</span><span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>yapi<span class="token punctuation">.</span>corp<span class="token punctuation">.</span>qunar<span class="token punctuation">.</span>com<span class="token operator">/</span>mock<span class="token operator">/</span><span class="token number">2817</span><span class="token operator">/</span>baseapi<span class="token punctuation">;</span> <span class="token comment" spellcheck="true">#baseapi后面没有"/"</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre>
|
||||
<h4 class="subject" id="2.2_基于ykit_mock功能">2.2 基于ykit mock功能 <a class="hashlink" href="#2.2_基于ykit_mock功能">#</a></h4><pre><code class="lang-javascript"><span class="token punctuation">{</span>
|
||||
pattern<span class="token punctuation">:</span> <span class="token regex">/\/api\/(.*)/</span><span class="token punctuation">,</span>
|
||||
responder<span class="token punctuation">:</span> <span class="token string">'http://yapi.corp.qunar.com/mock/58/api/$1'</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre>
|
||||
<p>上面通过正则匹配,将所有接口转到 <a href="http://yapi.corp.qunar.com">http://yapi.corp.qunar.com</a> 上,比如 <code>http://localhost/api/user/status</code> 会成为 <code>http://yapi.corp.qunar.com/mock/58/api/user/status</code></p>
|
||||
<p>详细使用指南: <a target="_blank" href="https://ykit.ymfe.org/plugins-mock.html#获取远程数据_Map_Remote_">ykit-config-mock</a></p>
|
||||
<h4 class="subject" id="2.3_基于ykit_Jerry代理">2.3 基于ykit Jerry代理 <a class="hashlink" href="#2.3_基于ykit_Jerry代理">#</a></h4><p>假设您本地服务器访问地址是: <a href="http://xxx.com">http://xxx.com</a></p>
|
||||
<p><img src="./images/ykit.jpg" /></p>
|
||||
<p><span id="mock"></span></p>
|
||||
<h2 class="subject" id="Mock语法规范">Mock语法规范 <a class="hashlink" href="#Mock语法规范">#</a></h2><blockquote>
|
||||
<p>了解更多Mock详情:<a href="https://github.com/nuysoft/Mock/wiki/Syntax-Specification">Mock.js 官方文档</a></p>
|
||||
</blockquote>
|
||||
<p>Mock.js 的语法规范包括两部分:</p>
|
||||
<p><a href="#DTD">1. 数据模板定义规范(Data Template Definition,DTD)</a></p>
|
||||
<p><a href="#DPD">2. 数据占位符定义规范(Data Placeholder Definition,DPD)</a></p>
|
||||
<p><span id = "DTD"></span></p>
|
||||
<h3 class="subject" id="数据模板定义规范(Data_Template_Definition,DTD)">数据模板定义规范(Data Template Definition,DTD) <a class="hashlink" href="#数据模板定义规范(Data_Template_Definition,DTD)">#</a></h3><p>数据模板中的每个属性由 3 部分构成:属性名、生成规则、属性值:</p>
|
||||
<pre><code>// 属性名 name (与生成规则之间用 <span class="token string">"|"</span> 隔开)
|
||||
// 生成规则 rule(生成规则有<span class="token number">7</span>种详见下面的生成规则)
|
||||
// 属性值 value(可以含有 <span class="token string">"@占位符"</span> 同时也指定了最终值的初始值和类型)
|
||||
|
||||
'name|rule'<span class="token operator">:</span> value
|
||||
|
||||
生成规则:
|
||||
'name|min-max'<span class="token operator">:</span> value
|
||||
'name|count'<span class="token operator">:</span> value
|
||||
'name|min-max.dmin-dmax'<span class="token operator">:</span> value
|
||||
'name|min-max.dcount'<span class="token operator">:</span> value
|
||||
'name|count.dmin-dmax'<span class="token operator">:</span> value
|
||||
'name|count.dcount'<span class="token operator">:</span> value
|
||||
'name|+step'<span class="token operator">:</span> value
|
||||
</code></pre><p>下面提供了6种生成规则以及示例包括 String、Number、Boolean、Object、Array:</p>
|
||||
<h3 class="subject" id="1._属性值是字符串_String">1. 属性值是字符串 String <a class="hashlink" href="#1._属性值是字符串_String">#</a></h3><pre><code><span class="token number">1</span>. 'name|min-max'<span class="token operator">:</span> string
|
||||
|
||||
通过重复 string 生成一个字符串,重复次数大于等于 min,小于等于 max。
|
||||
|
||||
<span class="token number">2</span>. 'name|count'<span class="token operator">:</span> string
|
||||
|
||||
通过重复 string 生成一个字符串,重复次数等于 count。
|
||||
</code></pre><h3 class="subject" id="2._属性值是数字_Number">2. 属性值是数字 Number <a class="hashlink" href="#2._属性值是数字_Number">#</a></h3><pre><code><span class="token number">1</span>. 'name|+<span class="token number">1</span>'<span class="token operator">:</span> number
|
||||
|
||||
属性值自动加 <span class="token number">1</span>,初始值为 number。
|
||||
|
||||
<span class="token number">2</span>. 'name|min-max'<span class="token operator">:</span> number
|
||||
|
||||
生成一个大于等于 min、小于等于 max 的整数,属性值 number 只是用来确定类型。
|
||||
|
||||
<span class="token number">3</span>. 'name|min-max.dmin-dmax'<span class="token operator">:</span> number
|
||||
|
||||
生成一个浮点数,整数部分大于等于 min、小于等于 max,小数部分保留 dmin 到 dmax 位。
|
||||
|
||||
例如:
|
||||
Mock.mock(<span class="token punctuation">{</span>
|
||||
'number1|<span class="token number">1</span>-<span class="token number">100.1</span>-<span class="token number">10</span>'<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
|
||||
'number2|<span class="token number">123.1</span>-<span class="token number">10</span>'<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
|
||||
'number3|<span class="token number">123.3</span>'<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
|
||||
'number4|<span class="token number">123.10</span>'<span class="token operator">:</span> <span class="token number">1.123</span>
|
||||
<span class="token punctuation">}</span><span class="token punctuation">)</span>
|
||||
// =>
|
||||
<span class="token punctuation">{</span>
|
||||
<span class="token property">"number1"</span><span class="token operator">:</span> <span class="token number">12.92</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"number2"</span><span class="token operator">:</span> <span class="token number">123.51</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"number3"</span><span class="token operator">:</span> <span class="token number">123.777</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"number4"</span><span class="token operator">:</span> <span class="token number">123.1231091814</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre><h3 class="subject" id="3._属性值是布尔型_Boolean">3. 属性值是布尔型 Boolean <a class="hashlink" href="#3._属性值是布尔型_Boolean">#</a></h3><pre><code><span class="token number">1</span>. 'name|<span class="token number">1</span>'<span class="token operator">:</span> boolean
|
||||
|
||||
随机生成一个布尔值,值为 <span class="token boolean">true</span> 的概率是 <span class="token number">1</span>/<span class="token number">2</span>,值为 <span class="token boolean">false</span> 的概率同样是 <span class="token number">1</span>/<span class="token number">2</span>。
|
||||
|
||||
<span class="token number">2</span>. 'name|min-max'<span class="token operator">:</span> value
|
||||
|
||||
随机生成一个布尔值,值为 value 的概率是 min / (min + max<span class="token punctuation">)</span>,值为 !value 的概率是 max / (min + max<span class="token punctuation">)</span>。
|
||||
</code></pre><h3 class="subject" id="4._属性值是对象_Object">4. 属性值是对象 Object <a class="hashlink" href="#4._属性值是对象_Object">#</a></h3><pre><code><span class="token number">1</span>. 'name|count'<span class="token operator">:</span> object
|
||||
|
||||
从属性值 object 中随机选取 count 个属性。
|
||||
|
||||
<span class="token number">2</span>. 'name|min-max'<span class="token operator">:</span> object
|
||||
|
||||
从属性值 object 中随机选取 min 到 max 个属性。
|
||||
</code></pre><h3 class="subject" id="5._属性值是数组_Array">5. 属性值是数组 Array <a class="hashlink" href="#5._属性值是数组_Array">#</a></h3><pre><code><span class="token number">1</span>. 'name|<span class="token number">1</span>'<span class="token operator">:</span> array
|
||||
|
||||
从属性值 array 中随机选取 <span class="token number">1</span> 个元素,作为最终值。
|
||||
|
||||
<span class="token number">2</span>. 'name|+<span class="token number">1</span>'<span class="token operator">:</span> array
|
||||
|
||||
从属性值 array 中顺序选取 <span class="token number">1</span> 个元素,作为最终值。
|
||||
|
||||
<span class="token number">3</span>. 'name|min-max'<span class="token operator">:</span> array
|
||||
|
||||
通过重复属性值 array 生成一个新数组,重复次数大于等于 min,小于等于 max。
|
||||
|
||||
<span class="token number">4</span>. 'name|count'<span class="token operator">:</span> array
|
||||
|
||||
通过重复属性值 array 生成一个新数组,重复次数为 count。
|
||||
</code></pre><p><span id = "DPD"></span></p>
|
||||
<h3 class="subject" id="数据占位符定义规范(Data_Placeholder_Definition,DPD)">数据占位符定义规范(Data Placeholder Definition,DPD) <a class="hashlink" href="#数据占位符定义规范(Data_Placeholder_Definition,DPD)">#</a></h3><pre><code>占位符 只是在属性值字符串中占个位置,并不出现在最终的属性值中。
|
||||
|
||||
占位符 的格式为:
|
||||
|
||||
@占位符
|
||||
|
||||
说明:
|
||||
<span class="token number">1</span>. 用 @ 来标识其后的字符串是 占位符,在YApi提供的Mock输入框在输入“@”后会自动提示占位符。
|
||||
|
||||
例如:
|
||||
name<span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
first<span class="token operator">:</span> '@FIRST'<span class="token punctuation">,</span>
|
||||
middle<span class="token operator">:</span> '@FIRST'<span class="token punctuation">,</span>
|
||||
last<span class="token operator">:</span> '@LAST'<span class="token punctuation">,</span>
|
||||
full<span class="token operator">:</span> '@first @middle @last'
|
||||
<span class="token punctuation">}</span>
|
||||
// 上面的示例可以得到如下结果:
|
||||
<span class="token property">"name"</span><span class="token operator">:</span> <span class="token punctuation">{</span>
|
||||
<span class="token property">"first"</span><span class="token operator">:</span> <span class="token string">"Charles"</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"middle"</span><span class="token operator">:</span> <span class="token string">"Brenda"</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"last"</span><span class="token operator">:</span> <span class="token string">"Lopez"</span><span class="token punctuation">,</span>
|
||||
<span class="token property">"full"</span><span class="token operator">:</span> <span class="token string">"Charles Brenda Lopez"</span>
|
||||
<span class="token punctuation">}</span>
|
||||
</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 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 = 18;
|
||||
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.parent().children('.js-code').height('auto');
|
||||
$this.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.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
236
static/doc/project.html
Normal file
236
static/doc/project.html
Normal file
@ -0,0 +1,236 @@
|
||||
<!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 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="index.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></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 >YApi</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="getfamiliar.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="quickstart.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage.html">管理分组与项目</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="project.html">项目操作</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#新建项目">新建项目</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#修改项目">修改项目</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#删除项目">删除项目</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="interface.html">接口操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="mock.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="case.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="data.html">数据导入</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="qa.html">常见问题</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<h2 class="subject" id="新建项目">新建项目 <a class="hashlink" href="#新建项目">#</a></h2><p>点击右上角的 <code>+</code> 新建项目,进入新建项目页面。</p>
|
||||
<p><img src="./images/usage/project_add.png" /></p>
|
||||
<p>在新建项目页,填写项目信息:</p>
|
||||
<blockquote>
|
||||
<ul>
|
||||
<li>项目名称不允许重复,包括其他分组</li><li>基本路径为接口统一添加了前缀</li><li>新建项目页只列出了部分配置,其他详细配置(环境配置、项目图标等)需要进入项目页的“设置”面板进行配置。</li></ul>
|
||||
</blockquote>
|
||||
<p><img src="./images/usage/project_add_panel.png" /></p>
|
||||
<h2 class="subject" id="修改项目">修改项目 <a class="hashlink" href="#修改项目">#</a></h2><p>在项目页点击上方的 <code>设置</code> Tab 进入项目设置面板,这个面板涵盖了项目的所有配置。</p>
|
||||
<p><img src="./images/usage/project_setting.png" /></p>
|
||||
<p>这里比新建项目页面新增的功能如下:</p>
|
||||
<h3 class="subject" id="修改项目图标">修改项目图标 <a class="hashlink" href="#修改项目图标">#</a></h3><p>点击项目图标,可以修改图标及背景色:</p>
|
||||
<p><img src="./images/usage/project_setting_logo.png" /></p>
|
||||
<h3 class="subject" id="配置环境">配置环境 <a class="hashlink" href="#配置环境">#</a></h3><p><code>环境配置</code> 一项可以添加该项目下接口的实际环境,供 <a href="./usage-使用测试集.html">接口测试</a> 使用。</p>
|
||||
<p><img src="./images/usage/project_setting_env.png" /></p>
|
||||
<h2 class="subject" id="删除项目">删除项目 <a class="hashlink" href="#删除项目">#</a></h2><p>点击下方的删除按钮,输入项目名称进行删除。</p>
|
||||
<blockquote>
|
||||
<p>删除项目是高风险操作,因此 YApi 对这个操作进行了特别的约束。</p>
|
||||
</blockquote>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 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 = 18;
|
||||
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.parent().children('.js-code').height('auto');
|
||||
$this.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.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
224
static/doc/qa.html
Normal file
224
static/doc/qa.html
Normal file
@ -0,0 +1,224 @@
|
||||
<!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 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="index.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></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 >YApi</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="getfamiliar.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="quickstart.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage.html">管理分组与项目</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="project.html">项目操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="interface.html">接口操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="mock.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="case.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="data.html">数据导入</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="qa.html">常见问题</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#Q1__怎样联系组长?">Q1: 怎样联系组长?</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#Q2__怎么快速把之前项目接口迁移过来?">Q2: 怎么快速把之前项目接口迁移过来?</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<p>本页面罗列了大家使用 YApi 时遇到的常见问题.</p>
|
||||
<p>如果没有找到您要的答案,请 qtalk 联系: <code>wenbo.dong; wenxiong.su; wenjie.zhang.</code></p>
|
||||
<h2 class="subject" id="Q1__怎样联系组长?">Q1: 怎样联系组长? <a class="hashlink" href="#Q1__怎样联系组长?">#</a></h2><p>A: 组长分为 <code>分组组长</code> 和 <code>项目组长</code>:</p>
|
||||
<ul>
|
||||
<li>分组组长:选择首页左侧的分组,点击右侧面板的 <code>成员列表</code>,成员右侧显示着 <code>组长/开发者</code> 的权限信息。
|
||||
<img src="./images/usage/manage_find_manager.png" /></li><li>项目组长: 点击项目页的 <code>设置</code> - <code>成员列表</code>,成员右侧显示着 <code>组长/开发者</code> 的权限信息。
|
||||
<img src="./images/usage/manage_find_project_owner.png" /></li></ul>
|
||||
<h2 class="subject" id="Q2__怎么快速把之前项目接口迁移过来?">Q2: 怎么快速把之前项目接口迁移过来? <a class="hashlink" href="#Q2__怎么快速把之前项目接口迁移过来?">#</a></h2><p>第一步. 使用Chrome浏览器开发者工具录制功能</p>
|
||||
<p>第二步 录制当前项目所有请求,导出到har文件</p>
|
||||
<p>第三步 将Har数据导入到YApi平台</p>
|
||||
<p>具体使用方法请参考YApi<a href="./data.html#HAR%08%08_数据导入">文档</a></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 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 = 18;
|
||||
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.parent().children('.js-code').height('auto');
|
||||
$this.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.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
245
static/doc/quickstart.html
Normal file
245
static/doc/quickstart.html
Normal file
@ -0,0 +1,245 @@
|
||||
<!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 使用手册</title>
|
||||
<link rel="stylesheet" href="source/main.css" />
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="styles/theme.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"></button>
|
||||
<nav class="ydoc-nav">
|
||||
<ul class="navbar-left">
|
||||
|
||||
<li class="active">
|
||||
|
||||
<a href="index.html">使用手册</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="releases.html">版本记录</a>
|
||||
</li>
|
||||
|
||||
<li class="">
|
||||
|
||||
<a href="api.html"></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 >YApi</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="getfamiliar.html">认识 YApi</a>
|
||||
</li>
|
||||
|
||||
<!-- <li class="active" class="active" > -->
|
||||
<li class="active" >
|
||||
|
||||
<a href="quickstart.html">创建第一个API</a>
|
||||
</li>
|
||||
|
||||
<ul class="nav docs-sidenav-extend" >
|
||||
|
||||
<li >
|
||||
<a href="#获取权限">获取权限</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#选择项目">选择项目</a>
|
||||
</li>
|
||||
|
||||
<li >
|
||||
<a href="#新建接口">新建接口</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="manage.html">管理分组与项目</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="project.html">项目操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="interface.html">接口操作</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="mock.html">使用mock功能</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="case.html">使用测试集</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="data.html">数据导入</a>
|
||||
</li>
|
||||
|
||||
<!-- <li > -->
|
||||
<li >
|
||||
|
||||
<a href="qa.html">常见问题</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="content-right markdown-body use-sidebar" role="main">
|
||||
|
||||
<h3 class="subject" id="如何创建接口?">如何创建接口? <a class="hashlink" href="#如何创建接口?">#</a></h3><p>把大象装进冰箱分几步?三步:把冰箱门打开,把大象装进去,关门,搞定~</p>
|
||||
<p>新建接口分几步?也是三步:</p>
|
||||
<ul>
|
||||
<li><a href="#获取权限">获取权限</a></li><li><a href="#选择项目">找到一个项目</a></li><li><a href="#新建接口">新建接口</a></li></ul>
|
||||
<p>搞定~</p>
|
||||
<h2 class="subject" id="获取权限">获取权限 <a class="hashlink" href="#获取权限">#</a></h2><p>新用户登录后没有任何项目或分组的权限,只能浏览已存在分组下面的公开项目。</p>
|
||||
<p>如果找不到想找的项目,可能是未成为项目成员,此时应联系 <code>项目组长</code> 将你加入该项目。</p>
|
||||
<p><a href="./qa.html#Q__怎样联系组长?">怎样联系组长?</a></p>
|
||||
<p><img src="./images/usage/manage_ask.png" /></p>
|
||||
<ul>
|
||||
<li>想创建分组,请看: <a href="./manage.html#创建分组">创建分组</a></li><li>想创建项目,请看: <a href="./manage.html#创建项目">创建项目</a></li></ul>
|
||||
<blockquote>
|
||||
<p>想了解更多权限信息,请查看<a href="./manage#权限列表">权限列表</a></p>
|
||||
</blockquote>
|
||||
<h2 class="subject" id="选择项目">选择项目 <a class="hashlink" href="#选择项目">#</a></h2><ul>
|
||||
<li><p>如果你已经登录,会在首页右侧看到一些项目 (可以在左侧的分组列表切换分组来查看不同分组下的项目)。</p>
|
||||
</li><li><p>点击一个项目,进入该项目的详情页。</p>
|
||||
</li></ul>
|
||||
<p><img src="./images/project_list.png" width = "800" style="margin:0px auto;display:block;" alt="图片名称" align=center /></p>
|
||||
<h2 class="subject" id="新建接口">新建接口 <a class="hashlink" href="#新建接口">#</a></h2><ul>
|
||||
<li>点击左侧接口分组右侧的菜单按钮,选择 <code>添加接口</code>,或者点击接口列表右上角的 <code>添加接口</code>。</li></ul>
|
||||
<p><img src="./images/usage/api_add_btn.png" /></p>
|
||||
<ul>
|
||||
<li>选择接口分类,输入接口名称和接口路径,点击 <code>提交</code>。</li></ul>
|
||||
<p><img src="./images/usage/api_add_panel.png" /></p>
|
||||
<ul>
|
||||
<li>恭喜你!创建了第一个YApi的接口,你可以看到在左侧看到接口名称,右侧有该接口的信息预览。</li></ul>
|
||||
<p><img src="./images/usage/api_res.png" /></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="copyright">
|
||||
© 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 = 18;
|
||||
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.parent().children('.js-code').height('auto');
|
||||
$this.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.parent().children('.js-code').height(EXAMPLE_MAX_HEIGHT); // code
|
||||
$this.html("展开更多……");
|
||||
});
|
||||
}
|
||||
$(document).ready(fold);
|
||||
</script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user