|
123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package macao_logistics
-
- import (
- "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/comm"
- zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
- "strings"
- )
-
- func GetSign(appSecret string, param map[string]string) string {
- str := ""
- keys := comm.KsortToStr(param)
-
- for _, k := range keys {
- str += strings.ReplaceAll(param[k], "\\n", "")
- }
- return ""
- }
- func Send(method string, params map[string]interface{}, acctoken string) (string, error) {
- url := "http://jyb-admin-backend-test.aoyunltd.cn/api/v1" + method
- header := make(map[string]string, 0)
- if acctoken != "" {
- header["Authorization"] = "Bearer " + acctoken
- }
- data, err := zhios_third_party_utils.CurlPost(url, params, header)
- return string(data), err
- }
- func SendGet(method string, params map[string]interface{}, acctoken string) (string, error) {
- url := "http://jyb-admin-backend-test.aoyunltd.cn/api/v1" + method
- header := make(map[string]string, 0)
- if acctoken != "" {
- header["Authorization"] = "Bearer " + acctoken
- }
- for k, v := range params {
- if strings.Contains(url, "?") == false {
- url += "?" + k + "=" + zhios_third_party_utils.AnyToString(v)
- } else {
- url += "&" + k + "=" + zhios_third_party_utils.AnyToString(v)
- }
- }
- data, err := zhios_third_party_utils.CurlGet(url, header)
- return string(data), err
- }
|