|
|
|
@ -4,6 +4,7 @@ import (
|
|
|
|
|
chat "Open_IM/internal/rpc/msg"
|
|
|
|
|
"Open_IM/pkg/common/config"
|
|
|
|
|
"Open_IM/pkg/common/constant"
|
|
|
|
|
"Open_IM/pkg/common/db"
|
|
|
|
|
imdb "Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
|
|
|
|
rocksCache "Open_IM/pkg/common/db/rocks_cache"
|
|
|
|
|
"Open_IM/pkg/common/log"
|
|
|
|
@ -43,14 +44,15 @@ type friendServer struct {
|
|
|
|
|
|
|
|
|
|
func NewFriendServer(port int) *friendServer {
|
|
|
|
|
log.NewPrivateLog(constant.LogFileName)
|
|
|
|
|
DB := db.DB.MysqlDB.DefaultGormDB()
|
|
|
|
|
return &friendServer{
|
|
|
|
|
rpcPort: port,
|
|
|
|
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImFriendName,
|
|
|
|
|
etcdSchema: config.Config.Etcd.EtcdSchema,
|
|
|
|
|
etcdAddr: config.Config.Etcd.EtcdAddr,
|
|
|
|
|
friendModel: imdb.NewFriend(nil), // TODO
|
|
|
|
|
friendRequestModel: imdb.NewFriendRequest(nil),
|
|
|
|
|
blackModel: imdb.NewBlack(nil),
|
|
|
|
|
friendModel: imdb.NewFriend(DB),
|
|
|
|
|
friendRequestModel: imdb.NewFriendRequest(DB),
|
|
|
|
|
blackModel: imdb.NewBlack(DB),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|