26 lines
917 B
TypeScript
26 lines
917 B
TypeScript
import { Body, Controller, Get, Param, Post } from '@nestjs/common';
|
|
import { BidsService } from '../../services/bids.service';
|
|
import { CreateBidDto } from '../../dto/bid/create-bid.dto';
|
|
import { BidHistoriesService } from '../../services/bid-histories.service';
|
|
import { CreateBidHistoryDto } from '../../dto/bid-history/create-bid-history.dto';
|
|
import { Bid } from '../../entities/bid.entity';
|
|
import { GraysApi } from '../../apis/grays.api';
|
|
|
|
@Controller('admin/bid-histories')
|
|
export class AdminBidHistoriesController {
|
|
constructor(
|
|
private readonly bidHistoriesService: BidHistoriesService,
|
|
private readonly graysApi: GraysApi,
|
|
) {}
|
|
|
|
@Post()
|
|
create(@Body() data: CreateBidHistoryDto) {
|
|
return this.bidHistoriesService.create(data);
|
|
}
|
|
|
|
@Get('detail/:lot_id')
|
|
async getBidHistories(@Param('lot_id') lot_id: Bid['lot_id']) {
|
|
return await this.graysApi.getHistoriesBid(lot_id);
|
|
}
|
|
}
|