feat(settings): add settings management API endpoints

- Add GET /settings/get and POST /settings/set endpoints for managing system settings
- Implement config file persistence for settings changes
- Update config schema to include notification and webhook settings
- Add API documentation for new endpoints
- Move config path variables to global package for consistency
This commit is contained in:
2026-04-23 12:43:11 +08:00
parent 489c37e095
commit ac51641e93
6 changed files with 303 additions and 16 deletions

View File

@@ -11,10 +11,12 @@ import (
)
func setupRoutes() {
http.HandleFunc("/system/getStatus", GetStatusHandler)
http.HandleFunc("/system/getSoftwareInfo", GetSoftwareInfoHandler)
systemLogHandler := postLog.NewLogSocketHandler(postLog.GetLogBroadcaster())
http.HandleFunc("/system/getLogs", systemLogHandler.Handle)
http.HandleFunc("/system/getStatus", GetStatusHandler)
http.HandleFunc("/system/getSoftwareInfo", GetSoftwareInfoHandler)
http.HandleFunc("/system/settings/get", handlers.GetSettingsHandler)
http.HandleFunc("/system/settings/set", handlers.SetSettingsHandler)
http.HandleFunc("/register", handlers.RegisterHandler)
http.HandleFunc("/login", handlers.LoginHandler)