♻️ User dealer's BaseModel
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"gorm.io/datatypes"
|
||||
"time"
|
||||
|
||||
"git.solsynth.dev/hydrogen/dealer/pkg/hyper"
|
||||
"gorm.io/datatypes"
|
||||
)
|
||||
|
||||
type AttachmentDst = int8
|
||||
@ -13,7 +15,7 @@ const (
|
||||
)
|
||||
|
||||
type Attachment struct {
|
||||
BaseModel
|
||||
hyper.BaseModel
|
||||
|
||||
// Random ID is for accessing (appear in URL)
|
||||
Rid string `json:"rid" gorm:"uniqueIndex"`
|
||||
|
@ -1,17 +0,0 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/datatypes"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type JSONMap = datatypes.JSONType[map[string]any]
|
||||
|
||||
type BaseModel struct {
|
||||
ID uint `json:"id" gorm:"primaryKey"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
|
||||
}
|
@ -1,9 +1,12 @@
|
||||
package models
|
||||
|
||||
import "gorm.io/datatypes"
|
||||
import (
|
||||
"git.solsynth.dev/hydrogen/dealer/pkg/hyper"
|
||||
"gorm.io/datatypes"
|
||||
)
|
||||
|
||||
type AttachmentPool struct {
|
||||
BaseModel
|
||||
hyper.BaseModel
|
||||
|
||||
Alias string `json:"alias"`
|
||||
Name string `json:"name"`
|
||||
|
@ -1,7 +1,9 @@
|
||||
package models
|
||||
|
||||
import "git.solsynth.dev/hydrogen/dealer/pkg/hyper"
|
||||
|
||||
type Sticker struct {
|
||||
BaseModel
|
||||
hyper.BaseModel
|
||||
|
||||
Alias string `json:"alias"`
|
||||
Name string `json:"name"`
|
||||
@ -14,7 +16,7 @@ type Sticker struct {
|
||||
}
|
||||
|
||||
type StickerPack struct {
|
||||
BaseModel
|
||||
hyper.BaseModel
|
||||
|
||||
Prefix string `json:"prefix"`
|
||||
Name string `json:"name"`
|
||||
|
Reference in New Issue
Block a user