This commit is contained in:
wangchuxiao 2023-06-05 19:49:21 +08:00
parent 44b622af37
commit 8278528aeb
3 changed files with 10 additions and 4 deletions

2
.gitignore vendored
View File

@ -5,7 +5,7 @@ components
out-test
.github
.idea
.exe
deploy/open_im_api
deploy/open_im_msg_gateway

View File

@ -20,7 +20,7 @@ import (
func NewUser(discov discoveryregistry.SvcDiscoveryRegistry) *User {
conn, err := discov.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImUserName)
if err != nil {
panic(err)
// panic(err)
}
log.ZInfo(context.Background(), "user rpc conn", "conn", conn)
return &User{conn: conn, discov: discov}
@ -34,7 +34,7 @@ type User struct {
func (u *User) client(ctx context.Context) (user.UserClient, error) {
conn, err := u.discov.GetConn(ctx, config.Config.RpcRegisterName.OpenImUserName)
if err != nil {
panic(err)
return nil, err
}
return user.NewUserClient(conn), nil
}

View File

@ -408,7 +408,13 @@ func (db *commonMsgDatabase) getMsgBySeqs(ctx context.Context, userID, conversat
// }
func (db *commonMsgDatabase) findMsgInfoBySeq(ctx context.Context, userID, docID string, seqs []int64) (totalMsgs []*unRelationTb.MsgInfoModel, err error) {
return db.msgDocDatabase.GetMsgBySeqIndexIn1Doc(ctx, userID, docID, seqs)
msgs, err := db.msgDocDatabase.GetMsgBySeqIndexIn1Doc(ctx, userID, docID, seqs)
for _, msg := range msgs {
if msg.IsRead {
msg.Msg.IsRead = true
}
}
return msgs, err
}
func (db *commonMsgDatabase) getMsgBySeqsRange(ctx context.Context, userID string, conversationID string, allSeqs []int64, begin, end int64) (seqMsgs []*sdkws.MsgData, err error) {