Files
open-im-server/internal/common/check/conversation.go
T

36 lines
1.0 KiB
Go
Raw Normal View History

2023-02-14 10:57:52 +08:00
package check
import (
2023-02-23 19:15:30 +08:00
"OpenIM/pkg/common/config"
discoveryRegistry "OpenIM/pkg/discoveryregistry"
"OpenIM/pkg/proto/conversation"
pbConversation "OpenIM/pkg/proto/conversation"
2023-02-14 10:57:52 +08:00
"context"
2023-02-14 12:06:58 +08:00
"google.golang.org/grpc"
2023-02-14 10:57:52 +08:00
)
type ConversationChecker struct {
zk discoveryRegistry.SvcDiscoveryRegistry
}
2023-02-14 12:06:58 +08:00
func NewConversationChecker(zk discoveryRegistry.SvcDiscoveryRegistry) *ConversationChecker {
return &ConversationChecker{zk: zk}
}
2023-02-14 16:33:18 +08:00
func (c *ConversationChecker) ModifyConversationField(ctx context.Context, req *pbConversation.ModifyConversationFieldReq) error {
2023-02-14 12:06:58 +08:00
cc, err := c.getConn()
if err != nil {
2023-02-14 16:33:18 +08:00
return err
2023-02-14 12:06:58 +08:00
}
2023-02-14 16:33:18 +08:00
_, err = conversation.NewConversationClient(cc).ModifyConversationField(ctx, req)
return err
2023-02-14 10:57:52 +08:00
}
2023-02-14 12:06:58 +08:00
func (c *ConversationChecker) getConn() (*grpc.ClientConn, error) {
return c.zk.GetConn(config.Config.RpcRegisterName.OpenImConversationName)
}
2023-02-14 22:04:03 +08:00
func (c *ConversationChecker) GetSingleConversationRecvMsgOpt(ctx context.Context, userID, conversationID string) (int32, error) {
2023-02-20 10:10:02 +08:00
panic("implement me")
2023-02-14 22:04:03 +08:00
}