提交 a480dfe5 编写于 作者: W wenxu12345

Refactor code

上级 453eddc0
......@@ -2,6 +2,7 @@ package im_mysql_model
import (
"Open_IM/pkg/common/db"
"Open_IM/pkg/utils"
"time"
)
......@@ -78,6 +79,12 @@ func InsertFriendApplication(friendRequest *FriendRequest) error {
if err != nil {
return err
}
if friendRequest.CreateTime.Unix() < 0 {
friendRequest.CreateTime = time.Now()
}
if friendRequest.HandleTime.Unix() < 0 {
friendRequest.HandleTime = time.Now()
}
err = dbConn.Table("friend_request").Create(friendRequest).Error
if err != nil {
return err
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册