kubesphere-add-default-param

This commit is contained in:
zehuaiWANG
2019-12-03 10:38:47 +08:00
parent 618328e62e
commit 3b927ba847
2 changed files with 9 additions and 6 deletions

View File

@@ -89,3 +89,11 @@ type Conditions struct {
Match map[string]string
Fuzzy map[string]string
}
func GetStringValueWithDefault(req *restful.Request, name string, dv string) string {
v := req.QueryParameter(name)
if v == "" {
v = dv
}
return v
}