dao

package
v0.0.0-...-6387268 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 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 {
	gorm.Model
	Content    string `json:"content" form:"content"`
	ArticleId  string `json:"article_id" form:"article_id"`
	CommentUid string `json:"comment_uid" form:"comment_uid"`
	ParentId   int    `json:"parent_id" form:"parent_id"`
	IsTop      int    `json:"is_top" form:"is_top"`
	Status     int    `json:"status" form:"status"`
}

Comment 留言

func (Comment) Create

func (c Comment) Create(commentUid, articleId, content string, parentId int) error

Create add a new comment record

func (Comment) Delete

func (c Comment) Delete(comment *Comment) (err error)

Delete delete comment soft

func (Comment) GetCommentByID

func (c Comment) GetCommentByID(id int64) (*Comment, error)

GetCommentByID Get one comment by primary key

func (Comment) GetComments

func (c Comment) GetComments(articleId string) (comments []*Comment, err error)

GetComments Search comment by article_id

func (Comment) UpdateComment

func (c Comment) UpdateComment(comment *Comment) (err error)

Update update comment

type User

type User struct {
	Uid       int64 `grom:"primary_key"`
	Openid    string
	Nickname  string
	Gender    int
	Avatar    string
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

User 用户表

Jump to

Keyboard shortcuts

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