liuxiaolong
2020-07-28 2d2f913495b6e1a93f928acbd99298b33088ae0c
controllers/user.go
@@ -132,12 +132,14 @@
func (u *UserController) MyPlateNos() {
   userId := u.GetString("userId")
   fmt.Println("MyPlateNos userId", userId)
   var uc models.UserCar
   all, err := uc.GetByUserId(userId)
   fmt.Println("all:", all, "err:", err)
   //var uc models.UserCar
   //all, err := uc.GetByUserId(userId)
   var sv service.CarService
   vehicleList := sv.GetVehicleListByPerson(userId)
   fmt.Println("vehicleList:", vehicleList)
   var nos = make([]string, 0)
   if err == nil && all != nil {
      for _,p := range all {
   if vehicleList != nil {
      for _,p := range vehicleList {
         nos = append(nos, p.PlateNo)
      }
   }
@@ -171,3 +173,18 @@
   u.ServeJSON()
}
func (u *UserController) GetUserAll() {
   resp := code.Code{}
   var sv service.CarService
   personAll := sv.GetHikPersonList()
   if personAll != nil {
      resp.Success = true
      resp.Status = http.StatusOK
      resp.Data = personAll
   }
   u.Data["json"] = resp
   u.ServeJSON()
}