package card_info_apple

import (
	"context"
	"kami/api/commonApi"
	"kami/internal/model"
	"kami/internal/model/entity"
	"kami/internal/service"

	"kami/api/card_info_apple/v1"
)

func (c *ControllerV1) RechargeStealRuleList(ctx context.Context, req *v1.RechargeStealRuleListReq) (res *v1.RechargeStealRuleListRes, err error) {
	rechargeService := service.AppleOrder()
	total, list, err := rechargeService.GetStealRuleList(ctx, &model.StealRuleListInput{
		CommonPageReq: req.CommonPageReq,
	})
	if err != nil {
		return
	}
	res = &v1.RechargeStealRuleListRes{
		CommonPageRes: commonApi.CommonPageRes[*entity.V1CardAppleHiddenSettings]{
			Total: total,
			CommonDataRes: commonApi.CommonDataRes[*entity.V1CardAppleHiddenSettings]{
				List: list,
			},
		},
	}
	return
}
