docs: opti

This commit is contained in:
suxiaoxin 2017-11-03 11:16:58 +08:00
parent fbea724e50
commit 2a6cd06640
4 changed files with 28 additions and 17 deletions

View File

@ -931,7 +931,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/group.js.html#413" target="_blank">./server/controllers/group.js:413</a>
<a href="./static/server/controllers/group.js.html#411" target="_blank">./server/controllers/group.js:411</a>
</p>
@ -1003,7 +1003,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/group.js.html#457" target="_blank">./server/controllers/group.js:457</a>
<a href="./static/server/controllers/group.js.html#455" target="_blank">./server/controllers/group.js:455</a>
</p>
@ -3569,7 +3569,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/interface.js.html#188" target="_blank">./server/controllers/interface.js:188</a>
<a href="./static/server/controllers/interface.js.html#191" target="_blank">./server/controllers/interface.js:191</a>
</p>
@ -3634,7 +3634,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/interface.js.html#231" target="_blank">./server/controllers/interface.js:231</a>
<a href="./static/server/controllers/interface.js.html#234" target="_blank">./server/controllers/interface.js:234</a>
</p>
@ -3699,7 +3699,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/interface.js.html#329" target="_blank">./server/controllers/interface.js:329</a>
<a href="./static/server/controllers/interface.js.html#332" target="_blank">./server/controllers/interface.js:332</a>
</p>
@ -3932,7 +3932,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/interface.js.html#533" target="_blank">./server/controllers/interface.js:533</a>
<a href="./static/server/controllers/interface.js.html#541" target="_blank">./server/controllers/interface.js:541</a>
</p>
@ -4004,7 +4004,7 @@
<p>
<small class="text-muted">源码位置:</small>
<a href="./static/server/controllers/interface.js.html#732" target="_blank">./server/controllers/interface.js:732</a>
<a href="./static/server/controllers/interface.js.html#739" target="_blank">./server/controllers/interface.js:739</a>
</p>

View File

@ -185,7 +185,7 @@
<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="case.html">接口测试</a> 使用。</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>

View File

@ -388,9 +388,7 @@ class groupController extends baseController {
let projectInst = yapi.getInst(projectModel);
let userInst = yapi.getInst(userModel);
let result = await groupInst.list();
// let count = await groupInst.getListCount();
// let count = await projectInst.getProjectListCount();
// console.log('count', count);
let privateGroup = await groupInst.getByPrivateUid(this.getUid());
let newResult = [];

View File

@ -149,11 +149,13 @@ class interfaceController extends baseController {
};
if (!_.isUndefined(params.req_query)) {
data.req_query = params.req_query;
data.req_query = this.requiredSort(params.req_query);
// data.req_query = params.req_query;
}
if (!_.isUndefined(params.req_body_form)) {
data.req_body_form = params.req_body_form;
data.req_body_form = this.requiredSort(params.req_body_form);
// data.req_body_form = params.req_body_form;
}
if (params.path.indexOf(":") > 0) {
@ -194,7 +196,8 @@ class interfaceController extends baseController {
username: username,
typeid: params.project_id
});
this.projectModel.up(params.project_id,{up_time: new Date().getTime()}).then();
this.projectModel.up(params.project_id,{up_time: new Date().getTime()}).then();
//let project = await this.projectModel.getBaseInfo(params.project_id);
// let interfaceUrl = `http://${ctx.request.host}/project/${params.project_id}/interface/api/${result._id}`
// this.sendNotice(params.project_id, {
@ -471,7 +474,8 @@ class interfaceController extends baseController {
}
if (!_.isUndefined(params.req_body_form)) {
data.req_body_form = params.req_body_form;
data.req_body_form = this.requiredSort(params.req_body_form);
// data.req_body_form = params.req_body_form;
}
if (!_.isUndefined(params.req_params) && Array.isArray(params.req_params) && params.req_params.length > 0) {
if(Array.isArray(params.req_params) && params.req_params.length > 0){
@ -485,7 +489,9 @@ class interfaceController extends baseController {
}
if (!_.isUndefined(params.req_query)) {
data.req_query = params.req_query;
// data.req_query = params.req_query;
data.req_query = this.requiredSort(params.req_query);
// console.log("req",this.requiredSort(params.req_query));
}
if (!_.isUndefined(params.req_body_other)) {
@ -522,6 +528,7 @@ class interfaceController extends baseController {
typeid: cate.project_id
});
});
this.projectModel.up(interfaceData.project_id,{up_time: new Date().getTime()}).then();
} else {
let cateid = interfaceData.catid;
@ -534,6 +541,7 @@ class interfaceController extends baseController {
typeid: cate.project_id
});
});
this.projectModel.up(interfaceData.project_id,{up_time: new Date().getTime()}).then();
}
if (params.switch_notice === true) {
@ -601,7 +609,6 @@ class interfaceController extends baseController {
});
})
this.projectModel.up(data.project_id,{up_time: new Date().getTime()}).then();
ctx.body = yapi.commons.resReturn(result);
} catch (err) {
ctx.body = yapi.commons.resReturn(null, 402, err.message);
@ -810,6 +817,12 @@ class interfaceController extends baseController {
}
requiredSort(params) {
return params.sort((item1, item2) => {
return item2.required - item1.required;
})
}
}
module.exports = interfaceController;