db

package
v0.0.0-...-5713efe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func Convert

func Convert(message *Message, tempMessage *MiddleMessage) (err error)

func CreateMessage

func CreateMessage(message *Message) error

func Init

func Init()

Types

type Message

type Message struct {
	Id         int64  `json:"id"`
	ToUserId   int64  `json:"to_user_id"`
	FromUserId int64  `json:"from_user_id"`
	Content    string `json:"content"`
	CreatedAt  time.Time
	UpdatedAt  time.Time
	DeletedAt  gorm.DeletedAt `gorm:"index"`
}

func GetMessageList

func GetMessageList(ctx context.Context, tuid int64, fuid int64) ([]*Message, error)

type MessageArray

type MessageArray []*Message

func (MessageArray) Len

func (array MessageArray) Len() int

func (MessageArray) Less

func (array MessageArray) Less(i, j int) bool

func (MessageArray) Swap

func (array MessageArray) Swap(i, j int)

type MiddleMessage

type MiddleMessage struct {
	Id         int64
	ToUserId   int64
	FromUserId int64
	Content    string
	IsReadNum  []int64
	CreatedAt  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL