You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

hub.go 708 B

10 months ago
123456789101112131415161718192021222324252627282930
  1. package cdsapi
  2. import (
  3. "net/http"
  4. "gitlink.org.cn/cloudream/common/sdks"
  5. cdssdk "gitlink.org.cn/cloudream/common/sdks/storage"
  6. )
  7. var HubGetHubsPath = "/hub/getHubs"
  8. type HubGetHubsReq struct {
  9. HubIDs []cdssdk.HubID `form:"hubIDs" url:"hubIDs"`
  10. }
  11. func (r *HubGetHubsReq) MakeParam() *sdks.RequestParam {
  12. return sdks.MakeQueryParam(http.MethodGet, HubGetHubsPath, r)
  13. }
  14. type HubGetHubsResp struct {
  15. Hubs []*cdssdk.Hub `json:"hubs"`
  16. }
  17. func (r *HubGetHubsResp) ParseResponse(resp *http.Response) error {
  18. return sdks.ParseCodeDataJSONResponse(resp, r)
  19. }
  20. func (c *Client) HubGetHubs(req HubGetHubsReq) (*HubGetHubsResp, error) {
  21. return JSONAPI(c.cfg, http.DefaultClient, &req, &HubGetHubsResp{})
  22. }