db

package
v0.0.0-...-8f4e997 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func Init

func Init()

func PostMsg

func PostMsg(ctx context.Context, myID int64, toID int64, content *string) (err error)

Types

type Message

type Message struct {
	gorm.Model
	ID          int64     `gorm:"column:id;primary_key;AUTO_INCREMENT"`
	MessageTime time.Time `gorm:"column:message_time;default:CURRENT_TIMESTAMP;NOT NULL"`
	FromUserID  int64     `gorm:"column:from_user_id;NOT NULL"`
	ToUserID    int64     `gorm:"column:to_user_id;NOT NULL"`
	Content     string    `gorm:"column:content;NOT NULL"`
	CreatedAt   time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP;NOT NULL"`
}

func GetMsg

func GetMsg(ctx context.Context, myID int64, toID int64, t *int64) (res []*Message, err error)

Jump to

Keyboard shortcuts

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