db

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 12 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 `gorm:"default:https://files.ozline.icu/images/avatar.jpg"`
	BackgroundImage string `gorm:"default:https://files.ozline.icu/images/BannerImg_221116.jpeg"`
	Signature       string `gorm:"default:NOT NULL BUT SEEMS NULL"`
	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, userid 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