models

package
v0.0.0-...-1efb92b Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicModel

type BasicModel struct {
	ID        string         `gorm:"primarykey" json:"id"`
	CreatedAt time.Time      `gorm:"index" json:"created_at"`
	UpdatedAt time.Time      `gorm:"index" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type Friendship

type Friendship struct {
	BasicModel        // 继承 BasicModel 结构体
	User1ID    string `gorm:"not null;index" json:"user1_id"` // 用户1在关系中的ID,非空,设定索引
	User2ID    string `gorm:"not null;index" json:"user2_id"` // 用户2在关系中的ID,非空,设定索引
}

Friendship ...

type User

type User struct {
	BasicModel        // 继承 BasicModel 结构体
	Account    string `gorm:"type:varchar(300);uniqueIndex" json:"account"` // 账号,长度300,设定唯一索引
	FullName   string `gorm:"type:varchar(300)" json:"full_name"`           // 姓名,长度300
	Nickname   string `gorm:"type:varchar(300)" json:"nickname"`            // 昵称,长度300
	Birthday   string `gorm:"type:varchar(300)" json:"birthday"`            // 生日,长度300
	Email      string `gorm:"type:varchar(300)" json:"email"`               // 邮箱,长度300
	About      string `gorm:"type:varchar(600)" json:"about"`               // 用户简介,长度600
	Password   string `gorm:"type:varchar(300)" json:"password"`            // 用户密码,长度300
	Avatar     string `gorm:"type:varchar(300)" json:"avatar"`
}

Jump to

Keyboard shortcuts

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