Punishment API

This commit is contained in:
2025-03-25 23:10:14 +08:00
parent 742edaa9e2
commit a5033c0fb0
5 changed files with 368 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package models
import (
"time"
"gorm.io/datatypes"
)
const (
PunishmentTypeStrike = iota
PunishmentTypeLimited
PunishmentTypeDisabled
)
type Punishment struct {
BaseModel
Reason string `json:"reason"`
Type int `json:"type"`
PermNodes datatypes.JSONMap `json:"perm_nodes"`
ExpiredAt *time.Time `json:"expired_at"`
Account Account `json:"account"`
AccountID uint `json:"account_id"`
Moderator *Account `json:"moderator"`
ModeratorID *uint `json:"moderator_id"`
}