♻️ Move dealer to nexus

This commit is contained in:
2024-11-02 13:23:27 +08:00
parent fce8669059
commit cef4764d8c
38 changed files with 454 additions and 550 deletions

View File

@ -1,9 +0,0 @@
package models
import "git.solsynth.dev/hydrogen/dealer/pkg/hyper"
type Account struct {
hyper.BaseUser
Channels []Channel `json:"channels"`
}

View File

@ -23,7 +23,6 @@ type Channel struct {
Messages []Event `json:"messages"`
Calls []Call `json:"calls"`
Type ChannelType `json:"type"`
Account Account `json:"account"`
AccountID uint `json:"account_id"`
IsPublic bool `json:"is_public"`
IsCommunity bool `json:"is_community"`
@ -53,11 +52,13 @@ const (
type ChannelMember struct {
hyper.BaseModel
Name string `json:"name"`
Nick string `json:"nick"`
Avatar *string `json:"avatar"`
ChannelID uint `json:"channel_id"`
AccountID uint `json:"account_id"`
Nick *string `json:"nick"`
Channel Channel `json:"channel"`
Account Account `json:"account"`
Notify NotifyLevel `json:"notify"`
PowerLevel int `json:"power_level"`

View File

@ -2,7 +2,7 @@ package models
import "git.solsynth.dev/hydrogen/dealer/pkg/hyper"
// Realm profiles basically fetched from Hydrogen.Passport
// Realm profiles basically fetched from Hypernet.Passport
// But cache at here for better usage and database relations
type Realm struct {
hyper.BaseRealm

View File

@ -1,21 +0,0 @@
package models
import jsoniter "github.com/json-iterator/go"
type UnifiedCommand struct {
Action string `json:"w"`
Message string `json:"m"`
Payload any `json:"p"`
}
func UnifiedCommandFromError(err error) UnifiedCommand {
return UnifiedCommand{
Action: "error",
Message: err.Error(),
}
}
func (v UnifiedCommand) Marshal() []byte {
data, _ := jsoniter.Marshal(v)
return data
}