package card_info_apple

import (
	"context"
	"kami/internal/consts"
	"kami/internal/errHandler"
	"kami/internal/service"

	"kami/api/card_info_apple/v1"

	"github.com/gogf/gf/v2/errors/gcode"
)

func (c *ControllerV1) RechargeStealSetting(ctx context.Context, req *v1.RechargeStealSettingReq) (res *v1.RechargeStealSettingRes, err error) {
	dictService := service.SysConfigDict()
	err = dictService.SetIsStealAppleCard(ctx, req.StealStatus == consts.StealStatusOpen)
	err = errHandler.WrapError(ctx, gcode.CodeOperationFailed, err, "偷卡设置失败")
	return
}
