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/pkg/common/db/controller/chatlog.go

28 lines
994 B

2 years ago
package controller
import (
2 years ago
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
pbMsg "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msg"
2 years ago
)
2 years ago
type ChatLogDatabase interface {
2 years ago
CreateChatLog(msg *pbMsg.MsgDataToMQ) error
2 years ago
GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypes []int32) (int64, []relationTb.ChatLogModel, error)
2 years ago
}
2 years ago
func NewChatLogDatabase(chatLogModelInterface relationTb.ChatLogModelInterface) ChatLogDatabase {
2 years ago
return &chatLogDatabase{chatLogModel: chatLogModelInterface}
2 years ago
}
2 years ago
type chatLogDatabase struct {
2 years ago
chatLogModel relationTb.ChatLogModelInterface
2 years ago
}
2 years ago
func (c *chatLogDatabase) CreateChatLog(msg *pbMsg.MsgDataToMQ) error {
2 years ago
return c.chatLogModel.Create(msg)
2 years ago
}
2 years ago
func (c *chatLogDatabase) GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypes []int32) (int64, []relationTb.ChatLogModel, error) {
return c.chatLogModel.GetChatLog(chatLog, pageNumber, showNumber, contentTypes)
2 years ago
}