Files
XingfenD 5604a3f2f0 fix get url arguments passing
chore: update gitignore
chore: rename some structures
feat: support sdk init
2026-08-03 15:21:01 +08:00

31 lines
616 B
Go

package public
import (
"time"
"github.com/XingfenD/rainyun_api_go_sdk/constant"
)
// https://api.rainyun.com/#/paths/news/get
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, nil, &resp)
return &resp, err
}