|
|
@@ -3,15 +3,17 @@ import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common'
|
|
|
import { ChannelService } from './channel.service'
|
|
|
import { PageRequest } from '../common/dto/page-request'
|
|
|
import { Channel } from './entities/channel.entities'
|
|
|
+import { HasRoles } from '../auth/roles.decorator'
|
|
|
+import { Role } from '../model/role.enum'
|
|
|
|
|
|
@Controller('channel')
|
|
|
@Public()
|
|
|
export class ChannelController {
|
|
|
- constructor(private readonly channelService: ChannelService) {
|
|
|
- }
|
|
|
+ constructor(private readonly channelService: ChannelService) {}
|
|
|
|
|
|
@Post('/')
|
|
|
async findAll(@Body() page: PageRequest<Channel>) {
|
|
|
+ page.page.limit = 50
|
|
|
return await this.channelService.findAll(page)
|
|
|
}
|
|
|
|
|
|
@@ -25,9 +27,13 @@ export class ChannelController {
|
|
|
return await this.channelService.delete(id)
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Get('/:id/open/:flag')
|
|
|
async openAll(@Param('id') id: number, @Param('flag') flag: number) {
|
|
|
return await this.channelService.openAll(id, flag)
|
|
|
}
|
|
|
+
|
|
|
+ @Get('/channelList')
|
|
|
+ async getChannelList() {
|
|
|
+ return await this.channelService.getChannelList()
|
|
|
+ }
|
|
|
}
|