package services import ( "encoding/json" "eta/eta_mini_api/models" "eta/eta_mini_api/utils" "fmt" ) func GetChartPermissionSecondList(chartPermissionId int) (resp *models.ChartPermissionResp[[]models.ChartPermission], err error) { url := utils.ETA_MINI_BRIDGE_URL + "/chart_permission/second/list" url += fmt.Sprintf("?chartPermissonId=%d", chartPermissionId) body, err := HttpGet(url) if err != nil { return } err = json.Unmarshal(body, &resp) if err != nil { return } return } func GetChartPermissionList() (resp *models.ChartPermissionResp[[]models.ChartPermission], err error) { url := utils.ETA_MINI_BRIDGE_URL + "/chart_permission/list" body, err := HttpGet(url) if err != nil { return } err = json.Unmarshal(body, &resp) if err != nil { return } return } func GetPublicChartPermissionList() (resp *models.ChartPermissionResp[[]*models.ChartPermissionTreeView], err error) { url := utils.ETA_MINI_BRIDGE_URL + "/chart_permission/public/list" body, err := HttpGet(url) if err != nil { return } err = json.Unmarshal(body, &resp) if err != nil { return } return } func GetPrivateChartPermissionList() (resp *models.ChartPermissionResp[[]*models.ChartPermissionTreeView], err error) { url := utils.ETA_MINI_BRIDGE_URL + "/chart_permission/private/list" body, err := HttpGet(url) if err != nil { return } err = json.Unmarshal(body, &resp) if err != nil { return } return } func GetChartPermissionAllList() (resp *models.ChartPermissionResp[[]*models.ChartPermission], err error) { url := utils.ETA_MINI_BRIDGE_URL + "/chart_permission/allList" body, err := HttpGet(url) if err != nil { return } err = json.Unmarshal(body, &resp) if err != nil { return } return } func GetReportChartPermissionList(reportId int) (resp *models.ChartPermissionResp[[]*models.ChartPermission], err error) { url := utils.ETA_MINI_BRIDGE_URL + "/chart_permission/detail" url += fmt.Sprintf("?ReportId=%d", reportId) body, err := HttpGet(url) if err != nil { return } err = json.Unmarshal(body, &resp) if err != nil { return } return }