This commit is contained in:
2025-02-27 15:05:34 +08:00
parent 3f85158eed
commit be0db326b9
58 changed files with 1779 additions and 361 deletions

21
pkg/utility/urlhelper.go Normal file
View File

@ -0,0 +1,21 @@
package utility
import "net/url"
func ParseURLParams(rawURL string) (map[string]string, error) {
parsedURL, err := url.Parse(rawURL)
if err != nil {
return nil, err
}
queryParams := parsedURL.Query()
result := make(map[string]string)
for key, values := range queryParams {
if len(values) > 0 {
result[key] = values[0] // 取第一个值
}
}
return result, nil
}