models

package
v0.0.0-...-e380594 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommonTeam = iota
	InvitedBoardsTeam
	PrivateSpaceTeam
)

Variables

View Source
var AvailableColors = []Color{
	{
		CLRID: 1,
		Name:  "green",
	},
	{
		CLRID: 2,
		Name:  "yellow",
	},
	{
		CLRID: 3,
		Name:  "orange",
	},
	{
		CLRID: 4,
		Name:  "red",
	},
	{
		CLRID: 5,
		Name:  "purple",
	},
	{
		CLRID: 6,
		Name:  "darkblue",
	},
	{
		CLRID: 7,
		Name:  "blue",
	},
	{
		CLRID: 8,
		Name:  "pink",
	},
	{
		CLRID: 9,
		Name:  "darkolivegreen",
	},
	{
		CLRID: 10,
		Name:  "grey",
	},
}

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	ATID               uint   `json:"atid" gorm:"primaryKey"`
	CID                uint   `json:"cid" gorm:"not null;index"`
	AttachmentTechName string `json:"file_tech_name" gorm:"not null;index"`
	AttachmentPubName  string `json:"file_pub_name" gorm:"not null;index"`
}

func (Attachment) MarshalEasyJSON

func (v Attachment) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Attachment) MarshalJSON

func (v Attachment) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Attachment) UnmarshalEasyJSON

func (v *Attachment) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Attachment) UnmarshalJSON

func (v *Attachment) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Board

type Board struct {
	BID             uint             `json:"bid" gorm:"primaryKey"`
	TID             uint             `json:"tid" gorm:"not null;index"`
	Title           string           `json:"board_name" faker:"word" gorm:"not null;index"`
	Description     string           `json:"description" faker:"sentence"`
	AccessPath      string           `json:"access_path"`
	Users           []User           `json:"-" gorm:"many2many:users_boards;"`
	Members         []PublicUserInfo `json:"members" gorm:"-"`
	InvitedMembers  []PublicUserInfo `json:"invited_members" gorm:"-"`
	CardLists       []CardList       `json:"card_lists" gorm:"foreignKey:BID;constraint:OnDelete:CASCADE;"`
	Cards           []Card           `json:"-" gorm:"foreignKey:BID;constraint:OnDelete:CASCADE;"`
	Tags            []Tag            `json:"tags" gorm:"foreignKey:BID;constraint:OnDelete:CASCADE;"`
	AvailableColors []Color          `json:"colors" gorm:"-"`
}

func (Board) MarshalEasyJSON

func (v Board) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Board) MarshalJSON

func (v Board) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Board) UnmarshalEasyJSON

func (v *Board) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Board) UnmarshalJSON

func (v *Board) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Card

type Card struct {
	CID                uint             `json:"cid" gorm:"primaryKey"`
	BID                uint             `json:"bid" gorm:"not null;index"`
	CLID               uint             `json:"clid" gorm:"not null;index"`
	PositionOnCardList uint             `json:"pos" faker:"-"`
	Title              string           `json:"card_name" faker:"word" gorm:"not null;index"`
	Description        string           `json:"description" faker:"sentence"`
	AccessPath         string           `json:"access_path"`
	DeadlineChecked    bool             `json:"deadline_check" faker:"-"`
	Deadline           string           `json:"deadline" faker:"timestamp"`
	Comments           []Comment        `json:"comments" gorm:"foreignKey:CID;constraint:OnDelete:CASCADE;"`
	CheckLists         []CheckList      `json:"check_lists" gorm:"foreignKey:CID;constraint:OnDelete:CASCADE;"`
	Tags               []Tag            `json:"tags" faker:"-" gorm:"many2many:tags_cards;"`
	Users              []User           `json:"-" gorm:"many2many:users_cards;constraint:OnDelete:CASCADE;"`
	Assignees          []PublicUserInfo `json:"assignees" gorm:"-"`
	Attachments        []Attachment     `json:"attachments" gorm:"foreignKey:CID;constraint:OnDelete:CASCADE;"`
}

func (Card) MarshalEasyJSON

func (v Card) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Card) MarshalJSON

func (v Card) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Card) UnmarshalEasyJSON

func (v *Card) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Card) UnmarshalJSON

func (v *Card) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CardList

type CardList struct {
	CLID            uint   `json:"clid" gorm:"primaryKey"`
	BID             uint   `json:"bid" gorm:"not null;index"`
	CID             uint   `json:"cid" gorm:"foreignKey:CLID;"`
	PositionOnBoard uint   `json:"pos" faker:"-"`
	Cards           []Card `json:"cards" gorm:"foreignKey:CLID;constraint:OnDelete:CASCADE;"`
	Title           string `json:"cardList_name" faker:"word" gorm:"not null;index"`
}

func (CardList) MarshalEasyJSON

func (v CardList) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CardList) MarshalJSON

func (v CardList) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CardList) UnmarshalEasyJSON

func (v *CardList) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CardList) UnmarshalJSON

func (v *CardList) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CheckList

type CheckList struct {
	CHLID          uint            `json:"chlid" gorm:"primaryKey"`
	CID            uint            `json:"cid" gorm:"not null;index"`
	Title          string          `json:"title" faker:"word" gorm:"not null;index"`
	CheckListItems []CheckListItem `json:"check_list_items" gorm:"foreignKey:CHLID;constraint:OnDelete:CASCADE;"`
}

func (CheckList) MarshalEasyJSON

func (v CheckList) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CheckList) MarshalJSON

func (v CheckList) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CheckList) UnmarshalEasyJSON

func (v *CheckList) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CheckList) UnmarshalJSON

func (v *CheckList) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type CheckListItem

type CheckListItem struct {
	CHLIID uint   `json:"chliid" gorm:"primaryKey"`
	CHLID  uint   `json:"chlid" gorm:"not null;index"`
	Text   string `json:"text" faker:"word" gorm:"not null;index"`
	Status bool   `json:"status" gorm:"not null"`
}

func (CheckListItem) MarshalEasyJSON

func (v CheckListItem) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (CheckListItem) MarshalJSON

func (v CheckListItem) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*CheckListItem) UnmarshalEasyJSON

func (v *CheckListItem) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*CheckListItem) UnmarshalJSON

func (v *CheckListItem) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Color

type Color struct {
	CLRID uint   `json:"clrid"`
	Name  string `json:"color_name" faker:"word"`
}

func (Color) MarshalEasyJSON

func (v Color) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Color) MarshalJSON

func (v Color) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Color) UnmarshalEasyJSON

func (v *Color) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Color) UnmarshalJSON

func (v *Color) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Comment

type Comment struct {
	CMID       uint           `json:"cmid" gorm:"primaryKey"`
	CID        uint           `json:"cid" gorm:"not null;index"`
	UID        uint           `json:"uid" gorm:"not null;index"`
	Text       string         `json:"text" faker:"sentence" gorm:"not null;index"`
	Date       time.Time      `json:"-" faker:"-"`
	DateParsed string         `json:"date" faker:"-" gorm:"-"`
	User       PublicUserInfo `json:"user" gorm:"-"`
}

func (Comment) MarshalEasyJSON

func (v Comment) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Comment) MarshalJSON

func (v Comment) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Comment) UnmarshalEasyJSON

func (v *Comment) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Comment) UnmarshalJSON

func (v *Comment) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type PublicUserInfo

type PublicUserInfo struct {
	UID    uint   `json:"uid"`
	Login  string `json:"userName" faker:"username"`
	Email  string `json:"email" faker:"email"`
	Avatar string `json:"avatar"`
}

func (PublicUserInfo) MarshalEasyJSON

func (v PublicUserInfo) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (PublicUserInfo) MarshalJSON

func (v PublicUserInfo) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*PublicUserInfo) UnmarshalEasyJSON

func (v *PublicUserInfo) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*PublicUserInfo) UnmarshalJSON

func (v *PublicUserInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Tag

type Tag struct {
	TGID    uint   `json:"tgid" gorm:"primaryKey"`
	BID     uint   `json:"bid" gorm:"not null;index"`
	Title   string `json:"tag_name" faker:"word" gorm:"not null;index"`
	ColorID uint   `json:"-" gorm:"not null;index"`
	Color   Color  `json:"color" gorm:"-"`
	Cards   []Card `json:"-" faker:"-" gorm:"many2many:tags_cards;"`
}

func (Tag) MarshalEasyJSON

func (v Tag) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Tag) MarshalJSON

func (v Tag) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Tag) UnmarshalEasyJSON

func (v *Tag) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Tag) UnmarshalJSON

func (v *Tag) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Team

type Team struct {
	TID    uint    `json:"tid" gorm:"primaryKey"`
	Title  string  `json:"team_name" faker:"word" gorm:"not null;unique;index"`
	Boards []Board `json:"boards" gorm:"foreignKey:TID;constraint:OnDelete:CASCADE;"`
	Users  []User  `json:"users" gorm:"many2many:users_teams;"`
	Type   uint    `json:"team_type" faker:"-" gorm:"not null;index"`
}

func (Team) MarshalEasyJSON

func (v Team) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Team) MarshalJSON

func (v Team) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Team) UnmarshalEasyJSON

func (v *Team) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Team) UnmarshalJSON

func (v *Team) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Teams

type Teams []Team

func (Teams) MarshalEasyJSON

func (v Teams) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Teams) MarshalJSON

func (v Teams) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Teams) UnmarshalEasyJSON

func (v *Teams) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Teams) UnmarshalJSON

func (v *Teams) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type User

type User struct {
	UID            uint      `json:"uid" faker:"-" gorm:"primaryKey"`
	Login          string    `json:"login" faker:"username" gorm:"not null;unique;index"`
	Email          string    `json:"email" faker:"email" gorm:"not null;unique;index"`
	Password       string    `json:"password" faker:"password,len=10" gorm:"-"`
	OldPassword    string    `json:"old_password" faker:"password,len=10" gorm:"-"`
	HashedPassword []byte    `json:"-" faker:"-"`
	Description    string    `json:"description" faker:"sentence"`
	Avatar         string    `json:"avatar" faker:"uuid_digit"`
	Teams          []Team    `json:"teams" faker:"-" gorm:"many2many:users_teams;"`
	Boards         []Board   `json:"boards" faker:"-" gorm:"many2many:users_boards;"`
	AssignedCards  []Card    `json:"-" faker:"-" gorm:"many2many:users_cards;"`
	Comments       []Comment `json:"comments" gorm:"foreignKey:UID;constraint:OnDelete:CASCADE;"`
}

func (User) MarshalEasyJSON

func (v User) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (User) MarshalJSON

func (v User) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*User) UnmarshalEasyJSON

func (v *User) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*User) UnmarshalJSON

func (v *User) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type UserSearchInfo

type UserSearchInfo struct {
	UID    uint   `json:"uid"`
	Login  string `json:"userName"`
	Avatar string `json:"avatar"`
	Added  bool   `json:"added"`
}

func (UserSearchInfo) MarshalEasyJSON

func (v UserSearchInfo) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UserSearchInfo) MarshalJSON

func (v UserSearchInfo) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UserSearchInfo) UnmarshalEasyJSON

func (v *UserSearchInfo) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UserSearchInfo) UnmarshalJSON

func (v *UserSearchInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type UsersSearchInfo

type UsersSearchInfo []UserSearchInfo

func (UsersSearchInfo) MarshalEasyJSON

func (v UsersSearchInfo) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (UsersSearchInfo) MarshalJSON

func (v UsersSearchInfo) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*UsersSearchInfo) UnmarshalEasyJSON

func (v *UsersSearchInfo) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*UsersSearchInfo) UnmarshalJSON

func (v *UsersSearchInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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