model

package
v0.2.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const TableNameSecretM = "uc_secret"
View Source
const TableNameUserM = "uc_user"

Variables

This section is empty.

Functions

This section is empty.

Types

type SecretM

type SecretM struct {
	ID          int64     `gorm:"column:id;type:bigint(20) unsigned;primaryKey;autoIncrement:true;comment:主键 ID" json:"id"`                        // 主键 ID
	UserID      string    `gorm:"column:user_id;type:varchar(253);not null;index:idx_user_id,priority:1;comment:用户 ID" json:"user_id"`             // 用户 ID
	Name        string    `gorm:"column:name;type:varchar(253);not null;comment:密钥名称" json:"name"`                                                 // 密钥名称
	SecretID    string    `gorm:"column:secret_id;type:varchar(36);not null;uniqueIndex:uniq_secret_id,priority:1;comment:密钥 ID" json:"secret_id"` // 密钥 ID
	SecretKey   string    `gorm:"column:secret_key;type:varchar(36);not null;comment:密钥 Key" json:"secret_key"`                                    // 密钥 Key
	Status      int32     `gorm:"column:status;type:tinyint(3) unsigned;not null;default:1;comment:密钥状态,0-禁用;1-启用" json:"status"`                  // 密钥状态,0-禁用;1-启用
	Expires     int64     `gorm:"column:expires;type:bigint(64);not null;comment:0 永不过期" json:"expires"`                                           // 0 永不过期
	Description string    `gorm:"column:description;type:varchar(255);not null;comment:密钥描述" json:"description"`                                   // 密钥描述
	CreatedAt   time.Time `gorm:"column:created_at;type:datetime;not null;default:current_timestamp();comment:创建时间" json:"created_at"`             // 创建时间
	UpdatedAt   time.Time `gorm:"column:updated_at;type:datetime;not null;default:current_timestamp();comment:最后修改时间" json:"updated_at"`           // 最后修改时间
}

SecretM mapped from table <uc_secret>

func (*SecretM) TableName

func (*SecretM) TableName() string

TableName SecretM's table name

type UserM

type UserM struct {
	ID        int64     `gorm:"column:id;type:bigint(20) unsigned;primaryKey;autoIncrement:true;comment:主键 ID" json:"id"`                    // 主键 ID
	UserID    string    `gorm:"column:user_id;type:varchar(253);not null;uniqueIndex:idx_user_id,priority:1;comment:用户 ID" json:"user_id"`   // 用户 ID
	Username  string    `gorm:"column:username;type:varchar(253);not null;uniqueIndex:idx_username,priority:1;comment:用户名称" json:"username"` // 用户名称
	Status    *string   `gorm:"column:status;type:varchar(64)" json:"status"`
	Nickname  string    `gorm:"column:nickname;type:varchar(253);not null;comment:用户昵称" json:"nickname"`                               // 用户昵称
	Password  string    `gorm:"column:password;type:varchar(64);not null;comment:用户加密后的密码" json:"password"`                            // 用户加密后的密码
	Email     string    `gorm:"column:email;type:varchar(253);not null;comment:用户电子邮箱" json:"email"`                                   // 用户电子邮箱
	Phone     string    `gorm:"column:phone;type:varchar(16);not null;comment:用户手机号" json:"phone"`                                     // 用户手机号
	CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null;default:current_timestamp();comment:创建时间" json:"created_at"`   // 创建时间
	UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null;default:current_timestamp();comment:最后修改时间" json:"updated_at"` // 最后修改时间
}

UserM mapped from table <uc_user>

func (*UserM) TableName

func (*UserM) TableName() string

TableName UserM's table name

Jump to

Keyboard shortcuts

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