refactor(auth): 优化设备登录逻辑,移除冗余代码并添加设备缓存
Build docker and publish / build (20.15.1) (push) Failing after 6m39s
Build docker and publish / build (20.15.1) (push) Failing after 6m39s
feat(database): 添加用户算法和盐字段的迁移脚本 fix(subscribe): 修复服务器用户列表缓存问题,临时禁用缓存 style(model): 清理用户模型注释,简化代码结构 chore: 删除无用脚本和测试文件 docs: 添加用户绑定流程文档 perf(login): 优化设备登录性能,添加设备缓存键 fix(unbind): 修复设备解绑时的缓存清理逻辑 refactor(verify): 简化邮箱验证逻辑,移除冗余代码 build(docker): 更新Dockerfile配置,使用scratch基础镜像
This commit is contained in:
+44
-41
@@ -178,6 +178,18 @@ type BatchSendEmailTask struct {
|
||||
UpdatedAt int64 `json:"updated_at"`
|
||||
}
|
||||
|
||||
type BindEmailWithVerificationRequest struct {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
|
||||
type BindEmailWithVerificationResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Token string `json:"token,omitempty"` // 设备关联后的新Token
|
||||
UserId int64 `json:"user_id,omitempty"` // 目标用户ID
|
||||
}
|
||||
|
||||
type BindOAuthCallbackRequest struct {
|
||||
Method string `json:"method"`
|
||||
Callback interface{} `json:"callback"`
|
||||
@@ -192,10 +204,6 @@ type BindOAuthResponse struct {
|
||||
Redirect string `json:"redirect"`
|
||||
}
|
||||
|
||||
type BindInviteCodeRequest struct {
|
||||
InviteCode string `json:"invite_code" validate:"required"`
|
||||
}
|
||||
|
||||
type BindTelegramResponse struct {
|
||||
Url string `json:"url"`
|
||||
ExpiredAt int64 `json:"expired_at"`
|
||||
@@ -243,6 +251,10 @@ type CommissionLog struct {
|
||||
Timestamp int64 `json:"timestamp"`
|
||||
}
|
||||
|
||||
type BindInviteCodeRequest struct {
|
||||
InviteCode string `json:"invite_code" validate:"required"`
|
||||
}
|
||||
|
||||
type Coupon struct {
|
||||
Id int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
@@ -1174,6 +1186,7 @@ type InviteConfig struct {
|
||||
ForcedInvite bool `json:"forced_invite"`
|
||||
ReferralPercentage int64 `json:"referral_percentage"`
|
||||
OnlyFirstPurchase bool `json:"only_first_purchase"`
|
||||
GiftDays int64 `json:"gift_days"`
|
||||
}
|
||||
|
||||
type KickOfflineRequest struct {
|
||||
@@ -2008,31 +2021,32 @@ type StripePayment struct {
|
||||
}
|
||||
|
||||
type Subscribe struct {
|
||||
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"`
|
||||
NodeCount int64 `json:"node_count"`
|
||||
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"`
|
||||
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"`
|
||||
NodeCount int64 `json:"node_count"`
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
type SubscribeApplication struct {
|
||||
@@ -2639,6 +2653,7 @@ type UserSubscribeNodeInfo struct {
|
||||
Name string `json:"name"`
|
||||
Uuid string `json:"uuid"`
|
||||
Protocol string `json:"protocol"`
|
||||
Protocols string `json:"protocols"`
|
||||
Port uint16 `json:"port"`
|
||||
Address string `json:"address"`
|
||||
Tags []string `json:"tags"`
|
||||
@@ -2695,18 +2710,6 @@ type VerifyEmailRequest struct {
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
|
||||
type BindEmailWithVerificationRequest struct {
|
||||
Email string `json:"email" validate:"required"`
|
||||
Code string `json:"code" validate:"required"`
|
||||
}
|
||||
|
||||
type BindEmailWithVerificationResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Token string `json:"token,omitempty"` // 设备关联后的新Token
|
||||
UserId int64 `json:"user_id,omitempty"` // 目标用户ID
|
||||
}
|
||||
|
||||
type VersionResponse struct {
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user