- domain(24), product(8), rbm(10), rca(21), rgs(38), ros(19), ssl(5), user(10), workorder(11), public remaining 5 - split nested response structs into reusable named types - rgs reuses rcs request/response types - fix source bugs: malformed paths, resp vs &resp, missing bodies - register all 11 services in sdk.New
47 lines
1.3 KiB
Go
47 lines
1.3 KiB
Go
package rgs
|
||
|
||
import (
|
||
"fmt"
|
||
|
||
"github.com/XingfenD/rainyun_api_go_sdk/constant"
|
||
)
|
||
|
||
// 游戏云详情
|
||
// 由于响应实在过于庞大,我们只维护部分必要的响应,如有扩展需求,请在项目的data文件夹下寻找响应实例自行解码
|
||
type GetRgsDetailResponse struct {
|
||
Code int `json:"code"`
|
||
Data RgsDetailData `json:"data"`
|
||
}
|
||
|
||
type RgsDetailData struct {
|
||
Data RgsRecord `json:"Data"`
|
||
NatList []RgsNatItem `json:"NatList"` // 端口映射列表
|
||
EIPList any `json:"EIPList"`
|
||
ConfigPrice int `json:"ConfigPrice"`
|
||
RenewPointPrice RgsRenewPointPrice `json:"RenewPointPrice"` // 积分续费
|
||
}
|
||
|
||
type RgsNatItem struct {
|
||
ID int `json:"ID"`
|
||
PortIn int `json:"PortIn"`
|
||
PortOut int `json:"PortOut"`
|
||
PortType string `json:"PortType"`
|
||
Tag string `json:"Tag"`
|
||
}
|
||
|
||
type RgsRenewPointPrice struct {
|
||
Num7 int `json:"7"` // 积分续费七天
|
||
Num31 int `json:"31"` // 积分续费31天
|
||
}
|
||
|
||
// 获取游戏云详情
|
||
//
|
||
// id: 游戏云 ID
|
||
func (s *RgsService) GetRgsDetail(id int) (*GetRgsDetailResponse, error) {
|
||
path := fmt.Sprintf("/product/rgs/%d", id)
|
||
|
||
var resp GetRgsDetailResponse
|
||
err := s.client.Do(constant.HTTPMethod_GET, path, nil, nil, &resp)
|
||
return &resp, err
|
||
}
|