You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simpleRequest/param.go

37 lines
660 B
Go

/*
* @FileName: param.go
* @Author: JJXu
* @CreateTime: 2022/3/1 下午9:07
* @Description:
*/
package simpleRequest
import (
"fmt"
"net/url"
)
type QueryParams struct {
simpleReq *SimpleRequest
}
//batch settings
func (s *QueryParams) Sets(data map[string]interface{}) *QueryParams {
for k, v := range data {
s.simpleReq.queryParams.Set(k, fmt.Sprintf("%v", v))
}
return s
}
//single settings
func (s *QueryParams) Set(key string, value interface{}) *QueryParams {
s.simpleReq.queryParams.Set(key, fmt.Sprintf("%v", value))
return s
}
//get all queryParams
func (s *QueryParams) Gets() *url.Values {
return &s.simpleReq.queryParams
}