From 82a2bb6d2167840d889d1baacf616d9e30f0f308 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期二, 28 七月 2020 10:27:16 +0800 Subject: [PATCH] fix nil pot --- controllers/user.go | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/user.go b/controllers/user.go index 8bb640d..3b437a1 100644 --- a/controllers/user.go +++ b/controllers/user.go @@ -134,7 +134,7 @@ fmt.Println("MyPlateNos userId", userId) //var uc models.UserCar //all, err := uc.GetByUserId(userId) - var sv service.CarService + sv := service.NewCarService() vehicleList := sv.GetVehicleListByPerson(userId) fmt.Println("vehicleList:", vehicleList) var nos = make([]string, 0) @@ -176,7 +176,7 @@ // @router /all [get] func (u *UserController) GetUserAll() { resp := code.Code{} - var sv service.CarService + sv := service.NewCarService() personAll := sv.GetHikPersonList() if personAll != nil { resp.Success = true -- Gitblit v1.8.0