You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/internal/common/check/conversation.go

36 lines
1.0 KiB

package check
import (
2 years ago
"OpenIM/pkg/common/config"
discoveryRegistry "OpenIM/pkg/discoveryregistry"
"OpenIM/pkg/proto/conversation"
pbConversation "OpenIM/pkg/proto/conversation"
"context"
"google.golang.org/grpc"
)
type ConversationChecker struct {
zk discoveryRegistry.SvcDiscoveryRegistry
}
func NewConversationChecker(zk discoveryRegistry.SvcDiscoveryRegistry) *ConversationChecker {
return &ConversationChecker{zk: zk}
}
2 years ago
func (c *ConversationChecker) ModifyConversationField(ctx context.Context, req *pbConversation.ModifyConversationFieldReq) error {
cc, err := c.getConn()
if err != nil {
2 years ago
return err
}
2 years ago
_, err = conversation.NewConversationClient(cc).ModifyConversationField(ctx, req)
return err
}
func (c *ConversationChecker) getConn() (*grpc.ClientConn, error) {
return c.zk.GetConn(config.Config.RpcRegisterName.OpenImConversationName)
}
func (c *ConversationChecker) GetSingleConversationRecvMsgOpt(ctx context.Context, userID, conversationID string) (int32, error) {
2 years ago
panic("implement me")
}