Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct { ID uint64 `gorm:"primaryKey" json:"id"` Content string `json:"content"` UserID uint64 `gorm:"not null" json:"userId"` PostID uint64 `gorm:"not null" json:"postId"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt gorm.DeletedAt `json:"deletedAt"` }
func (*Comment) ToReadCommentDTO ¶
func (c *Comment) ToReadCommentDTO() ReadCommentDTO
type Message ¶
type Message struct { ID uint64 `gorm:"primaryKey" json:"id"` Content string `json:"content"` UserID uint64 `gorm:"not null" json:"userId"` ChatID uint64 `gorm:"not null" json:"chatId"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt gorm.DeletedAt `json:"deletedAt"` }
func (*Message) ToReadMessageDTO ¶
func (m *Message) ToReadMessageDTO() ReadMessageDTO
type Post ¶
type Post struct { ID uint64 `gorm:"primaryKey" json:"id"` Title string `json:"title"` Content string `json:"content"` Comments []Comment `json:"comments"` UserID uint64 `gorm:"not null; index" json:"userId"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt gorm.DeletedAt `json:"deletedAt"` }
func (*Post) ToReadPostDTO ¶
func (p *Post) ToReadPostDTO() ReadPostDTO
type ReadCommentDTO ¶
type ReadMessageDTO ¶
type ReadPostDTO ¶
type ReadUserDTO ¶
type RedisRecord ¶
type User ¶
type User struct { ID uint64 `gorm:"primaryKey" json:"id"` Name string `json:"name"` Email string `gorm:"unique;not null;index" json:"email"` Posts []Post `json:"posts"` Messages []Message `json:"messages"` Comments []Comment `json:"comments"` Chats []*Chat `gorm:"many2many:participants;" json:"chats"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt gorm.DeletedAt `json:"deletedAt"` }
func (*User) ToReadUserDTO ¶
func (u *User) ToReadUserDTO() ReadUserDTO
type WriteCommentDTO ¶
type WriteCommentDTO struct { Content string `json:"content"` UserID uint64 `json:"userId"` PostID uint64 `json:"postId"` }
func (*WriteCommentDTO) ToComment ¶
func (c *WriteCommentDTO) ToComment() Comment
type WriteMessageDTO ¶
type WriteMessageDTO struct { Content string `json:"content"` UserID uint64 `json:"userId"` ChatID uint64 `json:"chatId"` }
func (*WriteMessageDTO) ToMessage ¶
func (m *WriteMessageDTO) ToMessage() Message
type WritePostDTO ¶
type WritePostDTO struct { Title string `json:"title"` Content string `json:"content"` UserID uint64 `json:"userId"` }
func (*WritePostDTO) ToPost ¶
func (p *WritePostDTO) ToPost() Post
type WriteUserDTO ¶
func (*WriteUserDTO) ToUser ¶
func (u *WriteUserDTO) ToUser() User
Click to show internal directories.
Click to hide internal directories.