service.go 601 B

1234567891011121314151617181920212223242526272829
  1. package service
  2. import (
  3. "context"
  4. "slowwildws/internal/service/conversation"
  5. "slowwildws/internal/types"
  6. msgChat "git.banshen.xyz/huangguangrong/slow_wild_queue/types"
  7. )
  8. type MessageService interface {
  9. ChatHandler(msg *types.Message, uid int64) (*msgChat.MsgChatTransfer, error)
  10. }
  11. type SlowWildService struct {
  12. }
  13. func NewSlowWildService() *SlowWildService {
  14. return &SlowWildService{}
  15. }
  16. func (s SlowWildService) GetMethodHandler(method string, ctx context.Context) MessageService {
  17. switch method {
  18. case "chat":
  19. return conversation.NewConversationLogic(ctx)
  20. default:
  21. return nil
  22. }
  23. }