feat(iap/apple): 实现苹果IAP非续期订阅功能
Build docker and publish / build (20.15.1) (push) Successful in 6m37s
Build docker and publish / build (20.15.1) (push) Successful in 6m37s
新增苹果IAP相关接口与逻辑,包括产品列表查询、交易绑定、状态查询和恢复购买功能。移除旧的IAP验证逻辑,重构订阅系统以支持苹果IAP交易记录存储和权益计算。 - 新增/pkg/iap/apple包处理JWS解析和产品映射 - 实现GET /products、POST /attach、POST /restore和GET /status接口 - 新增apple_iap_transactions表存储交易记录 - 更新文档说明配置方式和接口规范 - 移除旧的AppleIAP验证和通知处理逻辑
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
"github.com/perfect-panel/server/internal/model/ticket"
|
||||
"github.com/perfect-panel/server/internal/model/traffic"
|
||||
"github.com/perfect-panel/server/internal/model/user"
|
||||
iapapple "github.com/perfect-panel/server/internal/model/iap/apple"
|
||||
"github.com/perfect-panel/server/pkg/limit"
|
||||
"github.com/perfect-panel/server/pkg/nodeMultiplier"
|
||||
"github.com/perfect-panel/server/pkg/orm"
|
||||
@@ -62,6 +63,7 @@ type ServiceContext struct {
|
||||
SubscribeModel subscribe.Model
|
||||
TrafficLogModel traffic.Model
|
||||
AnnouncementModel announcement.Model
|
||||
IAPAppleTransactionModel iapapple.Model
|
||||
|
||||
Restart func() error
|
||||
TelegramBot *tgbotapi.BotAPI
|
||||
@@ -117,6 +119,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
||||
TrafficLogModel: traffic.NewModel(db),
|
||||
AnnouncementModel: announcement.NewModel(db, rds),
|
||||
}
|
||||
srv.IAPAppleTransactionModel = iapapple.NewModel(db, rds)
|
||||
srv.DeviceManager = NewDeviceManager(srv)
|
||||
return srv
|
||||
|
||||
|
||||
Reference in New Issue
Block a user