MCPcopy Index your code
hub / github.com/dearcode/candy / updateUserInfo

Function updateUserInfo

candy.go:100–119  ·  view source on GitHub ↗
(c *candy.CandyClient, reader *bufio.Reader)

Source from the content-addressed store, hash-verified

98}
99
100func 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
121func getUserInfoByName(c *candy.CandyClient, reader *bufio.Reader) {
122 fmt.Println("----------------获取用户信息-------------------")

Callers 1

mainFunction · 0.85

Calls 3

endSectionFunction · 0.85
UpdateUserInfoMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected