entities

package
v0.0.0-...-7b933b0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

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

func DBOpen

func DBOpen()

DBOpen open mysql connect

Types

type User

type User struct {
	Id        uint      `gorm:"column:id;AUTO_INCREMENT;primary_key"`        // id
	Name      string    `gorm:"column:name;NOT NULL"`                        // name
	AvatarUrl string    `gorm:"column:avatar_url"`                           // avatar url
	Email     string    `gorm:"column:email;unique;NOT NULL"`                // user email
	Password  string    `gorm:"column:password;NOT NULL"`                    // user login password
	CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP"` // create time
	UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP"` // update time
}

func GetUser

func GetUser(ctx context.Context, userName string) (*User, error)

func (*User) TableName

func (m *User) TableName() string

Jump to

Keyboard shortcuts

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