table

package
v0.0.0-...-86911bf Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct {
	gorm.Model
	UserID   uint `gorm:"not null;"`
	User     User
	PostID   uint `gorm:"not null;"`
	Post     Post
	Content  string  `gorm:"not null;type:varchar(127);"`
	ImageUrl *string `gorm:"type:varchar(255);"`
}

func NewComment

func NewComment(e *entity.Comment) *Comment

func (*Comment) Entity

func (e *Comment) Entity() *entity.Comment

type Group

type Group struct {
	gorm.Model
	Name        string  `gorm:"not null;type:varchar(32);"`
	Description string  `gorm:"not null;type:varchar(255);"`
	IconURL     *string `gorm:"type:varchar(255);"`
	UserCount   uint    `gorm:"not null;default:0;"`
}

func NewGroup

func NewGroup(e *entity.Group) *Group

func (*Group) Entity

func (e *Group) Entity() *entity.Group

type Post

type Post struct {
	gorm.Model
	UserID       uint `gorm:"not null;"`
	User         User
	Title        string `gorm:"not null;type:varchar(64);"`
	Description  string `gorm:"not null;type:varchar(255);"`
	Location     string `gorm:"not null;type:varchar(64);"`
	CourtNumber  string `gorm:"not null;type:varchar(8);"`
	Limit        *uint
	GroupID      *uint
	Group        Group
	BeginsAt     *time.Time
	EndsAt       *time.Time
	Tags         []Tag `gorm:"many2many:post_tags;"`
	CommentCount uint
	PresentCount uint
	Status       string `gorm:"type:enum('OPEN', 'CANCELED', 'CLOSED');"`
}

func NewPost

func NewPost(e *entity.Post) *Post

func (*Post) Entity

func (e *Post) Entity() *entity.Post

type Stamp

type Stamp struct {
	UserID    uint `gorm:"primaryKey"`
	User      User
	PostID    uint   `gorm:"primaryKey"`
	Type      string `gorm:"type:enum('PRESENT', 'ABSENT');"`
	CreatedAt time.Time
}

func NewStamp

func NewStamp(e *entity.Stamp) *Stamp

func (*Stamp) Entity

func (e *Stamp) Entity() *entity.Stamp

type Tag

type Tag struct {
	gorm.Model
	UserID    uint   `gorm:"not null;"`
	Name      string `gorm:"not null;type:varchar(32);"`
	Color     string `gorm:"not null;type:varchar(10);"`
	PostCount int
}

func NewTag

func NewTag(e *entity.Tag) *Tag

func (*Tag) Entity

func (e *Tag) Entity() *entity.Tag

type User

type User struct {
	gorm.Model
	UserName   string  `gorm:"not null;type:varchar(32);"`
	Name       string  `gorm:"not null;type:varchar(32);"`
	Email      string  `gorm:"not null;type:varchar(254);"`
	Password   string  `gorm:"not null;type:varchar(127);"`
	Bio        string  `gorm:"not null;type:varchar(255);"`
	Generation int     `gorm:"not null;default:0;"`
	IconURL    *string `gorm:"type:varchar(255);"`
	PostCount  uint    `gorm:"not null;default:0;"`
}

func NewUser

func NewUser(e *entity.User) *User

func (*User) Entity

func (e *User) Entity() *entity.User

type UserGroup

type UserGroup struct {
	UserID  uint `gorm:"primaryKey"`
	GroupID uint `gorm:"primaryKey"`
	Group   Group
}

func NewUserGroup

func NewUserGroup(userID, groupID uint) *UserGroup

Jump to

Keyboard shortcuts

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