GetStringParam 获取字符串参数的通用函数
(input map[string]any, key string, defaultValue string)
| 25 | |
| 26 | // GetStringParam 获取字符串参数的通用函数 |
| 27 | func GetStringParam(input map[string]any, key string, defaultValue string) string { |
| 28 | if value, exists := input[key]; exists { |
| 29 | if str, ok := value.(string); ok { |
| 30 | return str |
| 31 | } |
| 32 | } |
| 33 | return defaultValue |
| 34 | } |
| 35 | |
| 36 | // GetIntParam 获取整数参数的通用函数 |
| 37 | func GetIntParam(input map[string]any, key string, defaultValue int) int { |
no outgoing calls
no test coverage detected