platform_kuaishou_user_info_dao.go 583 B

1234567891011121314151617181920
  1. package dao
  2. import (
  3. "youngee_b_api/app/entity"
  4. )
  5. type PlatformKuaishouUserInfoDao struct{}
  6. func (d PlatformKuaishouUserInfoDao) GetUserInfo(openId string) (entity.PlatformKuaishouUserInfo, error) {
  7. var userInfo entity.PlatformKuaishouUserInfo
  8. err := Db.Model(&entity.PlatformKuaishouUserInfo{}).Select("open_id, platform_id, nick_name, head_uri, city, gender").Where("open_id = ?", openId).Find(&userInfo).Error
  9. if err != nil {
  10. userInfo.OpenID = openId
  11. userInfo.NickName = ""
  12. userInfo.HeadUri = ""
  13. userInfo.City = ""
  14. userInfo.Gender = ""
  15. }
  16. return userInfo, nil
  17. }