feat(iap): 移除苹果IAP商品列表接口并添加接入指南文档
Build docker and publish / build (20.15.1) (push) Successful in 6m44s
Build docker and publish / build (20.15.1) (push) Successful in 6m44s
移除不再使用的苹果IAP商品列表相关代码,包括handler、logic和测试文件 新增详细的iOS内购接入指南文档,包含StoreKit2使用流程和接口规范
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
package apple
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/perfect-panel/server/internal/svc"
|
||||
"github.com/perfect-panel/server/internal/types"
|
||||
"github.com/perfect-panel/server/pkg/logger"
|
||||
iapapple "github.com/perfect-panel/server/pkg/iap/apple"
|
||||
)
|
||||
|
||||
type GetProductsLogic struct {
|
||||
logger.Logger
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
}
|
||||
|
||||
func NewGetProductsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetProductsLogic {
|
||||
return &GetProductsLogic{
|
||||
Logger: logger.WithContext(ctx),
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetProductsLogic) GetProducts() (*types.GetAppleProductsResponse, error) {
|
||||
pm, _ := iapapple.ParseProductMap(l.svcCtx.Config.Site.CustomData)
|
||||
resp := &types.GetAppleProductsResponse{
|
||||
List: make([]types.AppleProduct, 0, len(pm.Items)),
|
||||
}
|
||||
for pid, m := range pm.Items {
|
||||
resp.List = append(resp.List, types.AppleProduct{
|
||||
ProductId: pid,
|
||||
Description: m.Description,
|
||||
PriceText: m.PriceText,
|
||||
DurationDays: m.DurationDays,
|
||||
Tier: m.Tier,
|
||||
SubscribeId: m.SubscribeId,
|
||||
})
|
||||
}
|
||||
return resp, nil
|
||||
}
|
||||
Reference in New Issue
Block a user