修复(#104): 修复 goctl 重新生成代码漂移
Build docker and publish / build (20.15.1) (push) Failing after 58s
Build docker and publish / build (20.15.1) (pull_request) Failing after 52s

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
2026-05-27 23:54:26 -07:00
parent 197fed7d12
commit fefbd4f56a
43 changed files with 3001 additions and 1513 deletions
@@ -0,0 +1,52 @@
package common
import (
"github.com/gin-gonic/gin"
commonLogic "github.com/perfect-panel/server/internal/logic/common"
"github.com/perfect-panel/server/internal/svc"
"github.com/perfect-panel/server/internal/types"
"github.com/perfect-panel/server/pkg/constant"
"github.com/perfect-panel/server/pkg/result"
)
func CheckCodeLegacyHandler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
return checkCodeLegacyHandler(svcCtx, false)
}
func CheckCodeLegacyV2Handler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
return checkCodeLegacyHandler(svcCtx, true)
}
func checkCodeLegacyHandler(svcCtx *svc.ServiceContext, consume bool) func(c *gin.Context) {
return func(c *gin.Context) {
var req types.LegacyCheckVerificationCodeRequest
_ = c.ShouldBind(&req)
validateErr := svcCtx.Validate(&req)
if validateErr != nil {
result.ParamErrorResult(c, validateErr)
return
}
normalizedReq, legacyType3Mapped, err := commonLogic.NormalizeLegacyCheckVerificationCodeRequest(&req)
if err != nil {
result.ParamErrorResult(c, err)
return
}
l := commonLogic.NewCheckVerificationCodeLogic(c.Request.Context(), svcCtx)
resp, err := l.CheckVerificationCodeWithBehavior(normalizedReq, commonLogic.VerifyCodeCheckBehavior{
Source: "legacy",
Consume: consume,
LegacyType3Mapped: legacyType3Mapped,
AllowSceneFallback: constant.ParseVerifyType(normalizedReq.Type) != constant.DeleteAccount,
})
legacyResp := &types.LegacyCheckVerificationCodeResponse{}
if resp != nil {
legacyResp.Status = resp.Status
legacyResp.Exist = resp.Status
}
result.HttpResult(c, legacyResp, err)
}
}
@@ -0,0 +1 @@
package common
@@ -0,0 +1 @@
package common
@@ -1,24 +1,24 @@
package common
import (
"github.com/gin-gonic/gin"
"github.com/perfect-panel/server/internal/logic/common"
"github.com/perfect-panel/server/internal/svc"
"github.com/perfect-panel/server/internal/types"
"github.com/perfect-panel/server/pkg/result"
"github.com/gin-gonic/gin"
"github.com/perfect-panel/server/internal/logic/common"
"github.com/perfect-panel/server/internal/svc"
"github.com/perfect-panel/server/internal/types"
"github.com/perfect-panel/server/pkg/result"
)
func ReportLogMessageHandler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
return func(c *gin.Context) {
var req types.ReportLogMessageRequest
_ = c.ShouldBind(&req)
validateErr := svcCtx.Validate(&req)
if validateErr != nil {
result.ParamErrorResult(c, validateErr)
return
}
l := common.NewReportLogMessageLogic(c.Request.Context(), svcCtx)
resp, err := l.ReportLogMessage(&req, c)
result.HttpResult(c, resp, err)
}
return func(c *gin.Context) {
var req types.ReportLogMessageRequest
_ = c.ShouldBind(&req)
validateErr := svcCtx.Validate(&req)
if validateErr != nil {
result.ParamErrorResult(c, validateErr)
return
}
l := common.NewReportLogMessageLogic(c.Request.Context(), svcCtx)
resp, err := l.ReportLogMessage(&req, c)
result.HttpResult(c, resp, err)
}
}
@@ -0,0 +1 @@
package common
@@ -0,0 +1 @@
package common
@@ -0,0 +1,11 @@
package server
import (
"github.com/gin-gonic/gin"
serverhandler "github.com/perfect-panel/server/internal/handler/server"
"github.com/perfect-panel/server/internal/svc"
)
func GetServerConfigHandler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
return serverhandler.GetServerConfigHandler(svcCtx)
}
@@ -0,0 +1,11 @@
package server
import (
"github.com/gin-gonic/gin"
serverhandler "github.com/perfect-panel/server/internal/handler/server"
"github.com/perfect-panel/server/internal/svc"
)
func GetServerUserListHandler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
return serverhandler.GetServerUserListHandler(svcCtx)
}
@@ -0,0 +1,11 @@
package server
import (
"github.com/gin-gonic/gin"
serverhandler "github.com/perfect-panel/server/internal/handler/server"
"github.com/perfect-panel/server/internal/svc"
)
func PushOnlineUsersHandler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
return serverhandler.PushOnlineUsersHandler(svcCtx)
}
@@ -0,0 +1,11 @@
package server
import (
"github.com/gin-gonic/gin"
serverhandler "github.com/perfect-panel/server/internal/handler/server"
"github.com/perfect-panel/server/internal/svc"
)
func QueryServerProtocolConfigHandler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
return serverhandler.QueryServerProtocolConfigHandler(svcCtx)
}
@@ -0,0 +1,11 @@
package server
import (
"github.com/gin-gonic/gin"
serverhandler "github.com/perfect-panel/server/internal/handler/server"
"github.com/perfect-panel/server/internal/svc"
)
func ServerPushStatusHandler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
return serverhandler.ServerPushStatusHandler(svcCtx)
}
@@ -0,0 +1,11 @@
package server
import (
"github.com/gin-gonic/gin"
serverhandler "github.com/perfect-panel/server/internal/handler/server"
"github.com/perfect-panel/server/internal/svc"
)
func ServerPushUserTrafficHandler(svcCtx *svc.ServiceContext) func(c *gin.Context) {
return serverhandler.ServerPushUserTrafficHandler(svcCtx)
}
@@ -0,0 +1 @@
package apple
@@ -0,0 +1 @@
package apple
@@ -0,0 +1 @@
package apple
@@ -0,0 +1 @@
package apple
+2331 -1206
View File
File diff suppressed because it is too large Load Diff
@@ -0,0 +1 @@
package common
@@ -0,0 +1 @@
package common
@@ -0,0 +1 @@
package common
@@ -0,0 +1 @@
package common
@@ -0,0 +1 @@
package server
@@ -0,0 +1 @@
package server
@@ -0,0 +1 @@
package server
@@ -0,0 +1 @@
package server
@@ -0,0 +1 @@
package server
@@ -0,0 +1 @@
package server
@@ -0,0 +1 @@
package apple
@@ -0,0 +1 @@
package apple
@@ -0,0 +1 @@
package apple
@@ -0,0 +1 @@
package apple
+5 -1
View File
@@ -22,6 +22,7 @@ import (
"github.com/perfect-panel/server/internal/handler"
"github.com/perfect-panel/server/internal/middleware"
"github.com/perfect-panel/server/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
type Service struct {
@@ -64,7 +65,10 @@ func initServer(svc *svc.ServiceContext) *gin.Engine {
)
// register handlers
handler.RegisterHandlers(r, svc)
svc.AuthMiddleware = middleware.AuthMiddleware(svc)
svc.DeviceMiddleware = middleware.DeviceMiddleware(svc)
svc.ServerMiddleware = middleware.ServerMiddleware(svc)
handler.RegisterHandlers(rest.NewGinServer(r), svc)
r.StaticFile("/order-recovery.html", "./public/order-recovery.html")
// register subscribe handler
handler.RegisterSubscribeHandlers(r, svc)
+4
View File
@@ -4,6 +4,7 @@ import (
"context"
"time"
"github.com/gin-gonic/gin"
"github.com/perfect-panel/server/internal/model/client"
"github.com/perfect-panel/server/internal/model/node"
"github.com/perfect-panel/server/internal/model/redemption"
@@ -76,6 +77,9 @@ type ServiceContext struct {
NodeMultiplierManager *nodeMultiplier.Manager
AuthLimiter *limit.PeriodLimit
DeviceManager *device.DeviceManager
AuthMiddleware func(c *gin.Context)
DeviceMiddleware func(c *gin.Context)
ServerMiddleware func(c *gin.Context)
}
func NewServiceContext(c config.Config) *ServiceContext {
+264 -270
View File
@@ -3,15 +3,21 @@
package types
import "encoding/json"
type ActivateOrderRequest struct {
OrderNo string `json:"order_no" validate:"required"`
}
type RefundOrderRequest struct {
Id int64 `json:"id" validate:"required"`
Reason string `json:"reason,omitempty" validate:"omitempty,max=500"`
type AdminInvitedUser struct {
Id int64 `json:"id"`
Avatar string `json:"avatar"`
Identifier string `json:"identifier"`
Enable bool `json:"enable"`
CreatedAt int64 `json:"created_at"`
OrderCount int64 `json:"order_count"`
HasPurchased bool `json:"has_purchased"`
InviterCommission int64 `json:"inviter_commission"`
InviterGiftDays int64 `json:"inviter_gift_days"`
InviteeGiftDays int64 `json:"invitee_gift_days"`
}
type Ads struct {
@@ -126,6 +132,10 @@ type ApplicationVersion struct {
IsDefault bool `json:"is_default"`
}
type ApproveWithdrawalRequest struct {
WithdrawalId int64 `json:"withdrawal_id" validate:"required,gt=0"`
}
type AttachAppleTransactionByIdRequest struct {
OrderNo string `json:"order_no" validate:"required"`
TransactionId string `json:"transaction_id" validate:"required"`
@@ -251,6 +261,10 @@ type BindTelegramResponse struct {
ExpiredAt int64 `json:"expired_at"`
}
type CancelWithdrawalRequest struct {
WithdrawalId int64 `json:"withdrawal_id" validate:"required,gt=0"`
}
type CheckUserRequest struct {
Email string `form:"email" validate:"required"`
}
@@ -316,45 +330,6 @@ type ContactRequest struct {
Notes string `json:"notes" validate:"max=2000"`
}
type PromoPrice struct {
Id int64 `json:"id"`
SubscribeId int64 `json:"subscribe_id"`
PromoRuleId int64 `json:"promo_rule_id"`
Quantity int64 `json:"quantity"`
PromoPrice int64 `json:"promo_price"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type PromoPriceItem struct {
SubscribeId int64 `json:"subscribe_id" validate:"required,gt=0"`
Quantity int64 `json:"quantity" validate:"required,gt=0,lte=1000"`
PromoPrice int64 `json:"promo_price" validate:"required,gt=0"`
}
type PromoRule struct {
Id int64 `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Params map[string]interface{} `json:"params"`
Priority int64 `json:"priority"`
Enabled bool `json:"enabled"`
StartTime *int64 `json:"start_time"`
EndTime *int64 `json:"end_time"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type PromoUsage struct {
Id int64 `json:"id"`
UserId int64 `json:"user_id"`
PromoRuleId int64 `json:"promo_rule_id"`
SubscribeId int64 `json:"subscribe_id"`
OrderNo string `json:"order_no"`
PromoPrice int64 `json:"promo_price"`
CreatedAt int64 `json:"created_at"`
}
type Coupon struct {
Id int64 `json:"id"`
Name string `json:"name"`
@@ -414,16 +389,6 @@ type CreateCouponRequest struct {
Enable *bool `json:"enable,omitempty"`
}
type CreatePromoRuleRequest struct {
Name string `json:"name" validate:"required,max=100"`
Type string `json:"type" validate:"required,oneof=new_user inactive_user campaign"`
Params map[string]interface{} `json:"params"`
Priority int64 `json:"priority" validate:"gte=0"`
Enabled *bool `json:"enabled"`
StartTime *int64 `json:"start_time"`
EndTime *int64 `json:"end_time"`
}
type CreateDocumentRequest struct {
Title string `json:"title" validate:"required"`
Content string `json:"content" validate:"required"`
@@ -485,6 +450,16 @@ type CreatePaymentMethodRequest struct {
Enable *bool `json:"enable" validate:"required"`
}
type CreatePromoRuleRequest struct {
Name string `json:"name" validate:"required,max=100"`
Type string `json:"type" validate:"required,oneof=new_user inactive_user campaign"`
Params map[string]interface{} `json:"params"`
Priority int64 `json:"priority" validate:"gte=0"`
Enabled *bool `json:"enabled"`
StartTime *int64 `json:"start_time"`
EndTime *int64 `json:"end_time"`
}
type CreateQuotaTaskRequest struct {
Subscribers []int64 `json:"subscribers"`
IsActive *bool `json:"is_active"`
@@ -668,6 +643,14 @@ type DeletePaymentMethodRequest struct {
Id int64 `json:"id" validate:"required"`
}
type DeletePromoPriceRequest struct {
Id int64 `uri:"id" validate:"required,gt=0"`
}
type DeletePromoRuleRequest struct {
Id int64 `uri:"id" validate:"required,gt=0"`
}
type DeleteRedemptionCodeRequest struct {
Id int64 `json:"id" validate:"required"`
}
@@ -823,14 +806,6 @@ type FamilySummary struct {
UpdatedAt int64 `json:"updated_at"`
}
type FileUploadRequest struct {
BizType string `form:"biz_type" validate:"required"`
}
type FileUploadResponse struct {
Url string `json:"url"`
}
type FileUploadCompleteRequest struct {
FileId string `json:"file_id" validate:"required"`
}
@@ -856,6 +831,14 @@ type FileUploadInitResponse struct {
ExpiredAt int64 `json:"expired_at"`
}
type FileUploadRequest struct {
BizType string `form:"biz_type" validate:"required"`
}
type FileUploadResponse struct {
Url string `json:"url"`
}
type FilterBalanceLogRequest struct {
FilterLogParams
UserId int64 `form:"user_id,optional"`
@@ -876,17 +859,6 @@ type FilterCommissionLogResponse struct {
List []CommissionLog `json:"list"`
}
type FilterOrderRefundLogRequest struct {
FilterLogParams
OrderId int64 `form:"order_id,optional"`
UserId int64 `form:"user_id,optional"`
}
type FilterOrderRefundLogResponse struct {
Total int64 `json:"total"`
List []OrderRefundLog `json:"list"`
}
type FilterEmailLogResponse struct {
Total int64 `json:"total"`
List []MessageLog `json:"list"`
@@ -936,6 +908,17 @@ type FilterNodeListResponse struct {
List []Node `json:"list"`
}
type FilterOrderRefundLogRequest struct {
FilterLogParams
OrderId int64 `form:"order_id,optional"`
UserId int64 `form:"user_id,optional"`
}
type FilterOrderRefundLogResponse struct {
Total int64 `json:"total"`
List []OrderRefundLog `json:"list"`
}
type FilterRegisterLogRequest struct {
FilterLogParams
UserId int64 `form:"user_id,optional"`
@@ -1027,6 +1010,32 @@ type GenerateCaptchaResponse struct {
BlockImage string `json:"block_image,omitempty"`
}
type GetAdminUserInviteListRequest struct {
UserId int64 `form:"user_id" validate:"required"`
Page int `form:"page"`
Size int `form:"size"`
Search string `form:"search"`
Enable *int `form:"enable"`
UserIdSearch int64 `form:"user_id_search"`
}
type GetAdminUserInviteListResponse struct {
Total int64 `json:"total"`
List []AdminInvitedUser `json:"list"`
}
type GetAdminUserInviteStatsRequest struct {
UserId int64 `form:"user_id" validate:"required"`
}
type GetAdminUserInviteStatsResponse struct {
InviteCount int64 `json:"invite_count"`
TotalCommission int64 `json:"total_commission"`
CurrentCommission int64 `json:"current_commission"`
ReferralPercentage uint8 `json:"referral_percentage"`
OnlyFirstPurchase bool `json:"only_first_purchase"`
}
type GetAdsDetailRequest struct {
Id int64 `form:"id"`
}
@@ -1145,48 +1154,6 @@ type GetCouponListResponse struct {
List []Coupon `json:"list"`
}
type GetPromoPriceListRequest struct {
PromoRuleId int64 `form:"promo_rule_id" validate:"required,gt=0"`
Page int64 `form:"page" validate:"required,gt=0"`
Size int64 `form:"size" validate:"required,gt=0,lte=200"`
}
type GetPromoPriceListResponse struct {
Total int64 `json:"total"`
List []PromoPrice `json:"list"`
}
type GetPromoRuleDetailRequest struct {
Id int64 `uri:"id" validate:"required,gt=0"`
}
type GetPromoRuleListRequest struct {
Page int64 `form:"page" validate:"required,gt=0"`
Size int64 `form:"size" validate:"required,gt=0,lte=200"`
Type string `form:"type" validate:"omitempty,oneof=new_user inactive_user campaign"`
Enabled *bool `form:"enabled"`
Search string `form:"search,omitempty"`
}
type GetPromoRuleListResponse struct {
Total int64 `json:"total"`
List []PromoRule `json:"list"`
}
type GetPromoUsageListRequest struct {
Page int64 `form:"page" validate:"required,gt=0"`
Size int64 `form:"size" validate:"required,gt=0,lte=200"`
RuleId int64 `form:"rule_id,omitempty"`
UserId int64 `form:"user_id,omitempty"`
SubscribeId int64 `form:"subscribe_id,omitempty"`
OrderNo string `form:"order_no,omitempty"`
}
type GetPromoUsageListResponse struct {
Total int64 `json:"total"`
List []PromoUsage `json:"list"`
}
type GetDetailRequest struct {
Id int64 `form:"id" validate:"required"`
}
@@ -1327,6 +1294,19 @@ type GetGroupHistoryResponse struct {
List []GroupHistory `json:"list"`
}
type GetInviteManageListRequest struct {
Page int `form:"page"`
Size int `form:"size"`
Search string `form:"search"`
InviterId int64 `form:"inviter_id"`
InviteeId int64 `form:"invitee_id"`
}
type GetInviteManageListResponse struct {
Total int64 `json:"total"`
List []InviteManageRecord `json:"list"`
}
type GetInviteRecordsRequest struct {
Page int `form:"page"`
Size int `form:"size"`
@@ -1339,6 +1319,32 @@ type GetInviteRecordsResponse struct {
List []InviteRecord `json:"list"`
}
type GetLogMessageRawRequest struct {
Id int64 `form:"id" validate:"required"`
}
type GetLogMessageRawResponse struct {
Id int64 `json:"id"`
Platform string `json:"platform"`
AppVersion string `json:"app_version"`
OsName string `json:"os_name"`
OsVersion string `json:"os_version"`
DeviceId string `json:"device_id"`
UserId *int64 `json:"user_id"`
SessionId string `json:"session_id"`
Level uint8 `json:"level"`
ErrorCode string `json:"error_code"`
Message string `json:"message"`
Stack string `json:"stack"`
Context interface{} `json:"context"`
ClientIP string `json:"client_ip"`
UserAgent string `json:"user_agent"`
Locale string `json:"locale"`
Digest string `json:"digest"`
OccurredAt int64 `json:"occurred_at"`
CreatedAt int64 `json:"created_at"`
}
type GetLoginLogRequest struct {
Page int `form:"page"`
Size int `form:"size"`
@@ -1417,6 +1423,48 @@ type GetPreSendEmailCountResponse struct {
Count int64 `json:"count"`
}
type GetPromoPriceListRequest struct {
PromoRuleId int64 `form:"promo_rule_id" validate:"required,gt=0"`
Page int64 `form:"page" validate:"required,gt=0"`
Size int64 `form:"size" validate:"required,gt=0,lte=200"`
}
type GetPromoPriceListResponse struct {
Total int64 `json:"total"`
List []PromoPrice `json:"list"`
}
type GetPromoRuleDetailRequest struct {
Id int64 `uri:"id" validate:"required,gt=0"`
}
type GetPromoRuleListRequest struct {
Page int64 `form:"page" validate:"required,gt=0"`
Size int64 `form:"size" validate:"required,gt=0,lte=200"`
Type string `form:"type" validate:"omitempty,oneof=new_user inactive_user campaign"`
Enabled *bool `form:"enabled"`
Search string `form:"search,omitempty"`
}
type GetPromoRuleListResponse struct {
Total int64 `json:"total"`
List []PromoRule `json:"list"`
}
type GetPromoUsageListRequest struct {
Page int64 `form:"page" validate:"required,gt=0"`
Size int64 `form:"size" validate:"required,gt=0,lte=200"`
RuleId int64 `form:"rule_id,omitempty"`
UserId int64 `form:"user_id,omitempty"`
SubscribeId int64 `form:"subscribe_id,omitempty"`
OrderNo string `form:"order_no,omitempty"`
}
type GetPromoUsageListResponse struct {
Total int64 `json:"total"`
List []PromoUsage `json:"list"`
}
type GetRedemptionCodeListRequest struct {
Page int64 `form:"page" validate:"required"`
Size int64 `form:"size" validate:"required"`
@@ -1708,6 +1756,19 @@ type GetUserTrafficStatsResponse struct {
TotalTraffic int64 `json:"total_traffic"`
}
type GetWithdrawalListRequest struct {
Page int `form:"page"`
Size int `form:"size"`
UserId *int64 `form:"user_id,omitempty"`
Status *uint8 `form:"status,omitempty"`
Method *uint8 `form:"method,omitempty"`
}
type GetWithdrawalListResponse struct {
List []WithdrawalLog `json:"list"`
Total int64 `json:"total"`
}
type GiftLog struct {
Type uint16 `json:"type"`
UserId int64 `json:"user_id"`
@@ -1768,6 +1829,21 @@ type InviteConfig struct {
GiftDays int64 `json:"gift_days"`
}
type InviteManageRecord struct {
InviterId int64 `json:"inviter_id"`
InviterIdentifier string `json:"inviter_identifier"`
InviteeId int64 `json:"invitee_id"`
InviteeIdentifier string `json:"invitee_identifier"`
InviteeAvatar string `json:"invitee_avatar"`
InviteeEnable bool `json:"invitee_enable"`
InvitedAt int64 `json:"invited_at"`
OrderCount int64 `json:"order_count"`
HasPurchased bool `json:"has_purchased"`
InviterCommission int64 `json:"inviter_commission"`
InviterGiftDays int64 `json:"inviter_gift_days"`
InviteeGiftDays int64 `json:"invitee_gift_days"`
}
type InviteRecord struct {
Role string `json:"role"`
PeerHash string `json:"peer_hash"`
@@ -1949,8 +2025,6 @@ type Order struct {
Amount int64 `json:"amount"`
GiftAmount int64 `json:"gift_amount"`
Discount int64 `json:"discount"`
PromoRuleId int64 `json:"promo_rule_id"`
PromoDiscount int64 `json:"promo_discount"`
Coupon string `json:"coupon"`
CouponDiscount int64 `json:"coupon_discount"`
Commission int64 `json:"commission,omitempty"`
@@ -1974,8 +2048,6 @@ type OrderDetail struct {
Amount int64 `json:"amount"`
GiftAmount int64 `json:"gift_amount"`
Discount int64 `json:"discount"`
PromoRuleId int64 `json:"promo_rule_id"`
PromoDiscount int64 `json:"promo_discount"`
Coupon string `json:"coupon"`
CouponDiscount int64 `json:"coupon_discount"`
Commission int64 `json:"commission,omitempty"`
@@ -2158,6 +2230,45 @@ type PrivacyPolicyConfig struct {
PrivacyPolicy string `json:"privacy_policy"`
}
type PromoPrice struct {
Id int64 `json:"id"`
SubscribeId int64 `json:"subscribe_id"`
PromoRuleId int64 `json:"promo_rule_id"`
Quantity int64 `json:"quantity"`
PromoPrice int64 `json:"promo_price"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type PromoPriceItem struct {
SubscribeId int64 `json:"subscribe_id" validate:"required,gt=0"`
Quantity int64 `json:"quantity" validate:"required,gt=0,lte=1000"`
PromoPrice int64 `json:"promo_price" validate:"required,gt=0"`
}
type PromoRule struct {
Id int64 `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Params map[string]interface{} `json:"params"`
Priority int64 `json:"priority"`
Enabled bool `json:"enabled"`
StartTime *int64 `json:"start_time"`
EndTime *int64 `json:"end_time"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type PromoUsage struct {
Id int64 `json:"id"`
UserId int64 `json:"user_id"`
PromoRuleId int64 `json:"promo_rule_id"`
SubscribeId int64 `json:"subscribe_id"`
OrderNo string `json:"order_no"`
PromoPrice int64 `json:"promo_price"`
CreatedAt int64 `json:"created_at"`
}
type Protocol struct {
Type string `json:"type"`
Port uint16 `json:"port"`
@@ -2406,10 +2517,6 @@ type QueryUserSubscribeNodeListResponse struct {
List []UserSubscribeInfo `json:"list"`
}
type CancelWithdrawalRequest struct {
WithdrawalId int64 `json:"withdrawal_id" validate:"required,gt=0"`
}
type QueryWithdrawalLogListRequest struct {
Page int `form:"page"`
Size int `form:"size"`
@@ -2420,28 +2527,6 @@ type QueryWithdrawalLogListResponse struct {
Total int64 `json:"total"`
}
type GetWithdrawalListRequest struct {
Page int `form:"page"`
Size int `form:"size"`
UserId *int64 `form:"user_id,omitempty"`
Status *uint8 `form:"status,omitempty"`
Method *uint8 `form:"method,omitempty"`
}
type GetWithdrawalListResponse struct {
List []WithdrawalLog `json:"list"`
Total int64 `json:"total"`
}
type ApproveWithdrawalRequest struct {
WithdrawalId int64 `json:"withdrawal_id" validate:"required,gt=0"`
}
type RejectWithdrawalRequest struct {
WithdrawalId int64 `json:"withdrawal_id" validate:"required,gt=0"`
Reason string `json:"reason" validate:"required,max=500"`
}
type QuotaTask struct {
Id int64 `json:"id"`
Subscribers []int64 `json:"subscribers"`
@@ -2528,6 +2613,11 @@ type RedemptionRecord struct {
CreatedAt int64 `json:"created_at"`
}
type RefundOrderRequest struct {
Id int64 `json:"id" validate:"required"`
Reason string `json:"reason,omitempty" validate:"omitempty,max=500"`
}
type RegisterConfig struct {
StopRegister bool `json:"stop_register"`
EnableTrial bool `json:"enable_trial"`
@@ -2551,6 +2641,11 @@ type RegisterLog struct {
Timestamp int64 `json:"timestamp"`
}
type RejectWithdrawalRequest struct {
WithdrawalId int64 `json:"withdrawal_id" validate:"required,gt=0"`
Reason string `json:"reason" validate:"required,max=500"`
}
type RemoveFamilyMemberRequest struct {
FamilyId int64 `json:"family_id" validate:"required,gt=0"`
UserId int64 `json:"user_id" validate:"required,gt=0"`
@@ -2809,6 +2904,11 @@ type SetNodeMultiplierRequest struct {
Periods []TimePeriod `json:"periods"`
}
type SetPromoPriceRequest struct {
PromoRuleId int64 `json:"promo_rule_id" validate:"required,gt=0"`
Items []PromoPriceItem `json:"items" validate:"required,min=1,dive"`
}
type Shadowsocks struct {
Method string `json:"method" validate:"required"`
Port int `json:"port" validate:"required"`
@@ -2866,13 +2966,6 @@ type StripePayment struct {
PublishableKey string `json:"publishable_key"`
}
type SubscribePromo struct {
RuleName string `json:"rule_name"`
RuleType string `json:"rule_type"`
PromoPrice int64 `json:"promo_price"`
ExpiresAt int64 `json:"expires_at"`
}
type Subscribe struct {
Id int64 `json:"id"`
Name string `json:"name"`
@@ -2975,6 +3068,13 @@ type SubscribeLog struct {
Timestamp int64 `json:"timestamp"`
}
type SubscribePromo struct {
RuleName string `json:"rule_name"`
RuleType string `json:"rule_type"`
PromoPrice int64 `json:"promo_price"`
ExpiresAt int64 `json:"expires_at"`
}
type SubscribeSortRequest struct {
Sort []SortItem `json:"sort"`
}
@@ -3222,30 +3322,6 @@ type UpdateCouponRequest struct {
Enable *bool `json:"enable,omitempty"`
}
type SetPromoPriceRequest struct {
PromoRuleId int64 `json:"promo_rule_id" validate:"required,gt=0"`
Items []PromoPriceItem `json:"items" validate:"required,min=1,dive"`
}
type DeletePromoPriceRequest struct {
Id int64 `uri:"id" validate:"required,gt=0"`
}
type DeletePromoRuleRequest struct {
Id int64 `uri:"id" validate:"required,gt=0"`
}
type UpdatePromoRuleRequest struct {
Id int64 `uri:"id" validate:"required,gt=0"`
Name string `json:"name" validate:"required,max=100"`
Type string `json:"type" validate:"required,oneof=new_user inactive_user campaign"`
Params map[string]interface{} `json:"params"`
Priority int64 `json:"priority" validate:"gte=0"`
Enabled *bool `json:"enabled"`
StartTime *int64 `json:"start_time"`
EndTime *int64 `json:"end_time"`
}
type UpdateDocumentRequest struct {
Id int64 `json:"id" validate:"required"`
Title string `json:"title" validate:"required"`
@@ -3312,6 +3388,17 @@ type UpdatePaymentMethodRequest struct {
Enable *bool `json:"enable" validate:"required"`
}
type UpdatePromoRuleRequest struct {
Id int64 `uri:"id" validate:"required,gt=0"`
Name string `json:"name" validate:"required,max=100"`
Type string `json:"type" validate:"required,oneof=new_user inactive_user campaign"`
Params map[string]interface{} `json:"params"`
Priority int64 `json:"priority" validate:"gte=0"`
Enabled *bool `json:"enabled"`
StartTime *int64 `json:"start_time"`
EndTime *int64 `json:"end_time"`
}
type UpdateRedemptionCodeRequest struct {
Id int64 `json:"id" validate:"required"`
TotalCount int64 `json:"total_count,omitempty"`
@@ -3470,7 +3557,7 @@ type User struct {
EnableLoginNotify bool `json:"enable_login_notify"`
EnableSubscribeNotify bool `json:"enable_subscribe_notify"`
EnableTradeNotify bool `json:"enable_trade_notify"`
UseStatus bool `json:"use_status"`
UseStatus bool `json:"use_status"` // Whether to show the "bind email to get free trial" prompt
AuthMethods []UserAuthMethod `json:"auth_methods"`
UserDevices []UserDevice `json:"user_devices"`
Rules []string `json:"rules"`
@@ -3787,96 +3874,3 @@ type WithdrawalLog struct {
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type GetAdminUserInviteStatsRequest struct {
UserId int64 `form:"user_id" validate:"required"`
}
type GetAdminUserInviteStatsResponse struct {
InviteCount int64 `json:"invite_count"`
TotalCommission int64 `json:"total_commission"`
CurrentCommission int64 `json:"current_commission"`
ReferralPercentage uint8 `json:"referral_percentage"`
OnlyFirstPurchase bool `json:"only_first_purchase"`
}
type GetAdminUserInviteListRequest struct {
UserId int64 `form:"user_id" validate:"required"`
Page int `form:"page"`
Size int `form:"size"`
Search string `form:"search"`
Enable *int `form:"enable"`
UserIdSearch int64 `form:"user_id_search"`
}
type AdminInvitedUser struct {
Id int64 `json:"id"`
Avatar string `json:"avatar"`
Identifier string `json:"identifier"`
Enable bool `json:"enable"`
CreatedAt int64 `json:"created_at"`
OrderCount int64 `json:"order_count"`
HasPurchased bool `json:"has_purchased"`
InviterCommission int64 `json:"inviter_commission"`
InviterGiftDays int64 `json:"inviter_gift_days"`
InviteeGiftDays int64 `json:"invitee_gift_days"`
}
type GetAdminUserInviteListResponse struct {
Total int64 `json:"total"`
List []AdminInvitedUser `json:"list"`
}
type GetInviteManageListRequest struct {
Page int `form:"page"`
Size int `form:"size"`
Search string `form:"search"`
InviterId int64 `form:"inviter_id"`
InviteeId int64 `form:"invitee_id"`
}
type InviteManageRecord struct {
InviterId int64 `json:"inviter_id"`
InviterIdentifier string `json:"inviter_identifier"`
InviteeId int64 `json:"invitee_id"`
InviteeIdentifier string `json:"invitee_identifier"`
InviteeAvatar string `json:"invitee_avatar"`
InviteeEnable bool `json:"invitee_enable"`
InvitedAt int64 `json:"invited_at"`
OrderCount int64 `json:"order_count"`
HasPurchased bool `json:"has_purchased"`
InviterCommission int64 `json:"inviter_commission"`
InviterGiftDays int64 `json:"inviter_gift_days"`
InviteeGiftDays int64 `json:"invitee_gift_days"`
}
type GetInviteManageListResponse struct {
Total int64 `json:"total"`
List []InviteManageRecord `json:"list"`
}
type GetLogMessageRawRequest struct {
Id int64 `form:"id" validate:"required"`
}
type GetLogMessageRawResponse struct {
Id int64 `json:"id"`
Platform string `json:"platform"`
AppVersion string `json:"app_version"`
OsName string `json:"os_name"`
OsVersion string `json:"os_version"`
DeviceId string `json:"device_id"`
UserId *int64 `json:"user_id"`
SessionId string `json:"session_id"`
Level uint8 `json:"level"`
ErrorCode string `json:"error_code"`
Message string `json:"message"`
Stack string `json:"stack"`
Context json.RawMessage `json:"context"`
ClientIP string `json:"client_ip"`
UserAgent string `json:"user_agent"`
Locale string `json:"locale"`
Digest string `json:"digest"`
OccurredAt int64 `json:"occurred_at"`
CreatedAt int64 `json:"created_at"`
}