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
type CommentList ¶
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) }
Click to show internal directories.
Click to hide internal directories.