mirror of
https://github.com/tgdrive/teldrive.git
synced 2026-01-17 14:28:44 +08:00
23 lines
707 B
Go
23 lines
707 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/datatypes"
|
|
)
|
|
|
|
type Event struct {
|
|
ID string `gorm:"type:uuid;primaryKey;default:gen_random_uuid()()"`
|
|
Type string `gorm:"type:text;not null"`
|
|
UserID int64 `gorm:"type:bigint"`
|
|
Source datatypes.JSONType[*Source] `gorm:"type:jsonb"`
|
|
CreatedAt time.Time `gorm:"default:timezone('utc'::text, now())"`
|
|
}
|
|
|
|
type Source struct {
|
|
ID string `json:"id,omitempty"`
|
|
Type string `json:"type,omitempty"`
|
|
Name string `json:"name,omitempty"`
|
|
ParentID string `json:"parentId,omitempty"`
|
|
DestParentID string `json:"destParentId,omitempty"`
|
|
}
|