db

package
v0.0.0-...-816873c Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func Init

func Init()

Types

type User

type User struct {
	Id              int64
	Username        string
	Password        string
	Avatar          string `` /* 260-byte string literal not displayed */
	BackgroundImage string `` /* 263-byte string literal not displayed */
	Signature       string `gorm:"default:快留下你的个签吧~"`
	CreatedAt       time.Time
	UpdatedAt       time.Time
	DeletedAt       gorm.DeletedAt `gorm:"index"`
}

func CreateUser

func CreateUser(ctx context.Context, user *User) (*User, error)

func GetUserByID

func GetUserByID(ctx context.Context, id int64) (*User, error)

func GetUserByUsername

func GetUserByUsername(ctx context.Context, username string) (*User, error)

Jump to

Keyboard shortcuts

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