| | |
| | | // @router /myPlateNos [get] |
| | | 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 nos = make([]string, 0) |
| | | if err == nil && all != nil { |
| | | for _,p := range all { |
| | |
| | | plateNo := u.GetString("plateNo") |
| | | resp := code.Code{} |
| | | var uc models.UserCar |
| | | if i,e := uc.Delete(userId, plateNo);e ==nil && i >0 { |
| | | i,e := uc.Delete(userId, plateNo) |
| | | fmt.Println("delPlateNo i:",i, "e:", e) |
| | | if e ==nil && i >0 { |
| | | resp.Success = true |
| | | resp.Status = http.StatusOK |
| | | resp.Data = "删除成功" |