| | |
| | | cod := u.GetString("code") |
| | | cid := u.GetString("cid") //unipush clientid |
| | | resp := code.Code{} |
| | | fmt.Println("phoneNum:", phoneNum, "code:", cod) |
| | | fmt.Println("phoneNum:", phoneNum, "code:", cod, "clientId:", cid) |
| | | if phoneNum == "" || cod == ""{ |
| | | resp.Success= false |
| | | resp.Status= http.StatusBadRequest |
| | |
| | | // @Success 200 {string} logout success |
| | | // @router /logout [get] |
| | | func (u *UserController) Logout() { |
| | | cid := u.GetString("cid") //unipush clientid |
| | | fmt.Println("clientId:", cid) |
| | | |
| | | if cid != "" { |
| | | go func() { |
| | | unbindB, unE := service.UnbindAlias(cid) |
| | | fmt.Println("unbind result:", unbindB, "err:", unE) |
| | | var uc models.UserClient |
| | | uc.DeleteByCid(cid) |
| | | }() |
| | | } |
| | | resp := code.Code{} |
| | | resp.Success = true |
| | | resp.Status = http.StatusOK |
| | |
| | | } |
| | | |
| | | |
| | | // @router /sync [get] |
| | | func (u *UserController) Sync() { |
| | | resp := code.Code{} |
| | | syncCount := service.SyncHikPerson() |
| | | |
| | | resp.Success = true |
| | | resp.Status = http.StatusOK |
| | | resp.Data = map[string]interface{}{ |
| | | "syncCount": syncCount, |
| | | } |
| | | |
| | | u.Data["json"] = resp |
| | | u.ServeJSON() |
| | | } |