You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
错误信息:
020-06-24 18:31:39,629 ERROR 177792 [-/127.0.0.1/-/0ms GET /] nodejs.TypeError: Cannot read property 'prototype' of undefined
at generateAPIFunc (D:\egg-example\init\node_modules\egg-swagger-doc\lib\document\index.js:190:22)
at getTag_Path (D:\egg-example\init\node_modules\egg-swagger-doc\lib\document\index.js:115:18)
at buildDocument (D:\egg-example\init\node_modules\egg-swagger-doc\lib\document\index.js:50:14)
at documentInit (D:\egg-example\init\node_modules\egg-swagger-doc\lib\document\index.js:497:7)
at module.exports.swaggerInit (D:\egg-example\init\node_modules\egg-swagger-doc\lib\index.js:10:3)
at D:\egg-example\init\node_modules\egg-swagger-doc\app.js:8:5
at Object.callFn (D:\egg-example\init\node_modules\egg-core\lib\utils\index.js:44:42)
at D:\egg-example\init\node_modules\egg-core\lib\lifecycle.js:256:13
at processTicksAndRejections (internal/process/task_queues.js:79:11)
The text was updated successfully, but these errors were encountered:
import { Controller } from "egg";
/**
*@controller eccmimutecd
*/
class EccmimutecdController extends Controller {
/**
*/
public async index() {
const { ctx } = this; // 当前请求的上下文 Context 对象实例
const Op = require("Sequelize").Op; // 获取sequelize的Op 属性
const body = ctx.request.body; // 获取请求body
const starttime = body.starttime; // 获取请求body 的starttime值
const endtime = body.endtime; // 获取请求body 的endtime 值
const data = await ctx.model.EccmonMimuteCd.findAll({
where: {
time: { [Op.between]: [starttime, endtime] },
},
});
this.Jsonbody(data);
}
Jsonbody(data) {
this.ctx.body = {
code: 200,
result: data,
msg: "sucess",
};
}
}
module.exports = EccmimutecdController;
contract:
request.ts:
module.exports = {
EccmonMimuteCd: {
starttime: { type: 'string', required: true, example: '2020-06-24 10:00:01' },
}
response.ts:
module.exports = {
JsonBody: {
result:{ type: 'string'},
}
}
错误信息:
020-06-24 18:31:39,629 ERROR 177792 [-/127.0.0.1/-/0ms GET /] nodejs.TypeError: Cannot read property 'prototype' of undefined
at generateAPIFunc (D:\egg-example\init\node_modules\egg-swagger-doc\lib\document\index.js:190:22)
at getTag_Path (D:\egg-example\init\node_modules\egg-swagger-doc\lib\document\index.js:115:18)
at buildDocument (D:\egg-example\init\node_modules\egg-swagger-doc\lib\document\index.js:50:14)
at documentInit (D:\egg-example\init\node_modules\egg-swagger-doc\lib\document\index.js:497:7)
at module.exports.swaggerInit (D:\egg-example\init\node_modules\egg-swagger-doc\lib\index.js:10:3)
at D:\egg-example\init\node_modules\egg-swagger-doc\app.js:8:5
at Object.callFn (D:\egg-example\init\node_modules\egg-core\lib\utils\index.js:44:42)
at D:\egg-example\init\node_modules\egg-core\lib\lifecycle.js:256:13
at processTicksAndRejections (internal/process/task_queues.js:79:11)
The text was updated successfully, but these errors were encountered: