[BE-API-009] be-api: Implement track search endpoint
- Added GET /tracks/search route in setupTrackRoutes - Initialized TrackSearchService and set it in TrackHandler - Handler SearchTracks and TrackSearchService already existed - Supports query params: q, genre, artist, page, limit - Service handles pagination, filtering, and returns tracks with pagination metadata Phase: PHASE-2 Priority: P1 Progress: 18/267 (6.7%)
This commit is contained in:
parent
bc6bbab04f
commit
0c88017e70
3 changed files with 16 additions and 2 deletions
|
|
@ -1512,7 +1512,17 @@
|
|||
"description": "GET /api/v1/tracks/search with query params (q, genre, artist, page, limit)",
|
||||
"owner": "backend",
|
||||
"estimated_hours": 4,
|
||||
"status": "todo",
|
||||
"status": "completed",
|
||||
"completion": {
|
||||
"completed_at": "2025-12-23T09:44:12Z",
|
||||
"actual_hours": 0.5,
|
||||
"commits": [],
|
||||
"files_changed": [
|
||||
"veza-backend-api/internal/api/router.go"
|
||||
],
|
||||
"notes": "Handler SearchTracks and TrackSearchService already existed and were fully implemented. Added GET /tracks/search route in setupTrackRoutes. Initialized TrackSearchService and set it in TrackHandler via SetSearchService. Handler supports query params: q (search query), genre, artist (via TrackSearchParams), page, limit. Service handles pagination, filtering, and returns tracks with pagination metadata.",
|
||||
"issues_encountered": []
|
||||
},
|
||||
"files_involved": [],
|
||||
"implementation_steps": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -459,10 +459,15 @@ func (r *APIRouter) setupTrackRoutes(router *gin.RouterGroup) {
|
|||
}
|
||||
trackHandler.SetUploadValidator(uploadValidator)
|
||||
|
||||
// BE-API-009: Initialize TrackSearchService for track search functionality
|
||||
trackSearchService := services.NewTrackSearchService(r.db.GormDB)
|
||||
trackHandler.SetSearchService(trackSearchService)
|
||||
|
||||
tracks := router.Group("/tracks")
|
||||
{
|
||||
// Public routes
|
||||
tracks.GET("", trackHandler.ListTracks)
|
||||
tracks.GET("/search", trackHandler.SearchTracks) // BE-API-009: Track search endpoint
|
||||
tracks.GET("/:id", trackHandler.GetTrack)
|
||||
tracks.GET("/:id/stats", trackHandler.GetTrackStats)
|
||||
tracks.GET("/:id/history", trackHandler.GetTrackHistory)
|
||||
|
|
|
|||
|
|
@ -66,4 +66,3 @@ func (s *UserService) SearchUsers(ctx context.Context, params SearchUsersParams)
|
|||
|
||||
return users, total, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue