feat: migrate all remaining modules from rainyun-go-sdk

- 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
This commit is contained in:
2026-08-05 23:09:53 +08:00
parent b8490ef422
commit 51b7e2f319
56 changed files with 4267 additions and 2 deletions
+46
View File
@@ -0,0 +1,46 @@
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
}