model

package
v0.0.0-...-0583c98 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertTime

func ConvertTime(v interface{}, layout string) (t time.Time, err error)

Types

type Comment

type Comment struct {
	gorm.Model

	ChampionID string `json:"championID"`
	Version    string `json:"version"`
	Content    string `json:"content,omitempty"`
	AuthorID   uint   `gorm:"column:author_id;not null"`
	Author     *User  `json:"author,omitempty" gorm:"foreignKey:AuthorID"`
}

type Image

type Image struct {
	Full   string `json:"full" gorm:"column:full"`     // 大图文件名
	Sprite string `json:"sprite" gorm:"column:sprite"` // 小图文件名
	Group  string `json:"group" gorm:"column:group"`   // 图像所属组
	X      int    `json:"x" gorm:"column:x"`           // 图像 X 坐标
	Y      int    `json:"y" gorm:"column:y"`           // 图像 Y 坐标
	W      int    `json:"w" gorm:"column:w"`           // 图像宽度
	H      int    `json:"h" gorm:"column:h"`           // 图像高度
}

type Role

type Role uint
const (
	Criminal Role = iota
	Civilian
	Judge
)

type User

type User struct {
	gorm.Model

	UUID     uuid.UUID `json:"uuid" gorm:"index"`
	UserName string    `gorm:"column:username"`
	Password string    `gorm:"column:password"`
	Email    string    `gorm:"column:email"`
	NickName string    `gorm:"column:nickname"`
	Role     Role      `gorm:"column:role"`

	Token string `gorm:"-"` // 注册token或者登录token
}

func (*User) MarshalBinary

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

func (*User) UnmarshalBinary

func (u *User) UnmarshalBinary(bt []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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