spark-server/internal/module/friend/entity/report.go
2026-09-18 14:50:41 +08:00

34 lines
633 B
Go

package entity
import "time"
const (
ReportSpam ReportReason = 1
ReportHarassment ReportReason = 2
ReportFake ReportReason = 3
ReportOther ReportReason = 4
)
// ReportReason is persisted as friend_reports.reason.
type ReportReason int
func (r ReportReason) Valid() bool {
return r >= ReportSpam && r <= ReportOther
}
const ReportDetailMax = 512
// Report is a complaint about TargetID by UserID.
type Report struct {
ID int64
UserID int64
TargetID int64
Reason ReportReason
Detail string
CreatedAt time.Time
}
func ValidReportReason(r int) bool {
return ReportReason(r).Valid()
}