233 lines
8.1 KiB
TypeScript
233 lines
8.1 KiB
TypeScript
import { Body, Controller, Get, Inject, Param, Post, Query, UseGuards } from '@nestjs/common';
|
|
import { CurrentUser } from '../auth/current-user.decorator';
|
|
import { JwtAuthGuard } from '../auth/jwt-auth.guard';
|
|
import type { AuthRequestUser } from '../auth/auth.types';
|
|
import {
|
|
LiveActionAttachKeyframeDto,
|
|
LiveActionCostEstimateQueryDto,
|
|
LiveActionGenerateDto,
|
|
LiveActionManualReviewDto,
|
|
LiveActionPreflightQueryDto,
|
|
LiveActionQualityCheckDto,
|
|
LiveActionShotAssetPlanQueryDto,
|
|
LiveActionUpdateShotPromptDto
|
|
} from './live-action.dto';
|
|
import { LiveActionService } from './live-action.service';
|
|
|
|
@Controller()
|
|
@UseGuards(JwtAuthGuard)
|
|
export class LiveActionController {
|
|
constructor(@Inject(LiveActionService) private readonly liveActionService: LiveActionService) {}
|
|
|
|
@Get('projects/:projectId/live-action/actor-profiles')
|
|
listActorProfiles(@CurrentUser() user: AuthRequestUser, @Param('projectId') projectId: string) {
|
|
return this.liveActionService.listActorProfiles(user, projectId);
|
|
}
|
|
|
|
@Post('projects/:projectId/live-action/actor-profiles/generate')
|
|
generateActorProfiles(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('projectId') projectId: string,
|
|
@Body() dto: LiveActionGenerateDto
|
|
) {
|
|
return this.liveActionService.generateActorProfiles(user, projectId, dto);
|
|
}
|
|
|
|
@Get('episodes/:episodeId/live-action/shots')
|
|
listLiveActionShots(@CurrentUser() user: AuthRequestUser, @Param('episodeId') episodeId: string) {
|
|
return this.liveActionService.listLiveActionShots(user, episodeId);
|
|
}
|
|
|
|
@Get('episodes/:episodeId/live-action/shot-asset-plans')
|
|
planLiveActionShotAssets(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Query() query: LiveActionShotAssetPlanQueryDto
|
|
) {
|
|
return this.liveActionService.planLiveActionShotAssets(user, episodeId, query);
|
|
}
|
|
|
|
@Get('episodes/:episodeId/live-action/generation-plans')
|
|
listGenerationPlans(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string
|
|
) {
|
|
return this.liveActionService.listGenerationPlans(user, episodeId);
|
|
}
|
|
|
|
@Get('episodes/:episodeId/live-action/generation-plans/compare')
|
|
compareGenerationPlans(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Query('base_plan_id') basePlanId: string,
|
|
@Query('target_plan_id') targetPlanId: string
|
|
) {
|
|
return this.liveActionService.compareGenerationPlans(user, episodeId, basePlanId, targetPlanId);
|
|
}
|
|
|
|
@Post('episodes/:episodeId/live-action/shots/prepare')
|
|
prepareLiveActionShots(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Body() dto: LiveActionGenerateDto
|
|
) {
|
|
return this.liveActionService.prepareLiveActionShots(user, episodeId, dto);
|
|
}
|
|
|
|
@Post('episodes/:episodeId/live-action/keyframes/generate')
|
|
generateKeyframes(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Body() dto: LiveActionGenerateDto
|
|
) {
|
|
return this.liveActionService.generateKeyframes(user, episodeId, dto);
|
|
}
|
|
|
|
@Get('episodes/:episodeId/live-action/video-clips')
|
|
listVideoClips(@CurrentUser() user: AuthRequestUser, @Param('episodeId') episodeId: string) {
|
|
return this.liveActionService.listVideoClips(user, episodeId);
|
|
}
|
|
|
|
@Get('live-action/video-providers')
|
|
listVideoProviders(@CurrentUser() user: AuthRequestUser) {
|
|
return this.liveActionService.listVideoProviders(user);
|
|
}
|
|
|
|
@Get('episodes/:episodeId/live-action/video-clips/cost-estimate')
|
|
estimateVideoClipCost(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Query() query: LiveActionCostEstimateQueryDto
|
|
) {
|
|
return this.liveActionService.estimateVideoClipCost(user, episodeId, query.provider_code);
|
|
}
|
|
|
|
@Get('episodes/:episodeId/live-action/video-clips/preflight')
|
|
preflightVideoClips(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Query() query: LiveActionPreflightQueryDto
|
|
) {
|
|
return this.liveActionService.preflightVideoClips(user, episodeId, query);
|
|
}
|
|
|
|
@Post('episodes/:episodeId/live-action/shots/:shotId/keyframe')
|
|
attachShotKeyframe(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Param('shotId') shotId: string,
|
|
@Body() dto: LiveActionAttachKeyframeDto
|
|
) {
|
|
return this.liveActionService.attachShotKeyframe(user, episodeId, shotId, dto);
|
|
}
|
|
|
|
@Post('episodes/:episodeId/live-action/shots/:shotId/keyframe/generate')
|
|
generateShotKeyframe(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Param('shotId') shotId: string,
|
|
@Body() dto: LiveActionGenerateDto
|
|
) {
|
|
return this.liveActionService.generateShotKeyframe(user, episodeId, shotId, dto);
|
|
}
|
|
|
|
@Post('episodes/:episodeId/live-action/shots/:shotId/keyframe/approve')
|
|
approveShotKeyframe(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Param('shotId') shotId: string,
|
|
@Body() dto: LiveActionGenerateDto
|
|
) {
|
|
return this.liveActionService.approveShotKeyframe(user, episodeId, shotId, dto);
|
|
}
|
|
|
|
@Post('episodes/:episodeId/live-action/shots/:shotId/generation-plan/freeze')
|
|
freezeShotGenerationPlan(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Param('shotId') shotId: string,
|
|
@Body() dto: LiveActionGenerateDto
|
|
) {
|
|
return this.liveActionService.freezeShotGenerationPlan(user, episodeId, shotId, dto);
|
|
}
|
|
|
|
@Post('episodes/:episodeId/live-action/shots/:shotId/prompt')
|
|
updateShotPrompt(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Param('shotId') shotId: string,
|
|
@Body() dto: LiveActionUpdateShotPromptDto
|
|
) {
|
|
return this.liveActionService.updateShotPrompt(user, episodeId, shotId, dto);
|
|
}
|
|
|
|
@Post('episodes/:episodeId/live-action/shots/:shotId/video-clip/generate')
|
|
generateShotVideoClip(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Param('shotId') shotId: string,
|
|
@Body() dto: LiveActionGenerateDto
|
|
) {
|
|
return this.liveActionService.generateShotVideoClip(user, episodeId, shotId, dto);
|
|
}
|
|
|
|
@Post('episodes/:episodeId/live-action/video-clips/generate')
|
|
generateVideoClips(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Body() dto: LiveActionGenerateDto
|
|
) {
|
|
return this.liveActionService.generateVideoClips(user, episodeId, dto);
|
|
}
|
|
|
|
@Post('live-action/video-clips/:clipId/retry')
|
|
retryVideoClip(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('clipId') clipId: string,
|
|
@Body() dto: LiveActionGenerateDto
|
|
) {
|
|
return this.liveActionService.retryVideoClip(user, clipId, dto);
|
|
}
|
|
|
|
@Post('live-action/video-clips/:clipId/quality-check')
|
|
checkVideoClipQuality(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('clipId') clipId: string,
|
|
@Body() dto: LiveActionQualityCheckDto
|
|
) {
|
|
return this.liveActionService.checkVideoClipQuality(user, clipId, dto);
|
|
}
|
|
|
|
@Post('live-action/video-clips/:clipId/manual-review')
|
|
manualReviewVideoClip(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('clipId') clipId: string,
|
|
@Body() dto: LiveActionManualReviewDto
|
|
) {
|
|
return this.liveActionService.manualReviewVideoClip(user, clipId, dto);
|
|
}
|
|
|
|
@Post('live-action/video-clips/:clipId/select-candidate')
|
|
selectVideoClipCandidate(@CurrentUser() user: AuthRequestUser, @Param('clipId') clipId: string) {
|
|
return this.liveActionService.selectVideoClipCandidate(user, clipId);
|
|
}
|
|
|
|
@Post('episodes/:episodeId/live-action/render')
|
|
renderLiveActionEpisode(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Body() dto: LiveActionGenerateDto
|
|
) {
|
|
return this.liveActionService.renderLiveActionEpisode(user, episodeId, dto);
|
|
}
|
|
|
|
@Post('episodes/:episodeId/live-action/music/generate')
|
|
generateOriginalMusicPackage(
|
|
@CurrentUser() user: AuthRequestUser,
|
|
@Param('episodeId') episodeId: string,
|
|
@Body() dto: LiveActionGenerateDto
|
|
) {
|
|
return this.liveActionService.generateOriginalMusicPackage(user, episodeId, dto);
|
|
}
|
|
}
|