Files
rainyun_api_go_sdk/apis/public/get_news.go
T
XingfenD 86fba66370 finish some public api
rename public service
2026-08-03 12:25:51 +08:00

29 lines
566 B
Go

package public
import (
"time"
"github.com/XingfenD/rainyun_api_go_sdk/constant"
)
type GetNewsResponse struct {
Code int `json:"code"`
Data []RainyunNewsItem `json:"data"`
}
type RainyunNewsItem struct {
Type string `json:"Type"`
Title string `json:"Title"`
TimeStamp time.Time `json:"TimeStamp"`
URL string `json:"URL"`
}
func (s *PublicService) GetNews() (*GetNewsResponse, error) {
path := "/news"
var resp GetNewsResponse
err := s.client.Do(constant.HTTPMethod_GET, path, nil, &resp)
return &resp, err
}