mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
feat: introduce new report "Top Albums"
This commit is contained in:
parent
09858076bf
commit
9896ea31ff
16 changed files with 246 additions and 9 deletions
|
|
@ -4,6 +4,7 @@ import { ReqUser } from "../auth/decorators/req-user.decorator";
|
|||
import { User } from "../users/user.entity";
|
||||
import { ListenReportDto } from "./dto/listen-report.dto";
|
||||
import { ReportTimeDto } from "./dto/report-time.dto";
|
||||
import { TopAlbumsReportDto } from "./dto/top-albums-report.dto";
|
||||
import { TopArtistsReportDto } from "./dto/top-artists-report.dto";
|
||||
import { ReportsService } from "./reports.service";
|
||||
import { Timeframe } from "./timeframe.enum";
|
||||
|
|
@ -30,4 +31,13 @@ export class ReportsController {
|
|||
): Promise<TopArtistsReportDto> {
|
||||
return this.reportsService.getTopArtists({ user, time });
|
||||
}
|
||||
|
||||
@Get("top-albums")
|
||||
@AuthAccessToken()
|
||||
async getTopAlbums(
|
||||
@Query() time: ReportTimeDto,
|
||||
@ReqUser() user: User
|
||||
): Promise<TopAlbumsReportDto> {
|
||||
return this.reportsService.getTopAlbums({ user, time });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue