♻️ Refactored remain modules and make it up and running

This commit is contained in:
2024-11-02 13:40:37 +08:00
parent 06031620b7
commit 2d05be679d
23 changed files with 82 additions and 271 deletions

View File

@ -1,14 +1,13 @@
package models
import (
"time"
"git.solsynth.dev/hydrogen/dealer/pkg/hyper"
"git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
"github.com/livekit/protocol/livekit"
"time"
)
type Call struct {
hyper.BaseModel
cruda.BaseModel
EndedAt *time.Time `json:"ended_at"`

View File

@ -2,8 +2,8 @@ package models
import (
"fmt"
"git.solsynth.dev/hydrogen/dealer/pkg/hyper"
"git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
authm "git.solsynth.dev/hypernet/passport/pkg/authkit/models"
)
type ChannelType = uint8
@ -14,7 +14,7 @@ const (
)
type Channel struct {
hyper.BaseModel
cruda.BaseModel
Alias string `json:"alias"`
Name string `json:"name"`
@ -27,8 +27,8 @@ type Channel struct {
IsPublic bool `json:"is_public"`
IsCommunity bool `json:"is_community"`
Realm Realm `json:"realm"`
RealmID *uint `json:"realm_id"`
Realm *authm.Realm `json:"realm" gorm:"-"`
RealmID *uint `json:"realm_id"`
}
func (v Channel) DisplayText() string {
@ -50,7 +50,7 @@ const (
)
type ChannelMember struct {
hyper.BaseModel
cruda.BaseModel
Name string `json:"name"`
Nick string `json:"nick"`

View File

@ -1,7 +1,7 @@
package models
import (
"git.solsynth.dev/hydrogen/dealer/pkg/hyper"
"git.solsynth.dev/hypernet/nexus/pkg/nex/cruda"
"gorm.io/datatypes"
)
@ -13,7 +13,7 @@ const (
)
type Event struct {
hyper.BaseModel
cruda.BaseModel
Uuid string `json:"uuid"`
Body datatypes.JSONMap `json:"body"`

View File

@ -1,11 +0,0 @@
package models
import "git.solsynth.dev/hydrogen/dealer/pkg/hyper"
// Realm profiles basically fetched from Hypernet.Passport
// But cache at here for better usage and database relations
type Realm struct {
hyper.BaseRealm
Channels []Channel `json:"channels"`
}