mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 03:58:55 +08:00
Refactor code
This commit is contained in:
parent
c312f079fb
commit
2fcd21ae94
@ -2,6 +2,7 @@ package im_mysql_model
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"Open_IM/pkg/common/db"
|
"Open_IM/pkg/common/db"
|
||||||
|
"Open_IM/pkg/utils"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -82,7 +83,7 @@ func InsertFriendApplication(friendRequest *FriendRequest) error {
|
|||||||
friendRequest.CreateTime = time.Now()
|
friendRequest.CreateTime = time.Now()
|
||||||
}
|
}
|
||||||
if friendRequest.HandleTime.Unix() < 0 {
|
if friendRequest.HandleTime.Unix() < 0 {
|
||||||
friendRequest.HandleTime = time.Now()
|
friendRequest.HandleTime = utils.UnixSecondToTime(0)
|
||||||
}
|
}
|
||||||
err = dbConn.Table("friend_request").Create(friendRequest).Error
|
err = dbConn.Table("friend_request").Create(friendRequest).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user