From 5e6ce65b2ab0f08dc95cd7e5ecbc91597aa2b4b0 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期一, 29 六月 2020 20:43:11 +0800 Subject: [PATCH] add delPlateNo --- controllers/user.go | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/controllers/user.go b/controllers/user.go index 1947e7c..f10062f 100644 --- a/controllers/user.go +++ b/controllers/user.go @@ -148,3 +148,22 @@ u.ServeJSON() } +// @router /delPlateNo [delete] +func (u *UserController) DelPlateNo() { + userId := u.GetString("userId") + plateNo := u.GetString("plateNo") + resp := code.Code{} + var uc models.UserCar + if i,e := uc.Delete(userId, plateNo);e ==nil && i >0 { + resp.Success = true + resp.Status = http.StatusOK + resp.Data = "鍒犻櫎鎴愬姛" + } else { + resp.Success = false + resp.Status = http.StatusInternalServerError + resp.Data = "鍒犻櫎澶辫触" + } + u.Data["json"] = resp + u.ServeJSON() +} + -- Gitblit v1.8.0