MCPcopy Create free account
hub / github.com/dearcode/candy / getUserInfo

Method getUserInfo

store/user.go:278–293  ·  view source on GitHub ↗
(gtype int32, userName string, userID int64)

Source from the content-addressed store, hash-verified

276}
277
278func (u *userDB) getUserInfo(gtype int32, userName string, userID int64) (*account, error) {
279 var a *account
280 var err error
281
282 //根据用户名查询
283 if gtype == 0 {
284 log.Debugf("getUserInfoByName, userName:%v", userName)
285 a, err = u.getUserInfoByName(userName)
286 } else if gtype == 1 {
287 //根据用户ID查询
288 log.Debugf("getUserInfoByID, userID:%v", userID)
289 a, err = u.getUserInfoByID(userID)
290 }
291
292 return a, err
293}
294
295func (u *userDB) getUserInfoByName(name string) (*account, error) {
296 v, err := u.db.Get([]byte(name), nil)

Callers 1

GetUserInfoMethod · 0.45

Calls 2

getUserInfoByNameMethod · 0.95
getUserInfoByIDMethod · 0.95

Tested by

no test coverage detected