model

package
v0.0.0-...-e90a31b Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 6 Imported by: 0

README

Models

数据模型层

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB   *gorm.DB
	Once sync.Once
)

Functions

func GetDB

func GetDB() *gorm.DB

GetDB get a db instance

func Init

func Init() *gorm.DB

Init init db

Types

type UserFollowerModel

type UserFollowerModel struct {
	ID          int64     `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"-"`
	UserID      int64     `gorm:"column:user_id" json:"user_id"`
	FollowerUID int64     `gorm:"column:follower_uid" json:"follower_uid"`
	Status      int       `gorm:"column:status" json:"status"`
	CreatedAt   time.Time `gorm:"column:created_at" json:"-"`
	UpdatedAt   time.Time `gorm:"column:updated_at" json:"-"`
}

UserFollowerModel 粉丝表

func (*UserFollowerModel) TableName

func (u *UserFollowerModel) TableName() string

TableName sets the insert table name for this struct type

type UserFollowingModel

type UserFollowingModel struct {
	ID          int64     `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"-"`
	UserID      int64     `gorm:"column:user_id" json:"user_id"`
	FollowedUID int64     `gorm:"column:followed_uid" json:"followed_uid"`
	Status      int       `gorm:"column:status" json:"status"`
	CreatedAt   time.Time `gorm:"column:created_at" json:"-"`
	UpdatedAt   time.Time `gorm:"column:updated_at" json:"-"`
}

UserFollowingModel 关注表

func (*UserFollowingModel) TableName

func (u *UserFollowingModel) TableName() string

TableName sets the insert table name for this struct type

Jump to

Keyboard shortcuts

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