* refactor: rename queryannouncementhandler.go to queryAnnouncementLogic.go for clarity
* feat(panDomain): update subscription logic to use V2 handler for improved functionality
* refactor(subscribe): replace V2 handler with a unified Handler method for subscription logic
* feat(subscribe): implement user agent limit feature with configurable list
* fix(subscribe): improve error handling and logging for subscription requests
* feat(subscribe): add user agent limit configuration to system settings
* refactor(api): remove deprecated application-related endpoints and types
* refactor(swagger): remove deprecated app.json generation from swagger configuration
* refactor(swagger): remove deprecated app.json check from swagger configuration
* fix(subscribe): update delete method to use Where clause for improved query accuracy
* fix(subscribe): update Id field tag to use primaryKey and improve save method query
* fix(subscribe): update Id field tag to use primaryKey and improve model queries
* fix(subscribe): rename variable for clarity and add special handling for Stash user agent
* fix(email): convert RegisterStartTime and RegisterEndTime to time.Time for accurate query filtering
* refactor(log): consolidate logging models and update related logic for improved clarity and functionality
* fix(types): change Content field type in MessageLog to interface{} for improved flexibility
* fix(log): change MessageLog list to use value type for improved performance and memory efficiency
* fix(email): set EmailTypeVerify in task payload and update content type conversion for verification email
* fix(log): remove unused Id field from SystemLog during login log insertion
* fix(login): remove debug logs and error logging during user login process
* fix(log): add traffic reset logging for subscription resets
* fix(log): insert reset traffic log during subscription activation
* feat(log): add endpoints for retrieving and resetting subscribe traffic logs
* refactor(log): remove Reset Subscribe Traffic Log endpoint and related types
* feat(traffic): add traffic statistics logging and scheduling
* fix(subscribe): ensure active status and reset timestamps during traffic resets
* feat(api): enhance server and node management with new request/response structures
* refactor(api): rename OnlineUser to ServerOnlineUser for clarity
* feat(api): define OnlineUser type with SID and IP fields
* feat(server): implement server management handlers and database schema
* feat(api): add traffic log details filtering and enhance traffic log structures
* feat(api): migrate server and node data handling, update related structures and logic
* feat(server): implement server deletion logic with error handling
* feat(api): update log filtering to use ResetSubscribe type for subscription logs
* feat(api): standardize timestamp field across log structures
* feat(api): refactor cache key handling for server and user lists
* feat(api): enhance server status handling with protocol support and refactor related logic
* fix(traffic): adjust start date for traffic statistics and improve log deletion comment
* feat(api): implement daily traffic ranking for users and servers with error handling
* feat(api): update server total data response to use 'OnlineUsers' and implement daily traffic statistics logging
* feat(api): add log settings management with auto-clear and clear days configuration
* fix(log): correct category in log settings update query
* feat(routes): add handler for scheduled traffic statistics
* feat(model): add user counts struct and update queries for new and renewal users
* feat(api): add referral percentage and only first purchase fields to user model and requests
* feat(database): update user table to add referral percentage and only first purchase fields
* feat(api): add reset sort endpoints for server and node
* feat(api): add sort field to server model
* feat(api): implement sorting functionality for nodes and servers
* fix(database): add sort column to nodes table
* fix(model): enhance user statistics queries with new order and renewal order counts
* fix(log): update timestamp handling in login and registration logs
* fix(log): update sorting logic for server and user subscribe traffic logs
* fix(server): add server status handling based on last reported time
* fix(model): correct filter condition to use 'date' instead of 'data'
* fix(migration): add index for traffic log on timestamp, user_id, and subscribe_id
* fix(log): optimize user traffic rank data handling by using append instead of index assignment
* fix(filter): refactor node list creation to use append and remove duplicates from tags
* fix(node): add ServerId and Enabled fields to node update logic
* feat(tags): add endpoint to query all node tags
* fix(preview): add Preload parameter to FilterNodeList for improved data retrieval
* fix(log): date is empty
* feat(subscribe): add Language field to subscription models and update query logic
* feat(subscription): add Language parameter to GetSubscription request and update query logic
* fix(server): encode ServerKey in base64 and update last reported time for nodes
* feat: delete common GetSubscription
* feat(subscription): implement FilterList method for subscription queries and update related logic
* fix(subscribe): remove duplicate user agents in SubscribeHandler
* fix(push): initialize onlineUsers as a map in pushOnlineUsersLogic
* fix(reset): initialize subs as a map in clearCache method
* refactor(query): simplify node and tag filtering using InSet function
* feat(userlist): enhance GetServerUserListLogic with improved node and tag handling
* fix(userlist): correct node ID assignment and update query logic for tag filtering
* fix(userlist): correct node ID assignment in getServerUserListLogic
* refactor(query): streamline query construction for tag filtering
* fix(statistics): optimize server ranking data handling in QueryServerTotalDataLogic
* refactor(statistics): simplify server ranking data construction in QueryServerTotalDataLogic
* fix(statistics): correct server traffic data assignment in QueryServerTotalDataLogic
* fix(statistics): optimize yesterday's top 10 server traffic data assignment in QueryServerTotalDataLogic
* fix(middleware): remove duplicate elements from user agent list in PanDomainMiddleware
* feat(middleware): enhance user agent handling by querying client list in PanDomainMiddleware
* feat(client): subscribe_template
* feat(oauth): add user agent and IP logging to registration and login processes
* fix(balance): add timestamp to balance logs for payment, refund, and recharge transactions
* fix(log): correct comment for CommissionTypeRefund to improve clarity
* fix(log): replace magic number with constant for gift type in purchase checkout logic
* fix(log): rename OrderId to OrderNo for consistency in balance logging
* feat(log): add logging for balance, gift amount, and commission adjustments
* fix(user): correct placement of DeepCopy for user info update logic
* feat(log): add UserSubscribeId to FilterSubscribeLogRequest for enhanced filtering
* fix(purchase): streamline error handling and improve JSON marshaling for temporary orders
* fix(order): simplify commission handling and improve payload parsing logic
* fix(order): update commission calculation to actual payment amount minus gateway handling fee
* feat(payment): add support for CryptoSaaS payment platform and enhance configuration handling
* fix(balance): update QueryUserBalanceLog response structure to include balance log list
* fix(email): update task progress handling to use specific task ID for updates
* feat(quota): add quota task creation and querying endpoints with updated data structures
* fix(email): update task handling to use generic task model and improve error logging
* fix(order): improve error logging for database transaction and user cache updates
* feat(quota): enhance quota task management with new request structures and processing logic
* fix(quota): remove redundant quota task status endpoint from admin marketing routes
* fix(worker): update task completion status handling in worker logic
* fix(quota): update taskInfo to include current subscription count in quota logic
* doc(log): rename function for clarity and add cache cleanup comment
* fix(quota): update time handling in quota logic and correct subscriber ID query
* fix(quota): update time handling to use UnixMilli for start time in quota logic
* feat(protocol): add server protocol configuration query and enhance protocol options
* fix(quota): correct time range queries for start and expire times in quota logic
* fix(types): update plugin options to include 'none' in the plugin field
---------
Co-authored-by: Chang lue Tsen <tension@ppanel.dev>
807 lines
30 KiB
Plaintext
807 lines
30 KiB
Plaintext
syntax = "v1"
|
|
|
|
info (
|
|
title: "Interface Model"
|
|
desc: "API for ppanel"
|
|
author: "Tension"
|
|
email: "tension@ppanel.com"
|
|
version: "0.0.1"
|
|
)
|
|
|
|
type (
|
|
User {
|
|
Id int64 `json:"id"`
|
|
Avatar string `json:"avatar"`
|
|
Balance int64 `json:"balance"`
|
|
Commission int64 `json:"commission"`
|
|
ReferralPercentage uint8 `json:"referral_percentage"`
|
|
OnlyFirstPurchase bool `json:"only_first_purchase"`
|
|
GiftAmount int64 `json:"gift_amount"`
|
|
Telegram int64 `json:"telegram"`
|
|
ReferCode string `json:"refer_code"`
|
|
RefererId int64 `json:"referer_id"`
|
|
Enable bool `json:"enable"`
|
|
IsAdmin bool `json:"is_admin,omitempty"`
|
|
EnableBalanceNotify bool `json:"enable_balance_notify"`
|
|
EnableLoginNotify bool `json:"enable_login_notify"`
|
|
EnableSubscribeNotify bool `json:"enable_subscribe_notify"`
|
|
EnableTradeNotify bool `json:"enable_trade_notify"`
|
|
AuthMethods []UserAuthMethod `json:"auth_methods"`
|
|
UserDevices []UserDevice `json:"user_devices"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
DeletedAt int64 `json:"deleted_at,omitempty"`
|
|
IsDel bool `json:"is_del,omitempty"`
|
|
}
|
|
Follow {
|
|
Id int64 `json:"id"`
|
|
TicketId int64 `json:"ticket_id"`
|
|
From string `json:"from"`
|
|
Type uint8 `json:"type"`
|
|
Content string `json:"content"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
}
|
|
Ticket {
|
|
Id int64 `json:"id"`
|
|
Title string `json:"title"`
|
|
Description string `json:"description"`
|
|
UserId int64 `json:"user_id"`
|
|
Follows []Follow `json:"follow,omitempty"`
|
|
Status uint8 `json:"status"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
SiteConfig {
|
|
Host string `json:"host"`
|
|
SiteName string `json:"site_name"`
|
|
SiteDesc string `json:"site_desc"`
|
|
SiteLogo string `json:"site_logo"`
|
|
Keywords string `json:"keywords"`
|
|
CustomHTML string `json:"custom_html"`
|
|
CustomData string `json:"custom_data"`
|
|
}
|
|
SubscribeConfig {
|
|
SingleModel bool `json:"single_model"`
|
|
SubscribePath string `json:"subscribe_path"`
|
|
SubscribeDomain string `json:"subscribe_domain"`
|
|
PanDomain bool `json:"pan_domain"`
|
|
UserAgentLimit bool `json:"user_agent_limit"`
|
|
UserAgentList string `json:"user_agent_list"`
|
|
}
|
|
VerifyCodeConfig {
|
|
VerifyCodeExpireTime int64 `json:"verify_code_expire_time"`
|
|
VerifyCodeLimit int64 `json:"verify_code_limit"`
|
|
VerifyCodeInterval int64 `json:"verify_code_interval"`
|
|
}
|
|
PubilcVerifyCodeConfig {
|
|
VerifyCodeInterval int64 `json:"verify_code_interval"`
|
|
}
|
|
SubscribeType {
|
|
SubscribeTypes []string `json:"subscribe_types"`
|
|
}
|
|
Application {
|
|
Id int64 `json:"id"`
|
|
Icon string `json:"icon"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
SubscribeType string `json:"subscribe_type"`
|
|
}
|
|
ApplicationVersion {
|
|
Id int64 `json:"id"`
|
|
Url string `json:"url"`
|
|
Version string `json:"version" validate:"required"`
|
|
Description string `json:"description"`
|
|
IsDefault bool `json:"is_default"`
|
|
}
|
|
ApplicationResponse {
|
|
Applications []ApplicationResponseInfo `json:"applications"`
|
|
}
|
|
ApplicationResponseInfo {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Icon string `json:"icon"`
|
|
Description string `json:"description"`
|
|
SubscribeType string `json:"subscribe_type"`
|
|
Platform ApplicationPlatform `json:"platform"`
|
|
}
|
|
ApplicationPlatform {
|
|
IOS []*ApplicationVersion `json:"ios,omitempty"`
|
|
MacOS []*ApplicationVersion `json:"macos,omitempty"`
|
|
Linux []*ApplicationVersion `json:"linux,omitempty"`
|
|
Android []*ApplicationVersion `json:"android,omitempty"`
|
|
Windows []*ApplicationVersion `json:"windows,omitempty"`
|
|
Harmony []*ApplicationVersion `json:"harmony,omitempty"`
|
|
}
|
|
AuthConfig {
|
|
Mobile MobileAuthenticateConfig `json:"mobile"`
|
|
Email EmailAuthticateConfig `json:"email"`
|
|
Register PubilcRegisterConfig `json:"register"`
|
|
}
|
|
PubilcRegisterConfig {
|
|
StopRegister bool `json:"stop_register"`
|
|
EnableIpRegisterLimit bool `json:"enable_ip_register_limit"`
|
|
IpRegisterLimit int64 `json:"ip_register_limit"`
|
|
IpRegisterLimitDuration int64 `json:"ip_register_limit_duration"`
|
|
}
|
|
MobileAuthenticateConfig {
|
|
Enable bool `json:"enable"`
|
|
EnableWhitelist bool `json:"enable_whitelist"`
|
|
Whitelist []string `json:"whitelist"`
|
|
}
|
|
EmailAuthticateConfig {
|
|
Enable bool `json:"enable"`
|
|
EnableVerify bool `json:"enable_verify"`
|
|
EnableDomainSuffix bool `json:"enable_domain_suffix"`
|
|
DomainSuffixList string `json:"domain_suffix_list"`
|
|
}
|
|
RegisterConfig {
|
|
StopRegister bool `json:"stop_register"`
|
|
EnableTrial bool `json:"enable_trial"`
|
|
TrialSubscribe int64 `json:"trial_subscribe"`
|
|
TrialTime int64 `json:"trial_time"`
|
|
TrialTimeUnit string `json:"trial_time_unit"`
|
|
EnableIpRegisterLimit bool `json:"enable_ip_register_limit"`
|
|
IpRegisterLimit int64 `json:"ip_register_limit"`
|
|
IpRegisterLimitDuration int64 `json:"ip_register_limit_duration"`
|
|
}
|
|
VerifyConfig {
|
|
TurnstileSiteKey string `json:"turnstile_site_key"`
|
|
TurnstileSecret string `json:"turnstile_secret"`
|
|
EnableLoginVerify bool `json:"enable_login_verify"`
|
|
EnableRegisterVerify bool `json:"enable_register_verify"`
|
|
EnableResetPasswordVerify bool `json:"enable_reset_password_verify"`
|
|
}
|
|
NodeConfig {
|
|
NodeSecret string `json:"node_secret"`
|
|
NodePullInterval int64 `json:"node_pull_interval"`
|
|
NodePushInterval int64 `json:"node_push_interval"`
|
|
}
|
|
InviteConfig {
|
|
ForcedInvite bool `json:"forced_invite"`
|
|
ReferralPercentage int64 `json:"referral_percentage"`
|
|
OnlyFirstPurchase bool `json:"only_first_purchase"`
|
|
}
|
|
TelegramConfig {
|
|
TelegramBotToken string `json:"telegram_bot_token"`
|
|
TelegramGroupUrl string `json:"telegram_group_url"`
|
|
TelegramNotify bool `json:"telegram_notify"`
|
|
TelegramWebHookDomain string `json:"telegram_web_hook_domain"`
|
|
}
|
|
TosConfig {
|
|
TosContent string `json:"tos_content"`
|
|
}
|
|
PrivacyPolicyConfig {
|
|
PrivacyPolicy string `json:"privacy_policy"`
|
|
}
|
|
CurrencyConfig {
|
|
AccessKey string `json:"access_key"`
|
|
CurrencyUnit string `json:"currency_unit"`
|
|
CurrencySymbol string `json:"currency_symbol"`
|
|
}
|
|
SubscribeDiscount {
|
|
Quantity int64 `json:"quantity"`
|
|
Discount int64 `json:"discount"`
|
|
}
|
|
Subscribe {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Language string `json:"language"`
|
|
Description string `json:"description"`
|
|
UnitPrice int64 `json:"unit_price"`
|
|
UnitTime string `json:"unit_time"`
|
|
Discount []SubscribeDiscount `json:"discount"`
|
|
Replacement int64 `json:"replacement"`
|
|
Inventory int64 `json:"inventory"`
|
|
Traffic int64 `json:"traffic"`
|
|
SpeedLimit int64 `json:"speed_limit"`
|
|
DeviceLimit int64 `json:"device_limit"`
|
|
Quota int64 `json:"quota"`
|
|
Nodes []int64 `json:"nodes"`
|
|
NodeTags []string `json:"node_tags"`
|
|
Show bool `json:"show"`
|
|
Sell bool `json:"sell"`
|
|
Sort int64 `json:"sort"`
|
|
DeductionRatio int64 `json:"deduction_ratio"`
|
|
AllowDeduction bool `json:"allow_deduction"`
|
|
ResetCycle int64 `json:"reset_cycle"`
|
|
RenewalReset bool `json:"renewal_reset"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
SubscribeGroup {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
Shadowsocks {
|
|
Method string `json:"method" validate:"required"`
|
|
Port int `json:"port" validate:"required"`
|
|
ServerKey string `json:"server_key"`
|
|
}
|
|
Vmess {
|
|
Port int `json:"port" validate:"required"`
|
|
Transport string `json:"transport" validate:"required"`
|
|
TransportConfig TransportConfig `json:"transport_config"`
|
|
Security string `json:"security" validate:"required"`
|
|
SecurityConfig SecurityConfig `json:"security_config"`
|
|
}
|
|
Vless {
|
|
Port int `json:"port" validate:"required"`
|
|
Flow string `json:"flow" validate:"required"`
|
|
Transport string `json:"transport" validate:"required"`
|
|
TransportConfig TransportConfig `json:"transport_config"`
|
|
Security string `json:"security" validate:"required"`
|
|
SecurityConfig SecurityConfig `json:"security_config"`
|
|
}
|
|
Trojan {
|
|
Port int `json:"port" validate:"required"`
|
|
Transport string `json:"transport" validate:"required"`
|
|
TransportConfig TransportConfig `json:"transport_config"`
|
|
Security string `json:"security" validate:"required"`
|
|
SecurityConfig SecurityConfig `json:"security_config"`
|
|
}
|
|
Hysteria2 {
|
|
Port int `json:"port" validate:"required"`
|
|
HopPorts string `json:"hop_ports" validate:"required"`
|
|
HopInterval int `json:"hop_interval" validate:"required"`
|
|
ObfsPassword string `json:"obfs_password" validate:"required"`
|
|
SecurityConfig SecurityConfig `json:"security_config"`
|
|
}
|
|
Tuic {
|
|
Port int `json:"port" validate:"required"`
|
|
DisableSNI bool `json:"disable_sni"`
|
|
ReduceRtt bool `json:"reduce_rtt"`
|
|
UDPRelayMode string `json:"udp_relay_mode"`
|
|
CongestionController string `json:"congestion_controller"`
|
|
SecurityConfig SecurityConfig `json:"security_config"`
|
|
}
|
|
AnyTLS {
|
|
Port int `json:"port" validate:"required"`
|
|
SecurityConfig SecurityConfig `json:"security_config"`
|
|
}
|
|
SecurityConfig {
|
|
SNI string `json:"sni"`
|
|
AllowInsecure *bool `json:"allow_insecure"`
|
|
Fingerprint string `json:"fingerprint"`
|
|
RealityServerAddr string `json:"reality_server_addr"`
|
|
RealityServerPort int `json:"reality_server_port"`
|
|
RealityPrivateKey string `json:"reality_private_key"`
|
|
RealityPublicKey string `json:"reality_public_key"`
|
|
RealityShortId string `json:"reality_short_id"`
|
|
}
|
|
TransportConfig {
|
|
Path string `json:"path"`
|
|
Host string `json:"host"`
|
|
ServiceName string `json:"service_name"`
|
|
}
|
|
// Server {
|
|
// Id int64 `json:"id"`
|
|
// Tags []string `json:"tags"`
|
|
// Country string `json:"country"`
|
|
// City string `json:"city"`
|
|
// Name string `json:"name"`
|
|
// ServerAddr string `json:"server_addr"`
|
|
// RelayMode string `json:"relay_mode"`
|
|
// RelayNode []NodeRelay `json:"relay_node"`
|
|
// SpeedLimit int `json:"speed_limit"`
|
|
// TrafficRatio float32 `json:"traffic_ratio"`
|
|
// GroupId int64 `json:"group_id"`
|
|
// Protocol string `json:"protocol"`
|
|
// Config interface{} `json:"config"`
|
|
// Enable *bool `json:"enable"`
|
|
// CreatedAt int64 `json:"created_at"`
|
|
// UpdatedAt int64 `json:"updated_at"`
|
|
// Status *NodeStatus `json:"status"`
|
|
// Sort int64 `json:"sort"`
|
|
// }
|
|
// OnlineUser {
|
|
// SID int64 `json:"uid"`
|
|
// IP string `json:"ip"`
|
|
// }
|
|
// NodeStatus {
|
|
// Online interface{} `json:"online"`
|
|
// Cpu float64 `json:"cpu"`
|
|
// Mem float64 `json:"mem"`
|
|
// Disk float64 `json:"disk"`
|
|
// UpdatedAt int64 `json:"updated_at"`
|
|
// }
|
|
ServerGroup {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Description string `json:"description"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
PaymentMethod {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Platform string `json:"platform"`
|
|
Description string `json:"description"`
|
|
Icon string `json:"icon"`
|
|
FeeMode uint `json:"fee_mode"`
|
|
FeePercent int64 `json:"fee_percent"`
|
|
FeeAmount int64 `json:"fee_amount"`
|
|
}
|
|
PaymentConfig {
|
|
Id int64 `json:"id" validate:"required"`
|
|
Name string `json:"name" validate:"required"`
|
|
Platform string `json:"platform" validate:"required"`
|
|
Description string `json:"description"`
|
|
Icon string `json:"icon,omitempty"`
|
|
Domain string `json:"domain,omitempty"`
|
|
Config interface{} `json:"config" validate:"required"`
|
|
FeeMode uint `json:"fee_mode"`
|
|
FeePercent int64 `json:"fee_percent,omitempty"`
|
|
FeeAmount int64 `json:"fee_amount,omitempty"`
|
|
Enable *bool `json:"enable" validate:"required"`
|
|
}
|
|
PaymentMethodDetail {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Platform string `json:"platform"`
|
|
Description string `json:"description"`
|
|
Icon string `json:"icon"`
|
|
Domain string `json:"domain"`
|
|
Config interface{} `json:"config"`
|
|
FeeMode uint `json:"fee_mode"`
|
|
FeePercent int64 `json:"fee_percent"`
|
|
FeeAmount int64 `json:"fee_amount"`
|
|
Enable bool `json:"enable"`
|
|
NotifyURL string `json:"notify_url"`
|
|
}
|
|
Order {
|
|
Id int64 `json:"id"`
|
|
UserId int64 `json:"user_id"`
|
|
OrderNo string `json:"order_no"`
|
|
Type uint8 `json:"type"`
|
|
Quantity int64 `json:"quantity"`
|
|
Price int64 `json:"price"`
|
|
Amount int64 `json:"amount"`
|
|
GiftAmount int64 `json:"gift_amount"`
|
|
Discount int64 `json:"discount"`
|
|
Coupon string `json:"coupon"`
|
|
CouponDiscount int64 `json:"coupon_discount"`
|
|
Commission int64 `json:"commission,omitempty"`
|
|
Payment PaymentMethod `json:"payment"`
|
|
FeeAmount int64 `json:"fee_amount"`
|
|
TradeNo string `json:"trade_no"`
|
|
Status uint8 `json:"status"`
|
|
SubscribeId int64 `json:"subscribe_id"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
OrderDetail {
|
|
Id int64 `json:"id"`
|
|
UserId int64 `json:"user_id"`
|
|
OrderNo string `json:"order_no"`
|
|
Type uint8 `json:"type"`
|
|
Quantity int64 `json:"quantity"`
|
|
Price int64 `json:"price"`
|
|
Amount int64 `json:"amount"`
|
|
GiftAmount int64 `json:"gift_amount"`
|
|
Discount int64 `json:"discount"`
|
|
Coupon string `json:"coupon"`
|
|
CouponDiscount int64 `json:"coupon_discount"`
|
|
Commission int64 `json:"commission,omitempty"`
|
|
Payment PaymentMethod `json:"payment"`
|
|
Method string `json:"method"`
|
|
FeeAmount int64 `json:"fee_amount"`
|
|
TradeNo string `json:"trade_no"`
|
|
Status uint8 `json:"status"`
|
|
SubscribeId int64 `json:"subscribe_id"`
|
|
Subscribe Subscribe `json:"subscribe"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
Document {
|
|
Id int64 `json:"id"`
|
|
Title string `json:"title"`
|
|
Content string `json:"content"`
|
|
Tags []string `json:"tags"`
|
|
Show bool `json:"show"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
Coupon {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Code string `json:"code"`
|
|
Count int64 `json:"count"`
|
|
Type uint8 `json:"type"`
|
|
Discount int64 `json:"discount"`
|
|
StartTime int64 `json:"start_time"`
|
|
ExpireTime int64 `json:"expire_time"`
|
|
UserLimit int64 `json:"user_limit"`
|
|
Subscribe []int64 `json:"subscribe"`
|
|
UsedCount int64 `json:"used_count"`
|
|
Enable bool `json:"enable"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
Announcement {
|
|
Id int64 `json:"id"`
|
|
Title string `json:"title"`
|
|
Content string `json:"content"`
|
|
Show *bool `json:"show"`
|
|
Pinned *bool `json:"pinned"`
|
|
Popup *bool `json:"popup"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
UserSubscribe {
|
|
Id int64 `json:"id"`
|
|
UserId int64 `json:"user_id"`
|
|
OrderId int64 `json:"order_id"`
|
|
SubscribeId int64 `json:"subscribe_id"`
|
|
Subscribe Subscribe `json:"subscribe"`
|
|
StartTime int64 `json:"start_time"`
|
|
ExpireTime int64 `json:"expire_time"`
|
|
FinishedAt int64 `json:"finished_at"`
|
|
ResetTime int64 `json:"reset_time"`
|
|
Traffic int64 `json:"traffic"`
|
|
Download int64 `json:"download"`
|
|
Upload int64 `json:"upload"`
|
|
Token string `json:"token"`
|
|
Status uint8 `json:"status"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
UserAffiliate {
|
|
Avatar string `json:"avatar"`
|
|
Identifier string `json:"identifier"`
|
|
RegisteredAt int64 `json:"registered_at"`
|
|
Enable bool `json:"enable"`
|
|
}
|
|
SortItem {
|
|
Id int64 `json:"id" validate:"required"`
|
|
Sort int64 `json:"sort" validate:"required"`
|
|
}
|
|
TimePeriod {
|
|
StartTime string `json:"start_time"`
|
|
EndTime string `json:"end_time"`
|
|
Multiplier float32 `json:"multiplier"`
|
|
}
|
|
NodeRelay {
|
|
Host string `json:"host"`
|
|
Port int `json:"port"`
|
|
Prefix string `json:"prefix"`
|
|
}
|
|
UserDevice {
|
|
Id int64 `json:"id"`
|
|
Ip string `json:"ip"`
|
|
Identifier string `json:"identifier"`
|
|
UserAgent string `json:"user_agent"`
|
|
Online bool `json:"online"`
|
|
Enabled bool `json:"enabled"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
UserAuthMethod {
|
|
AuthType string `json:"auth_type"`
|
|
AuthIdentifier string `json:"auth_identifier"`
|
|
Verified bool `json:"verified"`
|
|
}
|
|
AuthMethodConfig {
|
|
Id int64 `json:"id"`
|
|
Method string `json:"method"`
|
|
Config interface{} `json:"config"`
|
|
Enabled bool `json:"enabled"`
|
|
}
|
|
TrafficLog {
|
|
Id int64 `json:"id"`
|
|
ServerId int64 `json:"server_id"`
|
|
UserId int64 `json:"user_id"`
|
|
SubscribeId int64 `json:"subscribe_id"`
|
|
Download int64 `json:"download"`
|
|
Upload int64 `json:"upload"`
|
|
Timestamp int64 `json:"timestamp"`
|
|
}
|
|
ServerRuleGroup {
|
|
Id int64 `json:"id"`
|
|
Icon string `json:"icon"`
|
|
Name string `json:"name" validate:"required"`
|
|
Type string `json:"type"`
|
|
Tags []string `json:"tags"`
|
|
Rules string `json:"rules"`
|
|
Enable bool `json:"enable"`
|
|
Default bool `json:"default"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
UserSubscribeLog {
|
|
Id int64 `json:"id"`
|
|
UserId int64 `json:"user_id"`
|
|
UserSubscribeId int64 `json:"user_subscribe_id"`
|
|
Token string `json:"token"`
|
|
IP string `json:"ip"`
|
|
UserAgent string `json:"user_agent"`
|
|
Timestamp int64 `json:"timestamp"`
|
|
}
|
|
UserLoginLog {
|
|
Id int64 `json:"id"`
|
|
UserId int64 `json:"user_id"`
|
|
LoginIP string `json:"login_ip"`
|
|
UserAgent string `json:"user_agent"`
|
|
Success bool `json:"success"`
|
|
Timestamp int64 `json:"timestamp"`
|
|
}
|
|
MessageLog {
|
|
Id int64 `json:"id"`
|
|
Type uint8 `json:"type"`
|
|
Platform string `json:"platform"`
|
|
To string `json:"to"`
|
|
Subject string `json:"subject"`
|
|
Content interface{} `json:"content"`
|
|
Status uint8 `json:"status"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
}
|
|
Ads {
|
|
Id int `json:"id"`
|
|
Title string `json:"title"`
|
|
Type string `json:"type"`
|
|
Content string `json:"content"`
|
|
Description string `json:"description"`
|
|
TargetURL string `json:"target_url"`
|
|
StartTime int64 `json:"start_time"`
|
|
EndTime int64 `json:"end_time"`
|
|
Status int `json:"status"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
//public order
|
|
PurchaseOrderRequest {
|
|
SubscribeId int64 `json:"subscribe_id"`
|
|
Quantity int64 `json:"quantity" validate:"required,gt=0"`
|
|
Payment int64 `json:"payment,omitempty"`
|
|
Coupon string `json:"coupon,omitempty"`
|
|
}
|
|
PreOrderResponse {
|
|
Price int64 `json:"price"`
|
|
Amount int64 `json:"amount"`
|
|
Discount int64 `json:"discount"`
|
|
GiftAmount int64 `json:"gift_amount"`
|
|
Coupon string `json:"coupon"`
|
|
CouponDiscount int64 `json:"coupon_discount"`
|
|
FeeAmount int64 `json:"fee_amount"`
|
|
}
|
|
PurchaseOrderResponse {
|
|
OrderNo string `json:"order_no"`
|
|
}
|
|
RenewalOrderRequest {
|
|
UserSubscribeID int64 `json:"user_subscribe_id"`
|
|
Quantity int64 `json:"quantity"`
|
|
Payment int64 `json:"payment"`
|
|
Coupon string `json:"coupon,omitempty"`
|
|
}
|
|
RenewalOrderResponse {
|
|
OrderNo string `json:"order_no"`
|
|
}
|
|
ResetTrafficOrderRequest {
|
|
UserSubscribeID int64 `json:"user_subscribe_id"`
|
|
Payment int64 `json:"payment"`
|
|
}
|
|
ResetTrafficOrderResponse {
|
|
OrderNo string `json:"order_no"`
|
|
}
|
|
RechargeOrderRequest {
|
|
Amount int64 `json:"amount"`
|
|
Payment int64 `json:"payment"`
|
|
}
|
|
RechargeOrderResponse {
|
|
OrderNo string `json:"order_no"`
|
|
}
|
|
PreRenewalOrderResponse {
|
|
OrderNo string `json:"orderNo"`
|
|
}
|
|
CloseOrderRequest {
|
|
OrderNo string `json:"orderNo" validate:"required"`
|
|
}
|
|
QueryOrderDetailRequest {
|
|
OrderNo string `form:"order_no" validate:"required"`
|
|
}
|
|
StripePayment {
|
|
Method string `json:"method"`
|
|
ClientSecret string `json:"client_secret"`
|
|
PublishableKey string `json:"publishable_key"`
|
|
}
|
|
QueryOrderListRequest {
|
|
Page int `form:"page" validate:"required"`
|
|
Size int `form:"size" validate:"required"`
|
|
}
|
|
QueryOrderListResponse {
|
|
Total int64 `json:"total"`
|
|
List []OrderDetail `json:"list"`
|
|
}
|
|
//public document
|
|
QueryDocumentListResponse {
|
|
Total int64 `json:"total"`
|
|
List []Document `json:"list"`
|
|
}
|
|
QueryDocumentDetailRequest {
|
|
Id int64 `form:"id" validate:"required"`
|
|
}
|
|
// public payment
|
|
GetAvailablePaymentMethodsResponse {
|
|
List []PaymentMethod `json:"list"`
|
|
}
|
|
// public announcement
|
|
QueryAnnouncementRequest {
|
|
Page int `form:"page"`
|
|
Size int `form:"size"`
|
|
Pinned *bool `form:"pinned"`
|
|
Popup *bool `form:"popup"`
|
|
}
|
|
QueryAnnouncementResponse {
|
|
Total int64 `json:"total"`
|
|
List []Announcement `json:"announcements"`
|
|
}
|
|
//subscribe
|
|
QuerySubscribeListResponse {
|
|
List []Subscribe `json:"list"`
|
|
Total int64 `json:"total"`
|
|
}
|
|
QuerySubscribeGroupListResponse {
|
|
List []SubscribeGroup `json:"list"`
|
|
Total int64 `json:"total"`
|
|
}
|
|
GetUserSubscribeTrafficLogsRequest {
|
|
Page int `form:"page"`
|
|
Size int `form:"size"`
|
|
UserId int64 `form:"user_id"`
|
|
SubscribeId int64 `form:"subscribe_id"`
|
|
StartTime int64 `form:"start_time"`
|
|
EndTime int64 `form:"end_time"`
|
|
}
|
|
GetUserSubscribeTrafficLogsResponse {
|
|
List []TrafficLog `json:"list"`
|
|
Total int64 `json:"total"`
|
|
}
|
|
QueryUserAffiliateListResponse {
|
|
List []UserAffiliate `json:"list"`
|
|
Total int64 `json:"total"`
|
|
}
|
|
PlatformResponse {
|
|
List []PlatformInfo `json:"list"`
|
|
}
|
|
PlatformInfo {
|
|
Platform string `json:"platform"`
|
|
PlatformUrl string `json:"platform_url"`
|
|
PlatformFieldDescription map[string]string `json:"platform_field_description"`
|
|
}
|
|
AlipayNotifyResponse {
|
|
ReturnCode string `json:"return_code"`
|
|
}
|
|
EPayNotifyRequest {
|
|
Pid int64 `json:"pid" form:"pid"`
|
|
TradeNo string `json:"trade_no" form:"trade_no"`
|
|
OutTradeNo string `json:"out_trade_no" form:"out_trade_no"`
|
|
Type string `json:"type" form:"type"`
|
|
Name string `json:"name" form:"name"`
|
|
Money string `json:"money" form:"money"`
|
|
TradeStatus string `json:"trade_status" form:"trade_status"`
|
|
Param string `json:"param" form:"param"`
|
|
Sign string `json:"sign" form:"sign"`
|
|
SignType string `json:"sign_type" form:"sign_type"`
|
|
}
|
|
QueryUserAffiliateListRequest {
|
|
Page int `form:"page"`
|
|
Size int `form:"size"`
|
|
}
|
|
CheckoutOrderRequest {
|
|
OrderNo string `json:"orderNo"`
|
|
ReturnUrl string `json:"returnUrl,omitempty"`
|
|
}
|
|
CheckoutOrderResponse {
|
|
Type string `json:"type"`
|
|
CheckoutUrl string `json:"checkout_url,omitempty"`
|
|
Stripe *StripePayment `json:"stripe,omitempty"`
|
|
}
|
|
SiteCustomDataContacts {
|
|
Email string `json:"email"`
|
|
Telephone string `json:"telephone"`
|
|
Address string `json:"address"`
|
|
}
|
|
QueryUserAffiliateCountResponse {
|
|
Registers int64 `json:"registers"`
|
|
TotalCommission int64 `json:"total_commission"`
|
|
}
|
|
AppUserSubcbribe {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Upload int64 `json:"upload"`
|
|
Traffic int64 `json:"traffic"`
|
|
Download int64 `json:"download"`
|
|
DeviceLimit int64 `json:"device_limit"`
|
|
StartTime string `json:"start_time"`
|
|
ExpireTime string `json:"expire_time"`
|
|
List []AppUserSubscbribeNode `json:"list"`
|
|
}
|
|
AppUserSubscbribeNode {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Uuid string `json:"uuid"`
|
|
Protocol string `json:"protocol"`
|
|
RelayMode string `json:"relay_mode"`
|
|
RelayNode string `json:"relay_node"`
|
|
ServerAddr string `json:"server_addr"`
|
|
SpeedLimit int `json:"speed_limit"`
|
|
Tags []string `json:"tags"`
|
|
Traffic int64 `json:"traffic"`
|
|
TrafficRatio float64 `json:"traffic_ratio"`
|
|
Upload int64 `json:"upload"`
|
|
Config string `json:"config"`
|
|
Country string `json:"country"`
|
|
City string `json:"city"`
|
|
Latitude string `json:"latitude"`
|
|
Longitude string `json:"longitude"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
Download int64 `json:"download"`
|
|
}
|
|
DownloadLink {
|
|
IOS string `json:"ios,omitempty"`
|
|
Android string `json:"android,omitempty"`
|
|
Windows string `json:"windows,omitempty"`
|
|
Mac string `json:"mac,omitempty"`
|
|
Linux string `json:"linux,omitempty"`
|
|
Harmony string `json:"harmony,omitempty"`
|
|
}
|
|
ResetSubscribeTrafficLog {
|
|
Id int64 `json:"id"`
|
|
Type uint16 `json:"type"`
|
|
UserSubscribeId int64 `json:"user_subscribe_id"`
|
|
OrderNo string `json:"order_no,omitempty"`
|
|
Timestamp int64 `json:"timestamp"`
|
|
}
|
|
BalanceLog {
|
|
Type uint16 `json:"type"`
|
|
UserId int64 `json:"user_id"`
|
|
Amount int64 `json:"amount"`
|
|
OrderNo string `json:"order_no,omitempty"`
|
|
Balance int64 `json:"balance"`
|
|
Timestamp int64 `json:"timestamp"`
|
|
}
|
|
CommissionLog {
|
|
Type uint16 `json:"type"`
|
|
UserId int64 `json:"user_id"`
|
|
Amount int64 `json:"amount"`
|
|
OrderNo string `json:"order_no"`
|
|
Timestamp int64 `json:"timestamp"`
|
|
}
|
|
Protocol {
|
|
Type string `json:"type"`
|
|
Port uint16 `json:"port"`
|
|
Security string `json:"security,omitempty"`
|
|
SNI string `json:"sni,omitempty"`
|
|
AllowInsecure bool `json:"allow_insecure,omitempty"`
|
|
Fingerprint string `json:"fingerprint,omitempty"`
|
|
RealityServerAddr string `json:"reality_server_addr,omitempty"`
|
|
RealityServerPort int `json:"reality_server_port,omitempty"`
|
|
RealityPrivateKey string `json:"reality_private_key,omitempty"`
|
|
RealityPublicKey string `json:"reality_public_key,omitempty"`
|
|
RealityShortId string `json:"reality_short_id,omitempty"`
|
|
Transport string `json:"transport,omitempty"`
|
|
Host string `json:"host,omitempty"`
|
|
Path string `json:"path,omitempty"`
|
|
ServiceName string `json:"service_name,omitempty"`
|
|
Cipher string `json:"cipher,omitempty"`
|
|
ServerKey string `json:"server_key,omitempty"`
|
|
Flow string `json:"flow,omitempty"`
|
|
HopPorts string `json:"hop_ports,omitempty"`
|
|
HopInterval int `json:"hop_interval,omitempty"`
|
|
ObfsPassword string `json:"obfs_password,omitempty"`
|
|
DisableSNI bool `json:"disable_sni,omitempty"`
|
|
ReduceRtt bool `json:"reduce_rtt,omitempty"`
|
|
UDPRelayMode string `json:"udp_relay_mode,omitempty"`
|
|
CongestionController string `json:"congestion_controller,omitempty"`
|
|
Plugin string `json:"plugin,omitempty"` // obfs, none,v2ray-plugin, simple-obfs
|
|
PluginOptions string `json:"plugin_options,omitempty"` // plugin options, eg: obfs=http;obfs-host=www.bing.com
|
|
Multiplex string `json:"multiplex,omitempty"` // mux, eg: off/low/medium/high
|
|
PaddingScheme string `json:"padding_scheme,omitempty"` // padding scheme
|
|
UpMbps int `json:"up_mbps,omitempty"` // upload speed limit
|
|
DownMbps int `json:"down_mbps,omitempty"` // download speed limit
|
|
}
|
|
)
|
|
|