'use strict'; const moment = require('moment') const fs = require('fs'); async function get(ctx) { try { const { models } = ctx.fs.dc; let resourceList = await models.Resource.findAndCountAll({ order: [['id']], }); ctx.status = 200 ctx.body = resourceList; } catch (error) { ctx.fs.logger.error(`path:${ctx.path},error:${error}`) ctx.status = 400; ctx.body = { name: 'FindError', message: 'ๆƒ้™ๅˆ—่กจ' } } } module.exports = { get, }