12345678910111213141516171819202122232425262728293031323334353637383940 |
- package services
- import (
- "encoding/json"
- "eta/eta_mini_api/utils"
- "fmt"
- resp2 "eta/eta_mini_api/models/response"
- )
- func GetChartList(currentIndex, pageSize int) (resp *resp2.ChartResp[resp2.ChartListResp], err error) {
- url := utils.ETA_MINI_BRIDGE_URL + "/chart/list?"
- url += fmt.Sprintf("PageSize=%d&CurrentIndex=%d", pageSize, currentIndex)
- fmt.Println(url)
- body, err := HttpGet(url)
- if err != nil {
- return
- }
- err = json.Unmarshal(body, &resp)
- if err != nil {
- return resp, err
- }
- return resp, nil
- }
- func GetChartDetail(chartInfoId int, uniqueCode string) (resp *resp2.ChartResp[resp2.ChartInfoView], err error) {
- url := utils.ETA_MINI_BRIDGE_URL + "/chart/detail?"
- url += fmt.Sprintf("ChartInfoId=%d&UniqueCode=%s", chartInfoId, uniqueCode)
- fmt.Println(url)
- body, err := HttpGet(url)
- if err != nil {
- return
- }
- err = json.Unmarshal(body, &resp)
- if err != nil {
- return
- }
- return
- }
|