chat

package
v1.0.68 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatService

type ChatService struct {
	// contains filtered or unexported fields
}

func NewChatService

func NewChatService(db *gorm.DB, ctx *context.ERPContext) *ChatService

NewChatService creates a new instance of ChatService.

func (*ChatService) AddParticipant

func (cs *ChatService) AddParticipant(channelID string, userID, memberID *string) error

AddParticipant adds a participant to a channel.

func (*ChatService) CreateChannel

func (cs *ChatService) CreateChannel(channelModel *models.ChatChannelModel, userID, memberID *string) error

CreateChannel creates a new chat channel.

func (*ChatService) CreateMessage

func (cs *ChatService) CreateMessage(messageModel *models.ChatMessageModel) error

CreateMessage creates a new chat message.

func (*ChatService) DeleteChannel

func (cs *ChatService) DeleteChannel(channelID string, userID *string, memberID *string) error

DeleteChannel deletes a chat channel.

This function will check if the user is the creator of the channel.

func (*ChatService) DeleteMessage

func (cs *ChatService) DeleteMessage(messageID string, userID, memberID *string) error

DeleteMessage deletes a chat message.

func (*ChatService) DeleteParticipant

func (cs *ChatService) DeleteParticipant(channelID string, userID, memberID *string) error

DeleteParticipant removes a participant from a channel.

func (*ChatService) GetChannelByParticipantMemberID

func (cs *ChatService) GetChannelByParticipantMemberID(memberID string, request *http.Request, search string) (paginate.Page, error)

GetChannelByParticipantMemberID retrieves channels where a member is a participant.

func (*ChatService) GetChannelByParticipantUserID

func (cs *ChatService) GetChannelByParticipantUserID(userID string, request *http.Request, search string) (paginate.Page, error)

GetChannelByParticipantUserID retrieves channels where a user is a participant.

func (*ChatService) GetChannelDetail

func (cs *ChatService) GetChannelDetail(channelID string) (*models.ChatChannelModel, error)

GetChannelDetail retrieves detailed information of a specific channel.

func (*ChatService) GetChatMessageByChannelID

func (cs *ChatService) GetChatMessageByChannelID(channelID string, request *http.Request, search string) (paginate.Page, error)

GetChatMessageByChannelID retrieves chat messages by channel ID with pagination.

func (*ChatService) GetDetailMessage

func (cs *ChatService) GetDetailMessage(messageID string) (*models.ChatMessageModel, error)

GetDetailMessage retrieves detailed information of a specific chat message.

This function will also load the files and replies of the message.

func (*ChatService) ReadedByMember

func (cs *ChatService) ReadedByMember(channelID string, memberID string) error

ReadedByMember marks a message as read by a member.

func (*ChatService) ReadedByUser

func (cs *ChatService) ReadedByUser(channelID string, userID string) error

ReadedByUser marks a message as read by a user.

func (*ChatService) UpdateMessage

func (cs *ChatService) UpdateMessage(messageID string, messageModel *models.ChatMessageModel, userID, memberID *string) error

UpdateMessage updates an existing chat message.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL