浏览代码

社媒账号信息边界条件

Ethan 3 天之前
父节点
当前提交
de364624fb
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 3 3
      app/dao/platform_kuaishou_user_info_dao.go
  2. 2 2
      app/dao/talent_info_dao.go

+ 3 - 3
app/dao/platform_kuaishou_user_info_dao.go

@@ -6,9 +6,9 @@ import (
 
 
 type PlatformKuaishouUserInfoDao struct{}
 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
+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 {
 	if err != nil {
 		userInfo.OpenID = openId
 		userInfo.OpenID = openId
 		userInfo.NickName = ""
 		userInfo.NickName = ""

+ 2 - 2
app/dao/talent_info_dao.go

@@ -9,8 +9,8 @@ import (
 type TalentInfoDao struct{}
 type TalentInfoDao struct{}
 
 
 func (d TalentInfoDao) GetTalentPhone(talentId string) (*string, error) {
 func (d TalentInfoDao) GetTalentPhone(talentId string) (*string, error) {
-	var talentInfo *entity.YoungeeTalentInfo
-	err := Db.Model(entity.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", talentId).Find(&talentInfo).Error
+	var talentInfo entity.YoungeeTalentInfo
+	err := Db.Model(&entity.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", talentId).Find(&talentInfo).Error
 	if err != nil {
 	if err != nil {
 		logrus.Errorf("[SelectTalentInfo] error query, err:%+v", err)
 		logrus.Errorf("[SelectTalentInfo] error query, err:%+v", err)
 		return nil, err
 		return nil, err