diff --git a/story/api.go b/story/api.go new file mode 100644 index 0000000..044f73c --- /dev/null +++ b/story/api.go @@ -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 +} diff --git a/story/story.go b/story/story.go new file mode 100644 index 0000000..f6ee9e8 --- /dev/null +++ b/story/story.go @@ -0,0 +1,17 @@ +package story + +//http://media.yc.ifeng.com/douyin.html +func GetCategory(appId string, args map[string]string) (string, error) { + + post, err := SendPost("api/dychannel/GetCategory", appId, args) + return post, err +} + +func GetBookList(appId string, args map[string]string) (string, error) { + post, err := SendPost("api/dychannel/GetBookList", appId, args) + return post, err +} +func GetBookInfo(appId string, args map[string]string) (string, error) { + post, err := SendPost("api/dychannel/GetBookInfo", appId, args) + return post, err +} diff --git a/story/story_second.go b/story/story_second.go new file mode 100644 index 0000000..6ff000c --- /dev/null +++ b/story/story_second.go @@ -0,0 +1,8 @@ +package story + +//https://yueshu88.feishu.cn/wiki/C2FMwrmhGidnrpkBVJ7c6gNbn9b +//46b8d2af5d3f6d5891e20e0a56052313 +func GetYxList(appId string, args map[string]string) (string, error) { + post, err := SendPostSecond("open/host/v1/book/list", appId, args) + return post, err +}