Feature: add dns query json api

This commit is contained in:
Dreamacro
2023-01-16 15:20:39 +08:00
parent 0489a7391b
commit a26b670420
5 changed files with 100 additions and 26 deletions

View File

@ -66,12 +66,10 @@ func getProxy(w http.ResponseWriter, r *http.Request) {
render.JSON(w, r, proxy)
}
type UpdateProxyRequest struct {
Name string `json:"name"`
}
func updateProxy(w http.ResponseWriter, r *http.Request) {
req := UpdateProxyRequest{}
req := struct {
Name string `json:"name"`
}{}
if err := render.DecodeJSON(r.Body, &req); err != nil {
render.Status(r, http.StatusBadRequest)
render.JSON(w, r, ErrBadRequest)