feat(instance): refactor modify endpoint to support config types

- Change modify endpoint from `/modify/{field}` to `/modify` with POST
- Add support for two modification types: configFile and systemConfig
- Implement config file parsing using ini package for configFile type
- Update database schema to include name in update query
- Add comprehensive input validation and error handling
- Update documentation to reflect new API changes
This commit is contained in:
2026-03-02 22:43:18 +08:00
parent fc4ad46f6c
commit 1dc0d840b0
7 changed files with 257 additions and 85 deletions

View File

@@ -47,13 +47,9 @@ func setupRoutes() {
return
}
if strings.HasPrefix(remainingPath, "modify/") {
parts := strings.SplitN(remainingPath, "/", 2)
if len(parts) == 2 {
field := parts[1]
ModifyInstanceHandler(w, r, field)
return
}
if remainingPath == "modify" { // Handle `/modify` by POST request
ModifyInstanceHandler(w, r)
return
}
}