message.go
1.1 KB
package repository
import "opp/models"
type IMessageRepository interface {
GetUserMsgTotals(userId int64, companyId int64, msgType int, v interface{}) (err error)
UpdateUserMsgSetRead(userId int64, companyId int64, msgType int, msgId int64) (err error)
GetUserMsgs(userId, companyId int64, msgType, sourceType int, lastId int64, pageSize int) (v []*models.UserMsg, total int, err error)
}
var _ IMessageRepository = (*MessageRepository)(nil)
type MessageRepository struct{}
func (r *MessageRepository) GetUserMsgTotals(userId int64, companyId int64, msgType int, v interface{}) (err error) {
return models.GetUserMsgTotals(userId, companyId, msgType, v)
}
func (r *MessageRepository) UpdateUserMsgSetRead(userId int64, companyId int64, msgType int, msgId int64) (err error) {
return models.UpdateUserMsgSetRead(userId, companyId, msgType, msgId)
}
func (r *MessageRepository) GetUserMsgs(userId, companyId int64, msgType, sourceType int, lastId int64, pageSize int) (v []*models.UserMsg, total int, err error) {
return models.GetUserMsgs(userId, companyId, msgType, sourceType, lastId, pageSize)
}