This commit is contained in:
xucong053
2022-05-22 12:44:18 +08:00
committed by 徐聪
parent ab91feedbc
commit ae8fc70ff6
7 changed files with 278 additions and 215 deletions

View File

@@ -198,9 +198,16 @@ func (api *apiHandler) Stop(w http.ResponseWriter, r *http.Request) {
}
}
api.boomer.Stop()
resp := &CommonResponseBody{
ServerStatus: EnumAPIResponseSuccess,
var resp *CommonResponseBody
err := api.boomer.Stop()
if err != nil {
resp = &CommonResponseBody{
ServerStatus: EnumAPIResponseStopError(err.Error()),
}
} else {
resp = &CommonResponseBody{
ServerStatus: EnumAPIResponseSuccess,
}
}
body, _ := json.Marshal(resp)
writeJSON(w, body, http.StatusOK)