repalce redirect_to_https with entrypoint middleware

This commit is contained in:
yusing
2024-11-30 08:50:23 +08:00
parent 796a4a693a
commit f8bdc7044c
8 changed files with 30 additions and 61 deletions

View File

@@ -193,10 +193,19 @@ func Deserialize(src SerializedObject, dst any) E.Error {
key = strutils.ToLowerNoSnake(key)
mapping[key] = dstV.FieldByName(field.Name)
fieldName[field.Name] = key
_, ok := field.Tag.Lookup("validate")
if ok {
needValidate = true
}
aliases, ok := field.Tag.Lookup("aliases")
if ok {
for _, alias := range strings.Split(aliases, ",") {
mapping[alias] = dstV.FieldByName(field.Name)
fieldName[field.Name] = alias
}
}
}
for k, v := range src {
if field, ok := mapping[strutils.ToLowerNoSnake(k)]; ok {