(c *candy.CandyClient, reader *bufio.Reader)
| 98 | } |
| 99 | |
| 100 | func updateUserInfo(c *candy.CandyClient, reader *bufio.Reader) { |
| 101 | fmt.Println("----------------更新用户信息-------------------") |
| 102 | defer endSection() |
| 103 | |
| 104 | fmt.Println("请输入用户名:") |
| 105 | data, _, _ := reader.ReadLine() |
| 106 | userName := string(data) |
| 107 | fmt.Println("请输入用户昵称:") |
| 108 | data, _, _ = reader.ReadLine() |
| 109 | nickName := string(data) |
| 110 | |
| 111 | id, err := c.UpdateUserInfo(userName, nickName, nil) |
| 112 | if err != nil { |
| 113 | e := candy.ErrorParse(err.Error()) |
| 114 | log.Errorf("updateUserInfo code:%v error:%v", e.Code, e.Msg) |
| 115 | return |
| 116 | } |
| 117 | |
| 118 | log.Debugf("updateUserInfo success, userName:%v nickName:%v userID:%v", userName, nickName, id) |
| 119 | } |
| 120 | |
| 121 | func getUserInfoByName(c *candy.CandyClient, reader *bufio.Reader) { |
| 122 | fmt.Println("----------------获取用户信息-------------------") |
no test coverage detected