Add functionality to generate user avatars and enable users to upload and manage their profile photos
This commit is contained in:
committed by
Mumbi Francis
parent
3f3954bf9f
commit
5b3b584c8f
@@ -46,7 +46,7 @@ func fill(opt interface{}) {
|
||||
continue
|
||||
}
|
||||
|
||||
if f.Kind() == reflect.Int {
|
||||
if f.Kind() == reflect.Int || f.Kind() == reflect.Int64 {
|
||||
v.FieldByName(t.Name).SetInt(int64(EnvInt(tag, int(f.Int()))))
|
||||
continue
|
||||
}
|
||||
|
||||
Generated
+37
@@ -261,6 +261,13 @@ type (
|
||||
CortezaDomain string `env:"DISCOVERY_CORTEZA_DOMAIN"`
|
||||
BaseUrl string `env:"DISCOVERY_BASE_URL"`
|
||||
}
|
||||
|
||||
AttachmentOpt struct {
|
||||
AvatarMaxFileSize int64 `env:"ATTACHMENT_AVATAR_MAX_FILE_SIZE"`
|
||||
AvatarInitialsFontPath string `env:"AVATAR_INITIALS_FONT_PATH"`
|
||||
AvatarInitialsBackgroundColor string `env:"AVATAR_INITIALS_BACKGROUND_COLOR"`
|
||||
AvatarInitialsColor string `env:"AVATAR_INITIALS_COLOR"`
|
||||
}
|
||||
)
|
||||
|
||||
// DB initializes and returns a DBOpt with default values
|
||||
@@ -1063,3 +1070,33 @@ func Discovery() (o *DiscoveryOpt) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Attachment initializes and returns a AttachmentOpt with default values
|
||||
//
|
||||
// This function is auto-generated
|
||||
func Attachment() (o *AttachmentOpt) {
|
||||
o = &AttachmentOpt{
|
||||
AvatarMaxFileSize: 1000000,
|
||||
AvatarInitialsFontPath: "./auth/assets/public/fonts/poppins/Poppins-Regular.ttf",
|
||||
AvatarInitialsBackgroundColor: "#F3F3F3",
|
||||
AvatarInitialsColor: "#162425",
|
||||
}
|
||||
|
||||
// Custom defaults
|
||||
func(o interface{}) {
|
||||
if def, ok := o.(interface{ Defaults() }); ok {
|
||||
def.Defaults()
|
||||
}
|
||||
}(o)
|
||||
|
||||
fill(o)
|
||||
|
||||
// Custom cleanup
|
||||
func(o interface{}) {
|
||||
if def, ok := o.(interface{ Cleanup() }); ok {
|
||||
def.Cleanup()
|
||||
}
|
||||
}(o)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ type (
|
||||
Limit LimitOpt
|
||||
Discovery DiscoveryOpt
|
||||
Apigw ApigwOpt
|
||||
Attachment AttachmentOpt
|
||||
}
|
||||
)
|
||||
|
||||
@@ -59,5 +60,6 @@ func Init() *Options {
|
||||
Limit: *Limit(),
|
||||
Discovery: *Discovery(),
|
||||
Apigw: *Apigw(),
|
||||
Attachment: *Attachment(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user