fix: add getList with records wrapper + correct options format from browser capture
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package rainyun
|
||||
|
||||
// listOptions returns the standard pagination query for Rainyun list endpoints.
|
||||
// Format verified via browser DevTools capture of the Rainyun web console:
|
||||
//
|
||||
// https://api.v2.rainyun.com/product/rcs/?options={url-encoded JSON}
|
||||
//
|
||||
// The decoded JSON is: {"columnFilters":{},"sort":[],"page":1,"perPage":20}
|
||||
func listOptions() map[string]string {
|
||||
return map[string]string{
|
||||
"options": `{"columnFilters":{},"sort":[],"page":1,"perPage":50}`,
|
||||
}
|
||||
}
|
||||
|
||||
// listResponse is the JSON envelope returned by Rainyun list endpoints.
|
||||
// The API wraps data in {"code":0,"data":{"records":[...],"totalRecords":N}}.
|
||||
// Our client extracts apiResp.Data ({"records":[...]}), then we unmarshal into this.
|
||||
type listResponse struct {
|
||||
Records []any `json:"records"`
|
||||
TotalRecords int `json:"totalRecords"`
|
||||
}
|
||||
Reference in New Issue
Block a user