yuan_yi
3 years ago
4 changed files with 37 additions and 1 deletions
@ -0,0 +1,23 @@ |
|||
'use strict'; |
|||
|
|||
async function get (ctx) { |
|||
const models = ctx.fs.dc.models; |
|||
try { |
|||
const res = await models.Vender.findAll({ |
|||
order: [ |
|||
['id', 'ASC'] |
|||
] |
|||
}) |
|||
|
|||
ctx.status = 200; |
|||
ctx.body = res |
|||
} catch (error) { |
|||
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|||
ctx.status = 400; |
|||
ctx.body = {} |
|||
} |
|||
} |
|||
|
|||
module.exports = { |
|||
get, |
|||
}; |
@ -0,0 +1,8 @@ |
|||
'use strict'; |
|||
|
|||
const vender = require('../../controllers/vender'); |
|||
|
|||
module.exports = function (app, router, opts) { |
|||
app.fs.api.logAttr['GET/vender'] = { content: '获取设备厂商', visible: false }; |
|||
router.get('/vender', vender.get); |
|||
}; |
Loading…
Reference in new issue