FindAppList.go 723 B

123456789101112131415161718192021222324252627
  1. package v1
  2. import (
  3. "errors"
  4. "metawant.greentech.com.cn/gaoyagang/gt-common/datacenter_client"
  5. "metawant.greentech.com.cn/gaoyagang/gt-common/httplib"
  6. "strconv"
  7. )
  8. func (d *DcApi) FindAppList(params datacenter_client.FindAppListReq) (*datacenter_client.FindAppListResp, error) {
  9. serviceName := "/app/list"
  10. h := httplib.Get(d.serviceUrl(serviceName))
  11. h.Param("project_id", strconv.FormatInt(params.ProjectId, 10))
  12. h.Param("page", strconv.FormatInt(params.Page, 10))
  13. h.Param("page_size", strconv.FormatInt(params.PageSize, 10))
  14. h.Param("order", params.Order)
  15. resp := &datacenter_client.FindAppListResp{}
  16. err := d.call(h, resp)
  17. if resp.Code != 200 {
  18. return nil, errors.New(resp.Msg)
  19. }
  20. return resp, err
  21. }