From 154624a7676297ac112eed5fa05e31b99cf06cba Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 14 Feb 2022 16:04:35 +0800 Subject: [PATCH 1/3] update --- pkg/common/db/mysql_model/im_mysql_model/user_model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/db/mysql_model/im_mysql_model/user_model.go b/pkg/common/db/mysql_model/im_mysql_model/user_model.go index 5c3b226d5..2dc17d9ad 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/user_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/user_model.go @@ -77,7 +77,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 } From a7470dc28457d11674e1fddc60a09ec27c14aed0 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 14 Feb 2022 16:13:27 +0800 Subject: [PATCH 2/3] update --- pkg/common/db/mysql_model/im_mysql_model/user_model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/db/mysql_model/im_mysql_model/user_model.go b/pkg/common/db/mysql_model/im_mysql_model/user_model.go index 2dc17d9ad..5c3b226d5 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/user_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/user_model.go @@ -77,7 +77,7 @@ func GetUserByUserID(userID string) (*db.User, error) { return nil, err } var user db.User - err = dbConn.Table("users").Where("user_id=?", userID).Take(&user).Error + err = dbConn.Table("users").Where("user_id=?", userID).First(&user).Error if err != nil { return nil, err } From 5b49b105f6c9e9c56aa0bb200963d0b959d0dec4 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 14 Feb 2022 16:29:15 +0800 Subject: [PATCH 3/3] config file --- config/config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 7279e8fed..d17251ca2 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -11,7 +11,7 @@ mysql: dbMysqlAddress: [ 43.128.5.63:13306 ] dbMysqlUserName: root dbMysqlPassword: openIM - dbMysqlDatabaseName: openIMtest1 + dbMysqlDatabaseName: openIM dbTableName: eMsg dbMsgTableNum: 1 dbMaxOpenConns: 20 @@ -30,7 +30,7 @@ mongo: dbRetainChatRecords: 7 redis: - dbAddress: 43.128.5.63:16379 + dbAddress: 127.0.0.1:16379 dbMaxIdle: 128 dbMaxActive: 0 dbIdleTimeout: 120