This commit is contained in:
Tomas Dvorak
2025-11-02 01:04:02 +01:00
parent ac886502e0
commit b9cea0cd77
153 changed files with 43713 additions and 1700 deletions
+22
View File
@@ -0,0 +1,22 @@
package models
import (
"time"
)
type Comment struct {
BaseModel
TargetType string `json:"target_type" gorm:"size:30;index:idx_target"`
TargetID string `json:"target_id" gorm:"size:128;index:idx_target"`
UserID uint `json:"user_id" gorm:"index"`
User User `json:"user" gorm:"foreignKey:UserID"`
ParentID *uint `json:"parent_id,omitempty" gorm:"index"`
Content string `json:"content" gorm:"type:text;not null"`
Status string `json:"status" gorm:"size:20;default:'visible';index"`
SpamScore float32 `json:"spam_score" gorm:"type:real;default:0"`
SpamRules string `json:"spam_rules" gorm:"type:text"`
IsEdited bool `json:"is_edited" gorm:"default:false"`
EditedAt *time.Time `json:"edited_at"`
}
func (Comment) TableName() string { return "comments" }