add set background and icon of hub functions

This commit is contained in:
2026-05-03 19:30:22 +02:00
parent c0d4483154
commit 22e2d18810
5 changed files with 131 additions and 23 deletions
+9
View File
@@ -24,6 +24,8 @@ const (
HubChannelFile
UserAvatar
UserProfileBg
HubIcon
HubBackground
)
type DataTypePrefix string
@@ -33,11 +35,14 @@ const (
HubChannelFilePrefix DataTypePrefix = "hub/"
UserAvatarPrefix DataTypePrefix = "userAvatar/"
UserProfileBgPrefix DataTypePrefix = "userProfileBg/"
HubIconPrefix DataTypePrefix = "hubIcon/"
HubBackgroundPrefix DataTypePrefix = "hubBackground/"
)
type GetKeyOptions struct {
UserId uuid.UUID
ConnectionId uuid.UUID
HubId uuid.UUID
ChannelId uuid.UUID
MimeType string
UploadType DataType
@@ -58,6 +63,10 @@ func GetKey(opts *GetKeyOptions) string {
return string(UserAvatarPrefix) + opts.UserId.String() + key
case UserProfileBg:
return string(UserProfileBgPrefix) + opts.UserId.String() + key
case HubIcon:
return string(HubIconPrefix) + opts.HubId.String() + key
case HubBackground:
return string(HubBackgroundPrefix) + opts.HubId.String() + key
default:
return string(ConnectionFilePrefix) + opts.ConnectionId.String() + key
}