1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-06-10 10:50:23 +08:00

funish dynamic info

This commit is contained in:
源文雨
2023-03-20 20:23:28 +08:00
parent 7abe88c190
commit 1573b63d8b
6 changed files with 123 additions and 22 deletions

View File

@@ -268,6 +268,20 @@ func init() {
}
writeresult(w, codeSuccess, "成功", messageOk, typeSuccess)
}}
apimap["/api/delMessage"] = &apihandler{"GET", func(w http.ResponseWriter, r *http.Request) {
id, err := strconv.Atoi(r.URL.Query().Get("id"))
if err != nil {
writeresult(w, codeError, nil, err.Error(), typeError)
return
}
err = delMessage(r.Header.Get("Authorization"), id)
if err != nil {
writeresult(w, codeError, nil, err.Error(), typeError)
return
}
writeresult(w, codeSuccess, "成功", messageOk, typeSuccess)
}}
}
// APIHandler serves all backend /api call