chore: import DH V2 D5.6.4 production baseline
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Param,
|
||||
ParseIntPipe,
|
||||
ParseUUIDPipe,
|
||||
Query,
|
||||
} from '@nestjs/common';
|
||||
import { RequirePermissions } from '../authorization/decorators/require-permissions.decorator';
|
||||
import { AssetHistoryService } from './asset-history.service';
|
||||
import {
|
||||
AssetVersionPageQueryDto,
|
||||
ListAssetVersionsQueryDto,
|
||||
} from './dto/list-asset-versions-query.dto';
|
||||
|
||||
@Controller()
|
||||
export class AssetHistoryController {
|
||||
constructor(private readonly history: AssetHistoryService) {}
|
||||
|
||||
@Get('asset-versions')
|
||||
@RequirePermissions('assets.read_history')
|
||||
list(@Query() query: ListAssetVersionsQueryDto) {
|
||||
return this.history.list(query);
|
||||
}
|
||||
|
||||
@Get('assets/:id/versions')
|
||||
@RequirePermissions('assets.read_history')
|
||||
listForAsset(
|
||||
@Param('id', new ParseUUIDPipe({ version: '4' })) id: string,
|
||||
@Query() query: AssetVersionPageQueryDto,
|
||||
) {
|
||||
return this.history.listForAsset(id, query);
|
||||
}
|
||||
|
||||
@Get('assets/:id/versions/:versionNumber')
|
||||
@RequirePermissions('assets.read_history')
|
||||
getVersion(
|
||||
@Param('id', new ParseUUIDPipe({ version: '4' })) id: string,
|
||||
@Param('versionNumber', new ParseIntPipe()) versionNumber: number,
|
||||
) {
|
||||
return this.history.getVersion(id, versionNumber);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user