models

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 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 Applictaion

type Applictaion struct {
	BaseModel
	Name    string `gorm:"type:varchar(100);size:100;unique;not null"`
	Webhook string `gorm:"type:varchar(255);size:255;unique;not null"`
}

Applictaion is which registered in the auth server

type BaseModel

type BaseModel struct {
	ID        uint       `gorm:"primary_key" json:"id"`
	CreatedAt time.Time  `json:"create_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `gorm:"index" json:"delete_at"`
}

type DeviceAPP

type DeviceAPP struct {
	BaseModel
	DeviceID string `gorm:"column:device_id;type:varchar(255);not null;index:device_id_app_id"`
	AppID    string `gorm:"column:app_id;type:varchar(255);not null;index:device_id_app_id"`
}

type HistoryOperation

type HistoryOperation struct {
	BaseModel
	UserID        uint   `gorm:"column:user_id;not null;index:user_id"`
	OperationType string `gorm:"column:type;type:varchar(20);not null"`
}

type Migration

type Migration struct {
	BaseModel
	Name string `gorm:"type:varchar(100);size:100;not null"`
}

type RefreshToken

type RefreshToken struct {
	BaseModel
	UserID       uint   `gorm:"column:user_id;not null;index:user_id_refresh_token"`
	RefreshToken string `gorm:"type:varchar(255);size:255;not null;index:user_id_refresh_token"`
	DeviceAPPID  uint   `gorm:"column:device_app_id;not null"`
}

type Salt

type Salt struct {
	BaseModel
	UserID uint   `gorm:"column:user_id;not null;index:user_id"`
	Salt   string `gorm:"type:varchar(255);size:255;not null"`
}

type User

type User struct {
	BaseModel
	Mail          *string    `gorm:"type:varchar(255);size:60" json:"mail"`
	Name          *string    `gorm:"type:varchar(60);size:60;not null" json:"name"`
	Role          string     `gorm:"type:varchar(60);size:60" json:"-"`
	Gender        *string    `gorm:"type:varchar(10);size:10" json:"gender"`
	Password      *string    `gorm:"type:varchar(255);" json:"-"`
	Birthday      *time.Time `json:"birthday"`
	Avatar        string     `gorm:"type:varchar(255)" json:"avatar"`
	Verified      bool       `json:"-"`
	LoginType     string     `gorm:"type:varchar(10);not null;UNIQUE_INDEX:login" json:"login_type"`
	IdentifyToken string     `gorm:"type:varchar(255);not null;UNIQUE_INDEX:login" json:"-"`
}

func (*User) MarshalJSON

func (u *User) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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