Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageService ¶
type MessageService struct {
InboxService *inbox.InboxService
ChatService *chat.ChatService
// contains filtered or unexported fields
}
func NewMessageService ¶
func NewMessageService(ctx *context.ERPContext) *MessageService
NewMessageService creates a new instance of MessageService with the given database connection and context.
It initializes the InboxService and ChatService and calls the Migrate method of the MessageService to create the necessary database schema.
func (*MessageService) Migrate ¶
func (cs *MessageService) Migrate() error
Migrate migrates the database schema for the MessageService.
If the SkipMigration flag is set to true in the context, this method will not perform any migration and will return nil. Otherwise, it will attempt to auto-migrate the database to include the InboxModel, InboxMessageModel, ChatChannelModel, and ChatMessageModel schemas. If the migration process encounters an error, it will return that error. Otherwise, it will return nil upon successful migration.