Skip to content

Implemented sounds routing with CRUD, voting, and file upload endpoints#16

Draft
Wikijito7 wants to merge 5 commits into
masterfrom
feature/6-implement-sounds-routing
Draft

Implemented sounds routing with CRUD, voting, and file upload endpoints#16
Wikijito7 wants to merge 5 commits into
masterfrom
feature/6-implement-sounds-routing

Conversation

@Wikijito7

Copy link
Copy Markdown
Owner

Solves #6

📋 Changelist Summary

Implemented full sounds routing: data model updates, repository logic, audio file storage, MongoDB data source, and 9 API endpoints.

💬 Description

This PR completes the sounds feature that was partially stubbed out. It includes:

  • Data model: Added SoundUserBO/DBO/DTO (simplified user for votes), description and status fields to sounds, VoteRequestDTO and UpdateSoundRequestDTO
  • Data source: Created SoundsLocalDataSource with MongoDB collection registration and paginated queries
  • File storage: Created SoundFileService for saving, serving, and deleting audio files (non-deprecated Ktor API)
  • Repository: Full implementation of SoundRepositoryImpl with all CRUD operations, voting logic, and file management
  • Routes: 9 endpoints under authenticate {}:
    • GET /sounds — list with pagination
    • GET /sound/{id} — sound detail
    • GET /sound/{id}/file — serve audio
    • POST /sound — create (multipart with title + audio)
    • PUT /sound/{id} — update metadata
    • DELETE /sound/{id} — delete sound
    • POST /sound/{id}/vote — vote up/down
    • POST /sound/{id}/file — replace audio
    • GET /user/sounds — user's own sounds

This PR was generated using AI assistance. Please review carefully.

@Wikijito7 Wikijito7 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found during frontend review. The soundUrl (🔴) is a blocker — fixing it in the mapper is the simplest approach.

Comment thread src/main/kotlin/es/wokis/data/mapper/sound/SoundMapper.kt
Comment thread src/main/kotlin/es/wokis/routing/SoundRouting.kt
Comment thread src/main/kotlin/es/wokis/data/dto/sound/SoundDTO.kt
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
9.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant