This commit is contained in:
xucong053
2022-07-25 21:15:03 +08:00
committed by 徐聪
parent df20035234
commit c5f482dbfa
7 changed files with 278 additions and 215 deletions
+10 -3
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)