Spaces:
Sleeping
Sleeping
Download backend/src/modules/admin/admin.controller.ts from kishankrish19/Chat: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/admin/admin.controller.ts
- Command line
-
hf download hf://spaces/kishankrish19/Chat/backend/src/modules/admin/admin.controller.ts
-
curl -L -o admin.controller.ts https://huggingface.co/spaces/kishankrish19/Chat/resolve/main/backend/src/modules/admin/admin.controller.ts
1.46 kB
| import { Controller, Get, Post, Param, Body, UseGuards } from '@nestjs/common'; | |
| import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger'; | |
| import { AdminService } from './admin.service'; | |
| import { JwtAuthGuard } from '../auth/jwt-auth.guard'; | |
| ('Artist & Admin Portal') | |
| ('admin') | |
| (JwtAuthGuard) | |
| () | |
| export class AdminController { | |
| constructor(private readonly adminService: AdminService) {} | |
| ('artists') | |
| ({ summary: 'Admin create or verify an artist profile' }) | |
| verifyArtist(() body: { artist_id: string }) { | |
| return this.adminService.verifyArtist(body.artist_id); | |
| } | |
| ('albums/:id/tracks/bulk-upload') | |
| ({ | |
| summary: 'Bulk upload multiple audio files + CSV metadata for an album', | |
| }) | |
| bulkUpload(('id') id: string, () body: { tracks_count: number }) { | |
| return this.adminService.bulkUpload(id, body.tracks_count || 1); | |
| } | |
| ('analytics/tracks/:id') | |
| ({ | |
| summary: 'Play counts, unique listeners & geographic breakdown for a track', | |
| }) | |
| getTrackAnalytics(('id') id: string) { | |
| return this.adminService.getTrackAnalytics(id); | |
| } | |
| ('tracks/:id/audio') | |
| ({ | |
| summary: 'Replace audio file for track & re-trigger transcoding', | |
| }) | |
| replaceAudio(('id') id: string, () body: { audio_path: string }) { | |
| return this.adminService.replaceAudio(id, body.audio_path); | |
| } | |
| } | |