mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
feat: add top-artists report
This commit is contained in:
parent
6a6ba493f6
commit
6fc10c40ca
18 changed files with 345 additions and 30 deletions
|
|
@ -3,7 +3,9 @@ import { Auth } from "src/auth/decorators/auth.decorator";
|
|||
import { ReqUser } from "../auth/decorators/req-user.decorator";
|
||||
import { User } from "../users/user.entity";
|
||||
import { GetListenReportDto } from "./dto/get-listen-report.dto";
|
||||
import { GetTopArtistsReportDto } from "./dto/get-top-artists-report.dto";
|
||||
import { ListenReportDto } from "./dto/listen-report.dto";
|
||||
import { TopArtistsReportDto } from "./dto/top-artists-report.dto";
|
||||
import { ReportsService } from "./reports.service";
|
||||
|
||||
@Controller("api/v1/reports")
|
||||
|
|
@ -18,4 +20,13 @@ export class ReportsController {
|
|||
): Promise<ListenReportDto> {
|
||||
return this.reportsService.getListens({ ...options, user });
|
||||
}
|
||||
|
||||
@Get("top-artists")
|
||||
@Auth()
|
||||
async getTopArtists(
|
||||
@Query() options: Omit<GetTopArtistsReportDto, "user">,
|
||||
@ReqUser() user: User
|
||||
): Promise<TopArtistsReportDto> {
|
||||
return this.reportsService.getTopArtists({ ...options, user });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue