hqweb端
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { Body, Controller, Get, Param, Put, Query, UseGuards } from '@nestjs/common';
|
||||
import { HqAuthGuard } from '../../common/guards/hq-auth.guard';
|
||||
import { AdminRedeemService, AdminDeliveriesService } from './admin-redeem.service';
|
||||
import { AdminDeliveriesQueryDto, AdminRedeemRecordsQueryDto } from './dto/admin-query.dto';
|
||||
import { UpdateDeliveryDto } from './dto/admin-mutate.dto';
|
||||
|
||||
@Controller('admin/redeem-records')
|
||||
@UseGuards(HqAuthGuard)
|
||||
export class AdminRedeemRecordsController {
|
||||
constructor(private readonly service: AdminRedeemService) {}
|
||||
|
||||
@Get()
|
||||
list(@Query() query: AdminRedeemRecordsQueryDto) {
|
||||
return this.service.listRecords(query);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
detail(@Param('id') id: string) {
|
||||
return this.service.detailRecord(BigInt(id));
|
||||
}
|
||||
}
|
||||
|
||||
@Controller('admin/deliveries')
|
||||
@UseGuards(HqAuthGuard)
|
||||
export class AdminDeliveriesController {
|
||||
constructor(private readonly service: AdminDeliveriesService) {}
|
||||
|
||||
@Get()
|
||||
list(@Query() query: AdminDeliveriesQueryDto) {
|
||||
return this.service.list(query);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
detail(@Param('id') id: string) {
|
||||
return this.service.detail(BigInt(id));
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
update(@Param('id') id: string, @Body() dto: UpdateDeliveryDto) {
|
||||
return this.service.update(BigInt(id), dto);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user