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
}
