Files
open-im-server/pkg/common/db/controller/chatlog.go
T

28 lines
994 B
Go
Raw Normal View History

2023-01-31 18:55:22 +08:00
package controller
import (
2023-03-16 10:46:06 +08:00
relationTb "github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
pbMsg "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/msg"
2023-01-31 18:55:22 +08:00
)
2023-02-24 11:06:49 +08:00
type ChatLogDatabase interface {
2023-03-23 19:02:20 +08:00
CreateChatLog(msg *pbMsg.MsgDataToMQ) error
2023-03-02 12:00:31 +08:00
GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypes []int32) (int64, []relationTb.ChatLogModel, error)
2023-01-31 18:55:22 +08:00
}
2023-02-24 11:06:49 +08:00
func NewChatLogDatabase(chatLogModelInterface relationTb.ChatLogModelInterface) ChatLogDatabase {
2023-03-02 12:00:31 +08:00
return &chatLogDatabase{chatLogModel: chatLogModelInterface}
2023-01-31 18:55:22 +08:00
}
2023-03-02 12:00:31 +08:00
type chatLogDatabase struct {
2023-02-24 11:06:49 +08:00
chatLogModel relationTb.ChatLogModelInterface
2023-01-31 18:55:22 +08:00
}
2023-03-23 19:02:20 +08:00
func (c *chatLogDatabase) CreateChatLog(msg *pbMsg.MsgDataToMQ) error {
2023-02-24 11:06:49 +08:00
return c.chatLogModel.Create(msg)
2023-01-31 18:55:22 +08:00
}
2023-03-02 12:00:31 +08:00
func (c *chatLogDatabase) GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypes []int32) (int64, []relationTb.ChatLogModel, error) {
return c.chatLogModel.GetChatLog(chatLog, pageNumber, showNumber, contentTypes)
2023-01-31 18:55:22 +08:00
}