Banner

This commit is contained in:
2024-03-20 20:56:07 +08:00
parent fdc252abc3
commit 1bd0807d65
9 changed files with 196 additions and 79 deletions

View File

@ -1,10 +1,11 @@
package models
import (
"github.com/samber/lo"
"github.com/spf13/viper"
"path/filepath"
"time"
"github.com/samber/lo"
"github.com/spf13/viper"
)
type Account struct {
@ -14,6 +15,7 @@ type Account struct {
Nick string `json:"nick"`
Description string `json:"description"`
Avatar string `json:"avatar"`
Banner string `json:"banner"`
Profile AccountProfile `json:"profile"`
Sessions []AuthSession `json:"sessions"`
Challenges []AuthChallenge `json:"challenges"`
@ -40,6 +42,11 @@ func (v Account) GetAvatarPath() string {
return filepath.Join(basepath, v.Avatar)
}
func (v Account) GetBannerPath() string {
basepath := viper.GetString("content")
return filepath.Join(basepath, v.Banner)
}
type AccountContactType = int8
const (