model

package
v0.0.0-...-48d44df Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameRelation = "relations"
View Source
const TableNameUser = "users"

Variables

This section is empty.

Functions

This section is empty.

Types

type Relation

type Relation struct {
	ID         int64          `gorm:"column:id;primaryKey" json:"id"`        // 主键ID
	ToUserID   int64          `gorm:"column:to_user_id" json:"to_user_id"`   // 被关注用户ID
	FollowerID int64          `gorm:"column:follower_id" json:"follower_id"` // 关注用户ID
	CreatedAt  time.Time      `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt  time.Time      `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
	DeletedAt  gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
}

Relation mapped from table <relations>

func (*Relation) TableName

func (*Relation) TableName() string

TableName Relation's table name

type User

type User struct {
	ID            int64          `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` // 主键ID
	Username      string         `gorm:"column:username" json:"username"`                   // 用户名
	Password      string         `gorm:"column:password" json:"password"`                   // 密码
	FollowCount   int64          `gorm:"column:follow_count" json:"follow_count"`           // 关注总数
	FollowerCount int64          `gorm:"column:follower_count" json:"follower_count"`       // 粉丝总数
	CreatedAt     time.Time      `gorm:"column:created_at;default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt     time.Time      `gorm:"column:updated_at;default:CURRENT_TIMESTAMP" json:"updated_at"`
	DeletedAt     gorm.DeletedAt `gorm:"column:deleted_at" json:"deleted_at"`
}

User mapped from table <users>

func (*User) TableName

func (*User) TableName() string

TableName User's table name

Jump to

Keyboard shortcuts

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