MCPcopy Create free account
hub / github.com/TalkingData/owl / getUserProfile

Method getUserProfile

api/mysql.go:747–761  ·  view source on GitHub ↗

get user profile

(username string)

Source from the content-addressed store, hash-verified

745
746// get user profile
747func (d *db) getUserProfile(username string) *User {
748 user := &User{}
749 rawSQL := fmt.Sprintf("select id, username, password, display_name, phone, wechat, type, mail, role, "+
750 "DATE_FORMAT(create_at,'%s') as create_at, DATE_FORMAT(update_at,'%s') "+
751 "as update_at from user where username='%s'",
752 timeFormat, timeFormat, username)
753 log.Println(rawSQL)
754 if err := d.Get(user, rawSQL); err != nil {
755 if err != sql.ErrNoRows {
756 log.Println(err)
757 }
758 return nil
759 }
760 return user
761}
762
763// 创建用户
764func (d *db) createUser(user *User) (*User, error) {

Callers 13

strategyListFunction · 0.80
strategyCreateFunction · 0.80
getUserProfileFunction · 0.80
createUserFunction · 0.80
resetUserPasswordFunction · 0.80
updateUserProfileFunction · 0.80
changeUserPasswordFunction · 0.80
LoginFunction · 0.80
AuthMySQLFunction · 0.80
verifyAdminPermissionFunction · 0.80
verifyAndInjectProductIDFunction · 0.80
listUserProductsFunction · 0.80

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected