articles_dtos

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 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 ArticleInput

type ArticleInput struct {
	Title   string `json:"title" binding:"required"`
	Content string `json:"content" binding:"required"`
}

type ArticleRequest

type ArticleRequest struct {
	Id                    uint `gorm:"primarykey"`
	CreatedAt             time.Time
	UpdatedAt             time.Time
	DeletedAt             gorm.DeletedAt `gorm:"index"`
	UserId                int32
	AuthorName            string
	Title                 string
	Subtitle              string
	Content               string
	Topic                 string
	Draft                 bool
	Likes                 pq.Int32Array `gorm:"type:integer[]"`
	HasConnectedUserLiked bool
}

type ArticleResponse

type ArticleResponse struct {
	Id                    uint `gorm:"primarykey"`
	CreatedAt             time.Time
	UpdatedAt             time.Time
	DeletedAt             gorm.DeletedAt `gorm:"index"`
	UserId                int32
	AuthorName            string
	Title                 string
	Subtitle              string
	Content               string
	Topic                 string
	Draft                 bool
	HasConnectedUserLiked bool
	Likes                 []RecordLike `gorm:"foreignKey:ArticleID"`
	Views                 []RecordView `gorm:"foreignKey:ArticleID"`
}

type BookmarksResponse added in v0.1.3

type BookmarksResponse struct {
	Id          uint `gorm:"primarykey"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedAt   gorm.DeletedAt `gorm:"index"`
	UserId      int32
	Title       string
	Articles    []ArticleResponse
	IsPrivate   bool
	Description string
}

type RecordLike added in v0.1.2

type RecordLike struct {
	ID        uint `gorm:"primaryKey"`
	ArticleID uint // Foreign key
	UserId    int32
	LikeTime  time.Time
}

type RecordView added in v0.1.2

type RecordView struct {
	ID        uint `gorm:"primaryKey"`
	ArticleID uint // Foreign key
	UserId    int32
	LikeTime  time.Time
}

Jump to

Keyboard shortcuts

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