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.
28 lines
934 B
28 lines
934 B
package controller
|
|
|
|
import (
|
|
relationTb "OpenIM/pkg/common/db/table/relation"
|
|
pbMsg "OpenIM/pkg/proto/msg"
|
|
)
|
|
|
|
type ChatLogDatabase interface {
|
|
CreateChatLog(msg pbMsg.MsgDataToMQ) error
|
|
GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypes []int32) (int64, []relationTb.ChatLogModel, error)
|
|
}
|
|
|
|
func NewChatLogDatabase(chatLogModelInterface relationTb.ChatLogModelInterface) ChatLogDatabase {
|
|
return &chatLogDatabase{chatLogModel: chatLogModelInterface}
|
|
}
|
|
|
|
type chatLogDatabase struct {
|
|
chatLogModel relationTb.ChatLogModelInterface
|
|
}
|
|
|
|
func (c *chatLogDatabase) CreateChatLog(msg pbMsg.MsgDataToMQ) error {
|
|
return c.chatLogModel.Create(msg)
|
|
}
|
|
|
|
func (c *chatLogDatabase) GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypes []int32) (int64, []relationTb.ChatLogModel, error) {
|
|
return c.chatLogModel.GetChatLog(chatLog, pageNumber, showNumber, contentTypes)
|
|
}
|