|
- package api
-
- import (
- "net/http"
-
- "gitlink.org.cn/cloudream/common/sdks"
- jcstypes "gitlink.org.cn/cloudream/jcs-pub/common/types"
- )
-
- type SystemService struct {
- *Client
- }
-
- func (c *Client) System() *SystemService {
- return &SystemService{c}
- }
-
- const SystemStatusPath = "/system/status"
-
- type SystemStatus struct {
- }
-
- func (r *SystemStatus) MakeParam() *sdks.RequestParam {
- return sdks.MakeQueryParam(http.MethodGet, SystemStatusPath, r)
- }
-
- type SystemStatusResp struct {
- SpeedStats jcstypes.SpeedStatsStatus `json:"speedStats"`
- }
-
- func (r *SystemStatusResp) ParseResponse(resp *http.Response) error {
- return sdks.ParseCodeDataJSONResponse(resp, r)
- }
-
- func (c *SystemService) Status(req SystemStatus) (*SystemStatusResp, error) {
- return JSONAPI(&c.cfg, c.httpCli, &req, &SystemStatusResp{})
- }
|