♻️ Use dealer's BaseModel
This commit is contained in:
@ -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,12 +1,14 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"time"
|
||||
|
||||
"git.solsynth.dev/hydrogen/dealer/pkg/hyper"
|
||||
"github.com/livekit/protocol/livekit"
|
||||
)
|
||||
|
||||
type Call struct {
|
||||
BaseModel
|
||||
hyper.BaseModel
|
||||
|
||||
EndedAt *time.Time `json:"ended_at"`
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
package models
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.solsynth.dev/hydrogen/dealer/pkg/hyper"
|
||||
)
|
||||
|
||||
type ChannelType = uint8
|
||||
|
||||
@ -10,7 +14,7 @@ const (
|
||||
)
|
||||
|
||||
type Channel struct {
|
||||
BaseModel
|
||||
hyper.BaseModel
|
||||
|
||||
Alias string `json:"alias"`
|
||||
Name string `json:"name"`
|
||||
@ -46,7 +50,7 @@ const (
|
||||
)
|
||||
|
||||
type ChannelMember struct {
|
||||
BaseModel
|
||||
hyper.BaseModel
|
||||
|
||||
ChannelID uint `json:"channel_id"`
|
||||
AccountID uint `json:"account_id"`
|
||||
|
@ -1,6 +1,9 @@
|
||||
package models
|
||||
|
||||
import "gorm.io/datatypes"
|
||||
import (
|
||||
"git.solsynth.dev/hydrogen/dealer/pkg/hyper"
|
||||
"gorm.io/datatypes"
|
||||
)
|
||||
|
||||
const (
|
||||
EventMessageNew = "messages.new"
|
||||
@ -10,7 +13,7 @@ const (
|
||||
)
|
||||
|
||||
type Event struct {
|
||||
BaseModel
|
||||
hyper.BaseModel
|
||||
|
||||
Uuid string `json:"uuid"`
|
||||
Body datatypes.JSONMap `json:"body"`
|
||||
|
@ -1,9 +1,11 @@
|
||||
package models
|
||||
|
||||
import "git.solsynth.dev/hydrogen/dealer/pkg/hyper"
|
||||
|
||||
// Realm profiles basically fetched from Hydrogen.Passport
|
||||
// But cache at here for better usage and database relations
|
||||
type Realm struct {
|
||||
BaseModel
|
||||
hyper.BaseModel
|
||||
|
||||
Alias string `json:"alias"`
|
||||
Name string `json:"name"`
|
||||
|
Reference in New Issue
Block a user