1234567891011121314151617181920 |
- package dao
- import (
- "youngee_b_api/app/entity"
- )
- type PlatformKuaishouUserInfoDao struct{}
- func (d PlatformKuaishouUserInfoDao) GetUserInfo(openId string) (entity.PlatformKuaishouUserInfo, error) {
- var userInfo entity.PlatformKuaishouUserInfo
- err := Db.Model(&entity.PlatformKuaishouUserInfo{}).Select("open_id, platform_id, nick_name, head_uri, city, gender").Where("open_id = ?", openId).Find(&userInfo).Error
- if err != nil {
- userInfo.OpenID = openId
- userInfo.NickName = ""
- userInfo.HeadUri = ""
- userInfo.City = ""
- userInfo.Gender = ""
- }
- return userInfo, nil
- }
|