mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-01 10:00:19 +08:00
feat: add regex support for account item (#2714)
* feat: add regex support for account item * feat: use reflect to process user field * fix: fix lint problem * feat: improve code format and fix reflect error
This commit is contained in:
@ -113,6 +113,15 @@ func SnakeToCamel(snake string) string {
|
||||
return strings.Join(words, "")
|
||||
}
|
||||
|
||||
func SpaceToCamel(name string) string {
|
||||
words := strings.Split(name, " ")
|
||||
for i := range words {
|
||||
words[i] = strings.ToLower(words[i])
|
||||
words[i] = strings.Title(words[i])
|
||||
}
|
||||
return strings.Join(words, "")
|
||||
}
|
||||
|
||||
func GetOwnerAndNameFromId(id string) (string, string) {
|
||||
tokens := strings.Split(id, "/")
|
||||
if len(tokens) != 2 {
|
||||
|
Reference in New Issue
Block a user