63 lines
1.8 KiB
TypeScript
63 lines
1.8 KiB
TypeScript
import { Body, Controller, Get, Post, UseGuards } from '@nestjs/common';
|
|
import { HqAuthGuard } from '../../common/guards/hq-auth.guard';
|
|
import {
|
|
HqPermissionGuard,
|
|
RequireHqPermissions,
|
|
} from '../../common/guards/hq-permission.guard';
|
|
import { AdminXiaofeixiaService } from './admin-xiaofeixia.service';
|
|
import {
|
|
XiaofeixiaBatchShipmentQueryDto,
|
|
XiaofeixiaCheckCoverageDto,
|
|
XiaofeixiaCreateShipmentDto,
|
|
XiaofeixiaEstimateFreightDto,
|
|
XiaofeixiaShipmentQueryDto,
|
|
} from './dto/admin-courier.dto';
|
|
|
|
/** HQ 小飞侠接口联调(仅管理端,勿对 C 端暴露) */
|
|
@Controller('admin/courier/xiaofeixia')
|
|
@UseGuards(HqAuthGuard, HqPermissionGuard)
|
|
@RequireHqPermissions('deliveries_debug')
|
|
export class AdminXiaofeixiaController {
|
|
constructor(private readonly service: AdminXiaofeixiaService) {}
|
|
|
|
@Get('config')
|
|
getConfig() {
|
|
return this.service.getConfig();
|
|
}
|
|
|
|
@Post('estimate-freight')
|
|
estimateFreight(@Body() body: XiaofeixiaEstimateFreightDto) {
|
|
return this.service.estimateFreight(body);
|
|
}
|
|
|
|
@Post('check-coverage')
|
|
checkCoverage(@Body() body: XiaofeixiaCheckCoverageDto) {
|
|
return this.service.checkCoverage(body);
|
|
}
|
|
|
|
@Post('create-shipment')
|
|
createShipment(@Body() body: XiaofeixiaCreateShipmentDto) {
|
|
return this.service.createShipment(body);
|
|
}
|
|
|
|
@Post('cancel-shipment')
|
|
cancelShipment(@Body() body: XiaofeixiaShipmentQueryDto) {
|
|
return this.service.cancelShipment(body);
|
|
}
|
|
|
|
@Post('get-shipment')
|
|
getShipment(@Body() body: XiaofeixiaShipmentQueryDto) {
|
|
return this.service.getShipment(body);
|
|
}
|
|
|
|
@Post('batch-get-shipments')
|
|
batchGetShipments(@Body() body: XiaofeixiaBatchShipmentQueryDto) {
|
|
return this.service.batchGetShipments(body);
|
|
}
|
|
|
|
@Post('get-track')
|
|
getTrack(@Body() body: XiaofeixiaShipmentQueryDto) {
|
|
return this.service.getTrack(body);
|
|
}
|
|
}
|