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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址