entity

package
v0.0.0-...-8db7afe Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 4 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 {
	ID        string      `gorm:"type:char(36);primary_key"`
	ArticleID string      `gorm:"type:char(36);not null"`
	UserID    string      `gorm:"type:char(36);not null"`
	User      entity.User `gorm:"foreignKey:UserID"`
	Content   string      `gorm:"type:text;not null"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (*Comment) BeforeCreate

func (comment *Comment) BeforeCreate(tx *gorm.DB) (err error)

type ReqBodyCreateComment

type ReqBodyCreateComment struct {
	ArticleSlug string
	UserID      string
	Content     string `form:"content" json:"content" xml:"content" binding:"required"`
}

type ReqBodyUpdateComment

type ReqBodyUpdateComment struct {
	ID          string
	ArticleSlug string
	UserID      string
	Content     string `form:"content" json:"content" xml:"content" binding:"required"`
}

type ResBodyComment

type ResBodyComment struct {
	ID        string    `json:"id"`
	ArticleID string    `json:"article_id"`
	WriteBy   string    `json:"write_by"`
	Content   string    `json:"content"`
	UpdateAt  time.Time `json:"update_at"`
}

Jump to

Keyboard shortcuts

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