From 19cfd3daf45ad4a51adbe6d8ae232780739c2ba0 Mon Sep 17 00:00:00 2001 From: lishuang Date: Sun, 12 Jul 2020 17:55:40 +0800 Subject: [PATCH] Add the field deletedKeepDays. --- code/rest/preference_controller.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/rest/preference_controller.go b/code/rest/preference_controller.go index fb3977e..942ddf2 100644 --- a/code/rest/preference_controller.go +++ b/code/rest/preference_controller.go @@ -123,6 +123,10 @@ func (this *PreferenceController) Edit(writer http.ResponseWriter, request *http intDeletedKeepDays, err := strconv.Atoi(deletedKeepDaysStr) this.PanicError(err) deletedKeepDays = int64(intDeletedKeepDays) + + if deletedKeepDays < 0 { + panic(result.BadRequest("deletedKeepDays cannot less than 0")) + } } var allowRegister = false