supports local file system object storage and use it as the default avatar provider

This commit is contained in:
MaysWind
2024-07-27 23:29:18 +08:00
parent 731b6e8bad
commit 2e04affb00
26 changed files with 858 additions and 29 deletions
+10
View File
@@ -6,6 +6,16 @@ import (
"github.com/stretchr/testify/assert"
)
func TestGetInternalAvatarUrl(t *testing.T) {
expectedValue := "https://demo.ezbookkeeping.mayswind.net/avatar/1234567890.jpg"
actualValue := GetInternalAvatarUrl(1234567890, "jpg", "https://demo.ezbookkeeping.mayswind.net/")
assert.Equal(t, expectedValue, actualValue)
expectedValue = ""
actualValue = GetInternalAvatarUrl(1234567890, "", "https://demo.ezbookkeeping.mayswind.net/")
assert.Equal(t, expectedValue, actualValue)
}
func TestGetGravatarUrl(t *testing.T) {
// Reference: https://en.gravatar.com/site/implement/hash/
expectedValue := "https://www.gravatar.com/avatar/0bc83cb571cd1c50ba6f3e8a78ef1346"