feat: audio track history

This commit is contained in:
Krispire Admin
2026-07-02 19:22:54 +05:30
parent 44a0016513
commit 9c9c46caf1
7 changed files with 273 additions and 0 deletions
@@ -0,0 +1,33 @@
// Package service — AudioProgressService is a thin passthrough over
// AudioProgressRepo. The audio player's resume points carry no server-side
// business logic (the frontend owns the schema and the newest-wins merge
// is enforced in SQL), so this layer exists only to keep the
// handler → service → repository shape consistent with the rest of the API.
package service
import (
"context"
"github.com/prabhupadasays/spsays-bff/internal/model"
"github.com/prabhupadasays/spsays-bff/internal/repository"
)
type AudioProgressService struct {
repo *repository.AudioProgressRepo
}
func NewAudioProgressService(repo *repository.AudioProgressRepo) *AudioProgressService {
return &AudioProgressService{repo: repo}
}
func (s *AudioProgressService) List(ctx context.Context, userID string) ([]model.AudioProgress, error) {
return s.repo.ListByUser(ctx, userID)
}
func (s *AudioProgressService) Upsert(ctx context.Context, userID string, items []model.AudioProgress) error {
return s.repo.Upsert(ctx, userID, items)
}
func (s *AudioProgressService) Delete(ctx context.Context, userID, key string) error {
return s.repo.Delete(ctx, userID, key)
}