feat(api): add unified models, mappers, and prefixed routes (movie/tv/search)

This commit is contained in:
Erno
2025-10-19 08:46:25 +00:00
parent 855cc0920c
commit 43af05cf91
7 changed files with 579 additions and 85 deletions

View File

@@ -0,0 +1,23 @@
package handlers
import (
"encoding/json"
"net/http"
"time"
"github.com/gorilla/mux"
)
func muxVars(r *http.Request) map[string]string { return mux.Vars(r) }
func writeJSON(w http.ResponseWriter, status int, v interface{}) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(status)
_ = json.NewEncoder(w).Encode(v)
}
type metaEnvelope struct {
FetchedAt time.Time `json:"fetchedAt"`
APIVersion string `json:"apiVersion"`
ResponseTime int64 `json:"responseTime"`
}