feat(db/userstore): add avatar, email, bgColor to user profile

This commit is contained in:
hexxa 2022-03-20 17:16:39 +08:00 committed by Hexxa
parent 5f31cfc867
commit 817ced61de
14 changed files with 69 additions and 110 deletions

View file

@ -128,6 +128,7 @@ func DefaultConfigStruct() *Config {
Repeat: "repeat",
Position: "fixed",
Align: "center",
BgColor: "#ccc",
},
},
},

View file

@ -119,6 +119,7 @@ func TestLoadCfg(t *testing.T) {
Repeat: "1",
Position: "1",
Align: "1",
BgColor: "1",
},
},
},
@ -184,6 +185,7 @@ func TestLoadCfg(t *testing.T) {
Repeat: "4",
Position: "4",
Align: "4",
BgColor: "4",
},
},
},
@ -249,6 +251,7 @@ func TestLoadCfg(t *testing.T) {
Repeat: "4",
Position: "4",
Align: "4",
BgColor: "4",
},
},
},
@ -314,6 +317,7 @@ func TestLoadCfg(t *testing.T) {
Repeat: "no-repeat",
Position: "top",
Align: "scroll",
BgColor: "", // the schema of the config from db is old
},
},
},
@ -349,7 +353,7 @@ func TestLoadCfg(t *testing.T) {
}
if !Equal(gotCfg, expectCfg) {
t.Fatal("cfgs are not identical")
t.Fatalf("%d, cfgs are not identical", i)
}
}
}

View file

@ -170,6 +170,7 @@ func initDeps(cfg gocfg.ICfg) *depidx.Deps {
Repeat: cfg.StringOr("Site.ClientCfg.Bg.Repeat", "repeat"),
Position: cfg.StringOr("Site.ClientCfg.Bg.Position", "fixed"),
Align: cfg.StringOr("Site.ClientCfg.Bg.Align", "center"),
BgColor: cfg.StringOr("Site.ClientCfg.Bg.BgColor", "#ccc"),
},
},
})

View file

@ -79,10 +79,11 @@ func TestSettingsHandlers(t *testing.T) {
SiteName: "quickshare",
SiteDesc: "quickshare",
Bg: &sitestore.BgConfig{
Url: "",
Repeat: "",
Position: "",
Align: "",
Url: "url",
Repeat: "repeat",
Position: "center",
Align: "fixed",
BgColor: "#ccc",
},
},
}

View file

@ -453,6 +453,7 @@ func TestUsersHandlers(t *testing.T) {
Repeat: "no-repeat",
Position: "center",
Align: "fixed",
BgColor: "#ccc",
},
CSSURL: "/cssurl",
LanPackURL: "/lanpack",
@ -463,6 +464,7 @@ func TestUsersHandlers(t *testing.T) {
Repeat: "no-repeat2",
Position: "center2",
Align: "fixed2",
BgColor: "#333",
},
CSSURL: "/cssurl2",
LanPackURL: "/lanpack2",

View file

@ -46,6 +46,7 @@ site:
repeat: "1"
position: "1"
align: "1"
bgColor: "1"
db:
dbPath: "1"

View file

@ -46,5 +46,6 @@ site:
repeat: "4"
position: "4"
align: "4"
bgColor: "4"
db:
dbPath: "4"

Binary file not shown.