/**
* @swagger
* /path/to/route:
* post:
* summary: 接口描述
* description: 接口描述
* tags: [接口分类]
* produces:
* - application/json
* parameters:
* - name: param1
* type: string
* required: true
* in: formData
* description: 参数描述
* responses:
* 200:
* description: '{ msg: "接口返回" }'
*/
const thisIsApi = async (ctx) => {
ctx.body = 'hello world'
}
thisIsApi.route = ['get', '/path/to/route']
thisIsApi.validator = {
type: 'object',
properties: {
param1: { type: 'string' }
},
required: ['param1'],
target: 'query'
}
thisIsApi.before = [
auth('teacher')
]
thisIsApi.after = [
afterFunc()
]
module.exports = thisIsApi