mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-03 18:22:57 +00:00
23 lines
803 B
Go
23 lines
803 B
Go
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" }
|