docs: 增加搜索文档返回示例

This commit is contained in:
祝鑫奔 2017-07-14 17:00:30 +08:00
parent 37762a109d
commit cb8ab8a762
8 changed files with 8 additions and 13 deletions

View File

@ -7,7 +7,6 @@ import projectModel from '../models/project.js'
class groupController extends baseController{
constructor(ctx){
super(ctx)
console.log('constructor....')
}

View File

@ -1,4 +1,4 @@
import projectModel from '../models/project.js'
import projectModel from '../models/project.js'
import yapi from '../yapi.js'
import baseController from './base.js'
import interfaceModel from '../models/interface.js'
@ -288,7 +288,7 @@ class projectController extends baseController {
* @foldnumber 10
* @param {String} q
* @return {Object}
* @example
* @example ./api/project/search.json
*/
async search(ctx) {
const { q } = ctx.request.query;

View File

@ -368,7 +368,7 @@ class userController extends baseController{
* @foldnumber 10
* @param {String} q
* @return {Object}
* @example
* @example ./api/user/search.json
*/
async search(ctx) {
const { q } = ctx.request.query;

View File

@ -46,7 +46,7 @@ class groupModel extends baseModel{
search(keyword) {
return this.model.find({
name: new RegExp(keyword, 'ig')
group_name: new RegExp(keyword, 'i')
})
.limit(10)
}

View File

@ -56,11 +56,7 @@ var groupController = function (_baseController) {
function groupController(ctx) {
(0, _classCallCheck3.default)(this, groupController);
var _this = (0, _possibleConstructorReturn3.default)(this, (groupController.__proto__ || (0, _getPrototypeOf2.default)(groupController)).call(this, ctx));
console.log('constructor....');
return _this;
return (0, _possibleConstructorReturn3.default)(this, (groupController.__proto__ || (0, _getPrototypeOf2.default)(groupController)).call(this, ctx));
}
/**

View File

@ -710,7 +710,7 @@ var projectController = function (_baseController) {
* @foldnumber 10
* @param {String} q
* @return {Object}
* @example
* @example ./api/project/search.json
*/
}, {

View File

@ -838,7 +838,7 @@ var userController = function (_baseController) {
* @foldnumber 10
* @param {String} q
* @return {Object}
* @example
* @example ./api/user/search.json
*/
}, {

View File

@ -98,7 +98,7 @@ var groupModel = function (_baseModel) {
key: 'search',
value: function search(keyword) {
return this.model.find({
name: new RegExp(keyword, 'ig')
group_name: new RegExp(keyword, 'i')
}).limit(10);
}
}]);