mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-05 00:45:29 +08:00
21 lines
614 B
Go
21 lines
614 B
Go
package settings
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/go-chi/chi/v5"
|
|
)
|
|
|
|
func RegisterRoutes(r chi.Router, h *Handler) {
|
|
r.Get("/settings", h.getSettings)
|
|
r.Put("/settings", h.updateSettings)
|
|
r.Post("/settings/password", h.updateSettingsPassword)
|
|
}
|
|
|
|
func (h *Handler) GetSettings(w http.ResponseWriter, r *http.Request) { h.getSettings(w, r) }
|
|
func (h *Handler) UpdateSettings(w http.ResponseWriter, r *http.Request) { h.updateSettings(w, r) }
|
|
func (h *Handler) UpdateSettingsPassword(w http.ResponseWriter, r *http.Request) {
|
|
h.updateSettingsPassword(w, r)
|
|
}
|
|
func BoolFrom(v any) bool { return boolFrom(v) }
|