comment

package module
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 默认显示评论内容
	Active status = iota
	// 隐藏评论内容
	Block
)

Variables

This section is empty.

Functions

func Genid

func Genid() string

生成全局递增的id

func Handle

func Handle(s *gin.Engine)

Types

type AuthorInfo

type AuthorInfo struct {
	Name      string
	Email     string
	Device_ID string `gorm:"column:Device_ID"`
}

type Entry

type Entry struct {
	Content string
	Time    time.Time
	Ip      string
	// ReplyID 可以为空,不为空表示回复之前某条评论
	ID, ReplyID, BlogID string
	Status              status
	UserAgent           string
	// 故意在每一条评论包含作者信息,便与区分不同设备发出的评论
	// 且当作者修改信息时,历史评论的信息依然能够保持不变
	// 同时保证只使用一条SQL就能获取一篇blog的所有评论
	Author AuthorInfo `gorm:"embedded"`
}

一条评论内容

Jump to

Keyboard shortcuts

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