29 lines
836 B
TypeScript
29 lines
836 B
TypeScript
|
|
import { TokenAccount } from '@/common/decorators/tokenInfo.decorator'
|
||
|
|
import { Body, Controller, Get, Param, Patch } from '@nestjs/common'
|
||
|
|
import { UpdateBusinessActivityDto } from './dto/poses.dto'
|
||
|
|
import { PosesService } from './poses.service'
|
||
|
|
|
||
|
|
@Controller('consumer/poses')
|
||
|
|
export class PosesController {
|
||
|
|
constructor(private readonly service: PosesService) {}
|
||
|
|
|
||
|
|
@Get()
|
||
|
|
async findAll(@TokenAccount('userId') userId: string) {
|
||
|
|
return this.service.findAll(userId)
|
||
|
|
}
|
||
|
|
|
||
|
|
@Get(':id')
|
||
|
|
async findOne(@TokenAccount('userId') userId: string, @Param('id') id: string) {
|
||
|
|
return this.service.findOne(userId, id)
|
||
|
|
}
|
||
|
|
|
||
|
|
@Patch(':id')
|
||
|
|
async update(
|
||
|
|
@TokenAccount('userId') userId: string,
|
||
|
|
@Param('id') id: string,
|
||
|
|
@Body() data: UpdateBusinessActivityDto,
|
||
|
|
) {
|
||
|
|
return this.service.update(userId, id, data)
|
||
|
|
}
|
||
|
|
}
|