♻️ Use paperclip to store avatar and more

This commit is contained in:
2024-05-18 17:24:14 +08:00
parent ebef35a619
commit fd5bbd732f
17 changed files with 185 additions and 206 deletions

View File

@ -1,11 +1,9 @@
package models
import (
"path/filepath"
"time"
"github.com/samber/lo"
"github.com/spf13/viper"
"gorm.io/datatypes"
)
@ -47,16 +45,6 @@ func (v Account) GetPrimaryEmail() AccountContact {
return val
}
func (v Account) GetAvatarPath() string {
basepath := viper.GetString("content")
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 (