|
@@ -0,0 +1,31 @@ |
|
|
|
|
|
package story |
|
|
|
|
|
|
|
|
|
|
|
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" |
|
|
|
|
|
"fmt" |
|
|
|
|
|
"github.com/syyongx/php2go" |
|
|
|
|
|
"strings" |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func SendPost(method string, appId string, param map[string]string) (string, error) { |
|
|
|
|
|
url := "https://androidapi4.yc.ifeng.com/" + method |
|
|
|
|
|
header := map[string]string{ |
|
|
|
|
|
"appId": appId, |
|
|
|
|
|
} |
|
|
|
|
|
get, err := zhios_third_party_utils.CurlPost(url, zhios_third_party_utils.SerializeStr(param), header) |
|
|
|
|
|
fmt.Println(string(get)) |
|
|
|
|
|
fmt.Println(err) |
|
|
|
|
|
return string(get), err |
|
|
|
|
|
} |
|
|
|
|
|
func SendPostSecond(method string, appId string, param map[string]string) (string, error) { |
|
|
|
|
|
url := "https://openapis.yanxiangbook.com/" + method |
|
|
|
|
|
param["app_key"] = appId |
|
|
|
|
|
paramJson := comm.GetSortJson(param) |
|
|
|
|
|
paramJson = strings.ReplaceAll(paramJson, "\n", "") |
|
|
|
|
|
param["sign"] = php2go.Md5(paramJson + "&salt=" + appId) |
|
|
|
|
|
get, err := zhios_third_party_utils.CurlPost(url, zhios_third_party_utils.SerializeStr(param), nil) |
|
|
|
|
|
fmt.Println(string(get)) |
|
|
|
|
|
fmt.Println(err) |
|
|
|
|
|
return string(get), err |
|
|
|
|
|
} |