model

package
v0.0.0-...-4951786 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bind

type Bind struct {
	gorm.Model
	ID       string         `json:"id" gorm:"primary_key;type:char(26)"`  // 绑定ID
	UID      string         `gorm:"not null;column:uid;index"`            // 对应User表的ID
	Platform string         `gorm:"not null;column:platform"`             // 平台类型。定义在常量中
	OpenID   string         `gorm:"not null;column:open_id;index;unique"` // 第三方平台唯一id
	Attr     datatypes.JSON `gorm:"column:attr"`                          // 更多属性 根据OAuth方不同自行设置
}

func (*Bind) BeforeCreate

func (b *Bind) BeforeCreate(_ *gorm.DB) (err error)

type Group

type Group struct {
	stdao.Model
	Name        string `json:"name"`
	Description string `json:"description"`
}

type GroupMembership

type GroupMembership struct {
	stdao.Model
	UID string `gorm:"type:char(26);not null;column:uid" json:"uid"`
	GID string `gorm:"type:char(26);not null;column:gid" json:"gid"`
}

type GroupMembershipMetadata

type GroupMembershipMetadata struct {
	stdao.Model
	MembershipID    string `gorm:"type:char(26);not null;column:membership_id" json:"membership_id"`
	GroupMetadataID string `gorm:"type:varchar(255);not null;column:group_metadata_id" json:"group_metadata_id"`
	Key             string `gorm:"type:varchar(255);not null;column:key" json:"key"`
	Value           string `gorm:"type:varchar(255);not null;column:value" json:"value"`
	Type            string `gorm:"type:varchar(255);not null;column:type" json:"type"`
	Description     string `gorm:"type:varchar(255);not null;column:description" json:"description"`
	Order           int    `gorm:"type:int;not null;column:order" json:"order"`
}

type GroupMetadata

type GroupMetadata struct {
	stdao.Model
	GID         string `gorm:"type:char(26);not null;column:gid" json:"gid"`
	Key         string `gorm:"type:varchar(255);not null;column:key" json:"key"`
	Value       string `gorm:"type:varchar(255);not null;column:value" json:"value"`
	Type        string `gorm:"type:varchar(255);not null;column:type" json:"type"`
	Description string `gorm:"type:varchar(255);not null;column:description" json:"description"`
	Order       int    `gorm:"type:int;not null;column:order" json:"order"`
}

type User

type User struct {
	stdao.Model
	Name     string `json:"name"`
	Salt     string `gorm:"not null;column:salt"`     // 加密盐
	Password string `gorm:"not null;column:password"` // 加密密码
	Limit    int    `gorm:"column:limit"`
	Key      string `gorm:"column:key"`
	IsAdmin  bool   `gorm:"not null;column:is_admin" json:"is_admin"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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