mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-04 10:42:57 +00:00
dev day #79
This commit is contained in:
@@ -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" }
|
||||
Reference in New Issue
Block a user