用 Go (Gin + GORM + SQLite) 重写整个后端: - 单二进制部署,不依赖 Python/pip/SDK - net/http 原生客户端,无 Cloudflare TLS 指纹问题 - 多阶段 Dockerfile:Node 构建前端 + Go 构建后端 + Alpine 运行 - 内存占用从 ~95MB 降至 ~3MB - 完整保留所有 API 路由、JWT 认证、API Key 权限、审计日志
23 lines
600 B
Go
23 lines
600 B
Go
package airwallex
|
|
|
|
import "fmt"
|
|
|
|
// PaginatedResponse represents a paginated API response.
|
|
type PaginatedResponse struct {
|
|
Items []map[string]interface{} `json:"items"`
|
|
HasMore bool `json:"has_more"`
|
|
}
|
|
|
|
// APIError represents an Airwallex API error.
|
|
type APIError struct {
|
|
Code string `json:"code"`
|
|
Message string `json:"message"`
|
|
Source string `json:"source"`
|
|
StatusCode int `json:"-"`
|
|
}
|
|
|
|
// Error implements the error interface.
|
|
func (e *APIError) Error() string {
|
|
return fmt.Sprintf("airwallex: %s - %s (status %d)", e.Code, e.Message, e.StatusCode)
|
|
}
|