2017-07-04 16:43:07 +08:00
|
|
|
import koaRouter from 'koa-router'
|
|
|
|
import interfaceController from './controllers/interface.js'
|
|
|
|
import groupController from './controllers/group.js'
|
2017-07-03 16:16:05 +08:00
|
|
|
|
2017-07-04 16:43:07 +08:00
|
|
|
const router = koaRouter();
|
2017-07-03 16:16:05 +08:00
|
|
|
|
2017-07-04 16:43:07 +08:00
|
|
|
const INTERFACE_PREFIX = {
|
2017-07-03 16:16:05 +08:00
|
|
|
interface: '/interface/',
|
2017-07-04 16:43:07 +08:00
|
|
|
user: '/user/',
|
|
|
|
group: '/group/'
|
2017-07-03 16:16:05 +08:00
|
|
|
};
|
|
|
|
|
2017-07-04 16:43:07 +08:00
|
|
|
router.post ( INTERFACE_PREFIX.interface + 'add', interfaceController.add)
|
|
|
|
.get ( INTERFACE_PREFIX.interface + 'list', interfaceController.list)
|
|
|
|
.get ( INTERFACE_PREFIX.group + 'list', groupController.list)
|
|
|
|
.post ( INTERFACE_PREFIX.group + 'add', groupController.add)
|
|
|
|
.post ( INTERFACE_PREFIX.group + 'up', groupController.up)
|
|
|
|
.post ( INTERFACE_PREFIX.group + 'del', groupController.del)
|
2017-07-03 16:16:05 +08:00
|
|
|
|
|
|
|
module.exports = router
|