part set config

This commit is contained in:
程广 2023-12-13 14:36:49 +08:00
parent fd4234de77
commit 5a60e898ed
1 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,15 @@ func about(w http.ResponseWriter, r *http.Request) {
} }
func setConfig(w http.ResponseWriter, r *http.Request) { func setConfig(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
ctxData := ctx.Value(server.RequestCtxKey("ctxData")).(map[string]interface{})
data, ok := ctxData["data"]
if !ok {
w.WriteHeader(http.StatusBadRequest)
return
}
t := data.(model.HttpServerConfig)
model.SetServerConfig(&t)
} }