comment

package
v0.0.0-...-b1757e7 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName = "comment"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCommentRequest

type AddCommentRequest struct {
	CreatedBy string `json:"created_by" gorm:"created_by"`
	Content   string `json:"content" gorm:"content"`
	BlogId    int    `json:"blog_id" gorm:"blog_id"`
}

func NewAddCommentRequest

func NewAddCommentRequest() *AddCommentRequest

func (*AddCommentRequest) Validate

func (req *AddCommentRequest) Validate() error

type Comment

type Comment struct {
	Id int64 `json:"id"`
	*AddCommentRequest
	CreatedAt int64 `json:"created_at" gorm:"created_at"`
}

func NewComment

func NewComment(req *AddCommentRequest) *Comment

func (*Comment) String

func (cmt *Comment) String() string

func (*Comment) TableName

func (cmt *Comment) TableName() string

type CommentList

type CommentList struct {
	Items []*Comment `json:"items"`
	Total int64      `json:"total"`
}

func NewCommentList

func NewCommentList() *CommentList

type GetAllCommentRequest

type GetAllCommentRequest struct {
	BlogId int `json:"blog_id" gorm:"blog_id"`
}

func NewGetAllCommentRequest

func NewGetAllCommentRequest() *GetAllCommentRequest

func (*GetAllCommentRequest) SetId

func (req *GetAllCommentRequest) SetId(BlogId string) error

type Service

type Service interface {
	AddComment(context.Context, *AddCommentRequest) (*Comment, error)
	GetAllCommentsByBlogId(context.Context, *GetAllCommentRequest) (*CommentList, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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