diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 974d114..6e0a46e 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,12 +4,10 @@
-
+
-
-
-
-
+
+
@@ -156,7 +154,6 @@
-
@@ -181,7 +178,8 @@
-
+
+
true
diff --git a/pkg/internal/models/accounts.go b/pkg/internal/models/accounts.go
index 749d09a..65667f2 100644
--- a/pkg/internal/models/accounts.go
+++ b/pkg/internal/models/accounts.go
@@ -15,8 +15,8 @@ type Account struct {
Name string `json:"name" gorm:"uniqueIndex"`
Nick string `json:"nick"`
Description string `json:"description"`
- Avatar *uint `json:"avatar"`
- Banner *uint `json:"banner"`
+ Avatar *string `json:"avatar"`
+ Banner *string `json:"banner"`
ConfirmedAt *time.Time `json:"confirmed_at"`
SuspendedAt *time.Time `json:"suspended_at"`
PermNodes datatypes.JSONMap `json:"perm_nodes"`
@@ -38,14 +38,14 @@ type Account struct {
func (v Account) GetAvatar() *string {
if v.Avatar != nil {
- return lo.ToPtr(fmt.Sprintf("%s/%d", viper.GetString("content_endpoint"), *v.Avatar))
+ return lo.ToPtr(fmt.Sprintf("%s/%s", viper.GetString("content_endpoint"), *v.Avatar))
}
return nil
}
func (v Account) GetBanner() *string {
if v.Banner != nil {
- return lo.ToPtr(fmt.Sprintf("%s/%d", viper.GetString("content_endpoint"), *v.Banner))
+ return lo.ToPtr(fmt.Sprintf("%s/%s", viper.GetString("content_endpoint"), *v.Banner))
}
return nil
}
diff --git a/pkg/internal/server/api/avatar_api.go b/pkg/internal/server/api/avatar_api.go
index 74e1a40..91bb432 100644
--- a/pkg/internal/server/api/avatar_api.go
+++ b/pkg/internal/server/api/avatar_api.go
@@ -15,7 +15,7 @@ func setAvatar(c *fiber.Ctx) error {
user := c.Locals("user").(models.Account)
var data struct {
- AttachmentID uint `json:"attachment" validate:"required"`
+ AttachmentID string `json:"attachment" validate:"required"`
}
if err := exts.BindAndValidate(c, &data); err != nil {
@@ -40,7 +40,7 @@ func setBanner(c *fiber.Ctx) error {
user := c.Locals("user").(models.Account)
var data struct {
- AttachmentID uint `json:"attachment" validate:"required"`
+ AttachmentID string `json:"attachment" validate:"required"`
}
if err := exts.BindAndValidate(c, &data); err != nil {