feat(rcs): migrate all RCS APIs from rainyun-go-sdk
- 35 endpoints across 14 files, response structs split for reuse
- Reuse RcsRecord/Node/Plan/OsInfo/UsageData across list/detail/create
- Fix source bugs: {id} path placeholders, missing / in firewall pos path,
missing body in ChargeRcsTrafic, resp vs &resp
- Add HTTPMethod_PATCH, common.BasicOperationResponse, VncConnectionInfo
This commit is contained in:
@@ -6,3 +6,8 @@ type StandQueryParameters struct {
|
||||
Page int `json:"page"`
|
||||
PerPage int `json:"perPage"`
|
||||
}
|
||||
|
||||
type BasicOperationResponse struct {
|
||||
Code int `json:"code"`
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ import (
|
||||
)
|
||||
|
||||
type queryParamsSample struct {
|
||||
IsRGpu *bool `json:"is_rgpu"`
|
||||
Limit int `json:"limit"`
|
||||
Name string `json:"name"`
|
||||
Options StandQueryParameters `json:"options"`
|
||||
Tags []string `json:"tags"`
|
||||
Skip string `json:"-"`
|
||||
IsRGpu *bool `json:"is_rgpu"`
|
||||
Limit int `json:"limit"`
|
||||
Name string `json:"name"`
|
||||
Options StandQueryParameters `json:"options"`
|
||||
Tags []string `json:"tags"`
|
||||
Skip string `json:"-"`
|
||||
NoTag string
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package common
|
||||
|
||||
import "strconv"
|
||||
|
||||
type VncConnectionInfo struct {
|
||||
Code int `json:"code"`
|
||||
Data VncConnectionData `json:"data"`
|
||||
}
|
||||
|
||||
type VncConnectionData struct {
|
||||
RequestURL string `json:"RequestURL"` // 空
|
||||
RedirectURL string `json:"RedirectURL"` // 空
|
||||
PVEAuth string `json:"PVEAuth"` // 空
|
||||
VNCProxyURL string `json:"VNCProxyURL"` // PVE代理地址(连接地址),里面会有一个unicode码(\u0026)(&),转码后就是可以直接在浏览器上使用的VNC连接地址
|
||||
}
|
||||
|
||||
func GetVncConnectURL(v *VncConnectionInfo) (string, error) {
|
||||
return strconv.Unquote(v.Data.VNCProxyURL)
|
||||
}
|
||||
Reference in New Issue
Block a user