This commit is contained in:
wangchuxiao
2023-02-09 20:36:34 +08:00
parent 8a1702fcf7
commit 759432794f
216 changed files with 2299 additions and 4059 deletions
+6 -5
View File
@@ -2,13 +2,14 @@ package controller
import (
"Open_IM/pkg/common/db/relation"
relationTb "Open_IM/pkg/common/db/table/relation"
pbMsg "Open_IM/pkg/proto/msg"
"gorm.io/gorm"
)
type ChatLogInterface interface {
CreateChatLog(msg pbMsg.MsgDataToMQ) error
GetChatLog(chatLog *relation.ChatLog, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error)
GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error)
}
func NewChatLogController(db *gorm.DB) ChatLogInterface {
@@ -23,17 +24,17 @@ func (c *ChatLogController) CreateChatLog(msg pbMsg.MsgDataToMQ) error {
return c.database.CreateChatLog(msg)
}
func (c *ChatLogController) GetChatLog(chatLog *relation.ChatLog, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error) {
func (c *ChatLogController) GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error) {
return c.database.GetChatLog(chatLog, pageNumber, showNumber, contentTypeList)
}
type ChatLogDataBaseInterface interface {
CreateChatLog(msg pbMsg.MsgDataToMQ) error
GetChatLog(chatLog *relation.ChatLog, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error)
GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error)
}
type ChatLogDataBase struct {
chatLogDB *relation.ChatLog
chatLogDB *relationTb.ChatLogModelInterface
}
func NewChatLogDataBase(db *gorm.DB) ChatLogDataBaseInterface {
@@ -44,6 +45,6 @@ func (c *ChatLogDataBase) CreateChatLog(msg pbMsg.MsgDataToMQ) error {
return c.chatLogDB.Create(msg)
}
func (c *ChatLogDataBase) GetChatLog(chatLog *relation.ChatLog, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error) {
func (c *ChatLogDataBase) GetChatLog(chatLog *relationTb.ChatLogModel, pageNumber, showNumber int32, contentTypeList []int32) (int64, []relation.ChatLog, error) {
return c.chatLogDB.GetChatLog(chatLog, pageNumber, showNumber, contentTypeList)
}