mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-06 01:06:22 +00:00
⚡ refactor user service methods, implement OIDC login and user management features, and enhance token handling
This commit is contained in:
20
pkg/utils/url.go
Normal file
20
pkg/utils/url.go
Normal file
@ -0,0 +1,20 @@
|
||||
package utils
|
||||
|
||||
import "net/url"
|
||||
|
||||
type urlUtils struct{}
|
||||
|
||||
var Url = &urlUtils{}
|
||||
|
||||
func (u *urlUtils) BuildUrl(baseUrl string, queryParams map[string]string) string {
|
||||
newUrl, err := url.Parse(baseUrl)
|
||||
if err != nil {
|
||||
return baseUrl
|
||||
}
|
||||
q := newUrl.Query()
|
||||
for key, value := range queryParams {
|
||||
q.Set(key, value)
|
||||
}
|
||||
newUrl.RawQuery = q.Encode()
|
||||
return newUrl.String()
|
||||
}
|
Reference in New Issue
Block a user