feat;提交管理端和城市合伙人端
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { Body, Controller, Get, Param, Post, Put, Query, UseGuards } from '@nestjs/common';
|
||||
import { HqAuthGuard } from '../../common/guards/hq-auth.guard';
|
||||
import { AdminPromoCodesService } from './admin-promo-codes.service';
|
||||
import { AdminPromoCodesQueryDto } from './dto/admin-query.dto';
|
||||
import { CreatePromoCodeDto, UpdatePromoCodeStatusDto } from './dto/admin-mutate.dto';
|
||||
|
||||
@Controller('admin/promo-codes')
|
||||
@UseGuards(HqAuthGuard)
|
||||
export class AdminPromoCodesController {
|
||||
constructor(private readonly service: AdminPromoCodesService) {}
|
||||
|
||||
@Get()
|
||||
list(@Query() query: AdminPromoCodesQueryDto) {
|
||||
return this.service.list(query);
|
||||
}
|
||||
|
||||
@Get(':id/stats')
|
||||
stats(@Param('id') id: string) {
|
||||
return this.service.stats(BigInt(id));
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
detail(@Param('id') id: string) {
|
||||
return this.service.detail(BigInt(id));
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@Body() dto: CreatePromoCodeDto) {
|
||||
return this.service.create(dto);
|
||||
}
|
||||
|
||||
@Put(':id/status')
|
||||
updateStatus(@Param('id') id: string, @Body() dto: UpdatePromoCodeStatusDto) {
|
||||
return this.service.updateStatus(BigInt(id), dto.status);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user