init
This commit is contained in:
@@ -2,6 +2,8 @@ package handler
|
||||
|
||||
import "net/http"
|
||||
|
||||
// handleGetLastLog behandelt GET /api/v1/exercises/{id}/last-log.
|
||||
// Gibt den zuletzt geloggten Satz der Übung zurück, oder 404 wenn noch kein Satz existiert.
|
||||
func (h *Handler) handleGetLastLog(w http.ResponseWriter, r *http.Request) {
|
||||
uid, err := userID(r)
|
||||
if err != nil {
|
||||
@@ -26,6 +28,8 @@ func (h *Handler) handleGetLastLog(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, http.StatusOK, lastLog)
|
||||
}
|
||||
|
||||
// handleGetExerciseHistory behandelt GET /api/v1/exercises/{id}/history.
|
||||
// Unterstützt Query-Parameter: limit (Standard: 30).
|
||||
func (h *Handler) handleGetExerciseHistory(w http.ResponseWriter, r *http.Request) {
|
||||
uid, err := userID(r)
|
||||
if err != nil {
|
||||
@@ -47,6 +51,7 @@ func (h *Handler) handleGetExerciseHistory(w http.ResponseWriter, r *http.Reques
|
||||
writeJSON(w, http.StatusOK, logs)
|
||||
}
|
||||
|
||||
// handleGetStatsOverview behandelt GET /api/v1/stats/overview.
|
||||
func (h *Handler) handleGetStatsOverview(w http.ResponseWriter, r *http.Request) {
|
||||
uid, err := userID(r)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user