1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- package services
- import (
- "encoding/json"
- "eta/eta_mini_api/utils"
- "fmt"
- resp2 "eta/eta_mini_api/models/response"
- )
- func GetReportList(chartPermissionId, level, rangeType, currentIndex, pageSize int) (resp *resp2.ReportResp[resp2.ReportList], err error) {
- url := utils.ETA_MINI_BRIDGE_URL + "/report/list?"
- url += fmt.Sprintf("RangeType=%d&ChartPermissionId=%d&Level=%d&PageSize=%d&CurrentIndex=%d", rangeType, chartPermissionId, level, pageSize, currentIndex)
- fmt.Println(url)
- body, err := HttpGet(url)
- if err != nil {
- return
- }
- err = json.Unmarshal(body, &resp)
- if err != nil {
- return
- }
- return
- }
- func GetReportDetail(reportId, userId int) (resp *resp2.ReportResp[resp2.ReportDetailResp], err error) {
- url := utils.ETA_MINI_BRIDGE_URL + "/report/detail?"
- url += fmt.Sprintf("ReportId=%d&UserId=%d", reportId, userId)
- fmt.Println(url)
- body, err := HttpGet(url)
- if err != nil {
- return
- }
- err = json.Unmarshal(body, &resp)
- if err != nil {
- return
- }
- return
- }
- func GetReportDetailNoUser(reportId int) (resp *resp2.ReportResp[resp2.ReportDetailResp], err error) {
- url := utils.ETA_MINI_BRIDGE_URL + "/report/detail/noUser?"
- url += fmt.Sprintf("ReportId=%d", reportId)
- fmt.Println(url)
- body, err := HttpGet(url)
- if err != nil {
- return
- }
- err = json.Unmarshal(body, &resp)
- if err != nil {
- return
- }
- return
- }
- func GetReportDailyList(currentIndex, pageSize int) (resp *resp2.ReportResp[resp2.ReportList], err error) {
- url := utils.ETA_MINI_BRIDGE_URL + "/report/daily/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
- }
- return
- }
- func SearchReport(keyWord string, currentIndex, pageSize int) (resp *resp2.ReportResp[resp2.ReportSearchResp], err error) {
- url := utils.ETA_MINI_BRIDGE_URL + "/report/search?"
- url += fmt.Sprintf("KeyWord=%s&PageSize=%d&CurrentIndex=%d", keyWord, pageSize, currentIndex)
- fmt.Println(url)
- body, err := HttpGet(url)
- if err != nil {
- return
- }
- err = json.Unmarshal(body, &resp)
- if err != nil {
- return
- }
- return
- }
|