|
- package gzmiyuan
-
- import (
- zhios_third_party_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git/utils"
- "encoding/json"
- "fmt"
- "time"
- )
-
- func GetGzmiRealData(pageSize, pageId, openType string) ([]GzmiRealNewsResponse, error) {
- url := "https://api.gzmiyuan.com/api/business/sharerange/xianbao/findShareXianBaoByOpenType"
- params := map[string]string{
- "page": pageId,
- "rows": pageSize,
- "openType": openType,
- "version": fmt.Sprintf("%d", time.Now().UnixNano()/1e6),
- }
- fmt.Println(zhios_third_party_utils.Serialize(params))
- resp, err := SendReq(url, params)
- zhios_third_party_utils.FilePutContents("miyuan", string(resp))
- if err != nil {
- zhios_third_party_utils.FilePutContents("miyuan", err.Error())
-
- return nil, err
- }
-
- var responseData struct {
- Msg string `json:"msg"`
- Data []GzmiRealNewsResponse `json:"data"`
- Code string `json:"code"`
- }
-
- err = json.Unmarshal(resp, &responseData)
-
- if err != nil {
- zhios_third_party_utils.FilePutContents("miyuan", err.Error())
-
- return nil, err
- }
- return responseData.Data, nil
- }
|