Merge remote-tracking branch 'origin/tuoyun' into tuoyun

pull/168/head
skiffer-git 3 years ago
commit 7b6ef76d54

@ -31,7 +31,7 @@ func Init(rpcPort int) {
}
func init() {
producer = kafka.NewKafkaProducer(config.Config.Kafka.Ws2mschat.Addr, config.Config.Kafka.Ws2mschat.Topic)
statistics.NewStatistics(&count, config.Config.ModuleName.PushName, fmt.Sprintf("%d second push to msg_gateway count", count), 10)
statistics.NewStatistics(&count, config.Config.ModuleName.PushName, fmt.Sprintf("%d second push to msg_gateway count", 10), 10)
}
func Run() {

@ -26,7 +26,7 @@ func GetFriendRelationshipFromFriend(OwnerUserID, FriendUserID string) (*db.Frie
return nil, err
}
var friend db.Friend
err = dbConn.Table("friends").Where("owner_user_id=? and friend_user_id=?", OwnerUserID, FriendUserID).Find(&friend).Error
err = dbConn.Table("friends").Where("owner_user_id=? and friend_user_id=?", OwnerUserID, FriendUserID).Take(&friend).Error
if err != nil {
return nil, err
}

@ -53,7 +53,7 @@ func GetFriendApplicationByBothUserID(FromUserID, ToUserID string) (*db.FriendRe
return nil, err
}
var friendRequest db.FriendRequest
err = dbConn.Table("friend_requests").Where("from_user_id=? and to_user_id=?", FromUserID, ToUserID).Find(&friendRequest).Error
err = dbConn.Table("friend_requests").Where("from_user_id=? and to_user_id=?", FromUserID, ToUserID).Take(&friendRequest).Error
if err != nil {
return nil, err
}

@ -78,7 +78,7 @@ func GetUserByUserID(userID string) (*db.User, error) {
return nil, err
}
var user db.User
err = dbConn.Table("users").Where("user_id=?", userID).First(&user).Error
err = dbConn.Table("users").Where("user_id=?", userID).Take(&user).Error
if err != nil {
return nil, err
}

Loading…
Cancel
Save