mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-09 05:00:30 +08:00
docs: 增加搜索文档返回示例
This commit is contained in:
parent
37762a109d
commit
cb8ab8a762
@ -7,7 +7,6 @@ import projectModel from '../models/project.js'
|
||||
class groupController extends baseController{
|
||||
constructor(ctx){
|
||||
super(ctx)
|
||||
console.log('constructor....')
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -710,7 +710,7 @@ var projectController = function (_baseController) {
|
||||
* @foldnumber 10
|
||||
* @param {String} q
|
||||
* @return {Object}
|
||||
* @example
|
||||
* @example ./api/project/search.json
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -838,7 +838,7 @@ var userController = function (_baseController) {
|
||||
* @foldnumber 10
|
||||
* @param {String} q
|
||||
* @return {Object}
|
||||
* @example
|
||||
* @example ./api/user/search.json
|
||||
*/
|
||||
|
||||
}, {
|
||||
|
@ -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);
|
||||
}
|
||||
}]);
|
||||
|
Loading…
Reference in New Issue
Block a user