Personal page basis

This commit is contained in:
2024-04-02 20:23:25 +08:00
parent e8aac7bb66
commit 0b436c0a1e
11 changed files with 209 additions and 4 deletions

View File

@ -17,6 +17,7 @@ type Account struct {
Avatar string `json:"avatar"`
Banner string `json:"banner"`
Profile AccountProfile `json:"profile"`
PersonalPage AccountPage `json:"personal_page"`
Sessions []AuthSession `json:"sessions"`
Challenges []AuthChallenge `json:"challenges"`
Factors []AuthFactor `json:"factors"`

View File

@ -1,6 +1,9 @@
package models
import "time"
import (
"gorm.io/datatypes"
"time"
)
type AccountProfile struct {
BaseModel
@ -11,3 +14,18 @@ type AccountProfile struct {
Birthday *time.Time `json:"birthday"`
AccountID uint `json:"account_id"`
}
type AccountPage struct {
BaseModel
Content string `json:"content"`
Script string `json:"script"`
Style string `json:"style"`
Links datatypes.JSONSlice[AccountPageLinks] `json:"links"`
AccountID uint `json:"account_id"`
}
type AccountPageLinks struct {
Label string `json:"label"`
Url string `json:"url"`
}