12345678910111213141516171819202122232425 |
- 'use strict';
- /**
- * @param {Egg.Application} app - egg application
- */
- module.exports = app => {
- const { router, controller } = app;
- router.get('/', controller.home.index);
- // 用户表设置路由
- router.resources('user', '/api/onlive/user', controller.user); // index、create、show、destroy
- router.post('user', '/api/onlive/user/update/:id', controller.user.update);
- // 房间表设置路由
- router.resources('room', '/api/onlive/room', controller.room); // index、create、show、destroy
- router.post('room', '/api/onlive/room/update/:id', controller.room.update);
- // 聊天表设置路由
- router.resources('chat', '/api/onlive/chat', controller.chat); // index、create、show、destroy
- router.post('chat', '/api/onlive/chat/update/:id', controller.chat.update);
- // 主播表设置路由
- router.resources('roomuser', '/api/onlive/roomuser', controller.roomuser); // index、create、show、destroy
- router.post('roomuser', '/api/onlive/roomuser/update/:id', controller.roomuser.update);
- };
|