model

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	gorm.Model
	UUID           uuid.UUID `gorm:"type:uuid"`
	Users          []User
	UserGroups     []IEUserGroup
	Messages       []Message
	GroupInterests []IEGroupInterest
}

func (*Group) BeforeCreate added in v0.0.3

func (obj *Group) BeforeCreate(tx *gorm.DB) (err error)

type IEGroupInterest added in v0.0.4

type IEGroupInterest struct {
	gorm.Model
	GroupID    uint
	InterestID uint
}

type IEUserGroup added in v0.0.3

type IEUserGroup struct {
	gorm.Model
	UserID  uint
	GroupID uint
}

type IEUserInterest added in v0.0.3

type IEUserInterest struct {
	gorm.Model
	UserID     uint
	InterestID uint
}

type Interest

type Interest struct {
	gorm.Model
	UUID             uuid.UUID `gorm:"type:uuid"`
	Title            string
	Picture          string
	UserInterests    []IEUserInterest
	GroupInterests   []IEGroupInterest
	SubInterests     []Interest `gorm:"foreignkey:InterestID"`
	InterestID       *uint
	SubInterestCount uint
}

func (*Interest) BeforeCreate added in v0.0.3

func (obj *Interest) BeforeCreate(tx *gorm.DB) (err error)

type InterestDTO

type InterestDTO struct {
	UUID    string `json:"uuid,omitempty"`
	Title   string `json:"title"`
	Picture string `json:"picture"`
}

type LoginDTO

type LoginDTO struct {
	UserName string `json:"username"`
	Password string `json:"password"`
}

type Message

type Message struct {
	gorm.Model
	UUID          uuid.UUID `gorm:"type:uuid"`
	UserID        uint
	User          User
	GroupID       uint
	MessageType   MessageType
	MessageString string
}

func (*Message) BeforeCreate added in v0.0.3

func (obj *Message) BeforeCreate(tx *gorm.DB) (err error)

type MessageInDTO added in v0.1.2

type MessageInDTO struct {
	Message string `json:"message"`
}

type MessageOutDTO added in v0.1.2

type MessageOutDTO struct {
	UUID          string    `json:"uuid"`
	UserName      string    `json:"username"`
	MessageType   int       `json:"type"`
	MessageString string    `json:"messagestr"`
	CreatedAt     time.Time `json:"date"`
}

type MessageType added in v0.1.1

type MessageType int
const (
	Undefined MessageType = iota
	Text
	Image
	Video
	Other
)

type SignUpDTO added in v0.2.0

type SignUpDTO struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

type User

type User struct {
	gorm.Model
	UUID           uuid.UUID `gorm:"type:uuid"`
	UserName       string
	UserMail       string
	Password       string
	ProfilePicture string
	GroupID        *uint
	UserGroups     []IEUserGroup
	UserInterests  []IEUserInterest
	Messages       []Message
}

func (*User) BeforeCreate added in v0.0.3

func (obj *User) BeforeCreate(tx *gorm.DB) (err error)

type UserDTO

type UserDTO struct {
	UserName       string
	UserMail       string
	ProfilePicture string
}

Jump to

Keyboard shortcuts

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