浏览代码

小说

master
huangjiajun 10 个月前
父节点
当前提交
8f7ef4be48
共有 3 个文件被更改,包括 56 次插入0 次删除
  1. +31
    -0
      story/api.go
  2. +17
    -0
      story/story.go
  3. +8
    -0
      story/story_second.go

+ 31
- 0
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
}

+ 17
- 0
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
}

+ 8
- 0
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
}

正在加载...
取消
保存