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

28 lines
943 B
Go
Raw Normal View History

2023-01-31 18:55:22 +08:00
package controller
import (
2023-02-23 19:15:30 +08:00
relationTb "OpenIM/pkg/common/db/table/relation"
pbMsg "OpenIM/pkg/proto/msg"
2023-01-31 18:55:22 +08:00
)
2023-02-24 11:06:49 +08:00
type ChatLogDatabase interface {
2023-01-31 18:55:22 +08:00
CreateChatLog(msg pbMsg.MsgDataToMQ) error
2023-02-16 17:08:24 +08:00
GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypeList []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 {
return &ChatLogDataBase{chatLogModel: chatLogModelInterface}
2023-01-31 18:55:22 +08:00
}
type ChatLogDataBase struct {
2023-02-24 11:06:49 +08:00
chatLogModel relationTb.ChatLogModelInterface
2023-01-31 18:55:22 +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-02-16 17:08:24 +08:00
func (c *ChatLogDataBase) GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relationTb.ChatLogModel, error) {
2023-02-24 11:06:49 +08:00
return c.chatLogModel.GetChatLog(chatLog, pageNumber, showNumber, contentTypeList)
2023-01-31 18:55:22 +08:00
}