models

package
v0.0.0-...-539c981 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	gorm.Model
	Author   User
	AuthorID uint
	Title    string
	Content  string `gorm:"type:text"`
	publish2.Version
	publish2.Schedule
	publish2.Visible
}

type AuthIdentity

type AuthIdentity struct {
	gorm.Model
	Provider          string // phone, email, wechat, github...
	UID               string
	EncryptedPassword string
	AuthInfo          AuthInfo
	UserID            string
	State             string // unconfirmed, confirmed, expired

	Password             string `gorm:"-"`
	PasswordConfirmation string `gorm:"-"`
}

type AuthInfo

type AuthInfo struct {
	PhoneVerificationCode       string
	PhoneVerificationCodeExpiry *time.Time
	PhoneConfirmedAt            *time.Time
	UnconfirmedPhone            string // only use when changing phone number

	EmailConfirmedAt *time.Time
	UnconfirmedEmail string // only use when changing email

	SignInCount uint
	SignLogs    []SignLog
}

type AvatarImageStorage

type AvatarImageStorage struct{ oss.OSS }

func (AvatarImageStorage) GetSizes

func (AvatarImageStorage) GetSizes() map[string]*media.Size

type BranchHead

type BranchHead struct {
	gorm.Model
	Name, Hash string
}

type Chart

type Chart struct {
	Total string
	Date  time.Time
}

func GetChartData

func GetChartData(table, start, end string) (res []Chart)

date format 2015-01-23

type Collection

type Collection struct {
	gorm.Model
	Name string
	l10n.LocaleCreatable
}

type MediaLibrary

type MediaLibrary struct {
	Title string
	media_library.MediaLibrary
}

type Repository

type Repository struct {
	gorm.Model
	Name, URL string
	Type      string
	Heads     []BranchHead
}

type Setting

type Setting struct {
	gorm.Model
	location.Location `location:"name:Company Address"`
	l10n.Locale
}

type SignLog

type SignLog struct {
	UserAgent string
	At        *time.Time
	IP        string
}

//////////////////////////////////////////////////////////////////////////////

type User

type User struct {
	gorm.Model
	Email    string `form:"email"`
	Password string
	Name     string `form:"name"`
	Role     string
	Avatar   AvatarImageStorage
}

func (User) AvailableLocales

func (user User) AvailableLocales() []string

func (User) DisplayName

func (user User) DisplayName() string

Jump to

Keyboard shortcuts

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