models

package
v0.0.0-...-f1e4607 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientProfile

type ClientProfile struct {
	ID           uuid.UUID `json:"profile_id" gorm:"primary_key;type:uuid;"`
	DisplayName  string    `json:"display_name"`
	RoleName     string    `json:"role_name"`
	AccessToken  string    `json:"access_token"`
	RefreshToken string    `json:"refresh_token"`
	ExpiresIn    int64     `json:"expires_in"`
	ExpiresAt    time.Time `json:"expires_at"`
	TokenType    string    `json:"token_type"`
	Domain       string    `json:"domain"`
	LoginedBy    string    `json:"logined_by"`
}

type Model

type Model struct {
	ID        uuid.UUID `gorm:"primary_key;type:uuid;default:uuid_generate_v4()"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `json:"-" sql:"index"`
}

type Online

type Online struct {
	Model
	Type   types.OnlineType
	Online bool
}

type Role

type Role struct {
	Model
	Name        string `validate:"required" gorm:"unique"`
	DisplayName string `validate:"required" gorm:"unique"`
	OwnerType   string
	Description string
}

type StatusLog

type StatusLog struct {
	Model
	OwnerID     uuid.UUID `validate:"required" gorm:"type:uuid;not null"`
	OwnerType   string    `json:"-"`
	CompositeID uuid.UUID
	Status      string `validate:"required" type:"not null;"`
	// Reference is plain text
	Reference string
	RoleName  string
	Email     string
	Name      string
	// Remark is cipher text written by admin
	Remark     string
	OperatorID uuid.UUID `gorm:"type:uuid"`
}

func (*StatusLog) ConvertToLatest

func (s *StatusLog) ConvertToLatest() views.LatestStatusLog

Jump to

Keyboard shortcuts

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