package com.ruoyi.api;

import com.ruoyi.ai.domain.AiRechargeGift;
import com.ruoyi.ai.domain.AiRechargeGiftGear;
import com.ruoyi.ai.service.IAiRechargeGiftGearService;
import com.ruoyi.ai.service.IAiRechargeGiftService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 充值赠送活动Controller
 *
 * @author shi
 * @date 2025-11-20
 */
@RestController
@RequestMapping("/api/gift")
public class AiRechargeGiftApiController extends BaseController {
    @Autowired
    private IAiRechargeGiftService rechargeGiftService;
    @Autowired
    private IAiRechargeGiftGearService aiRechargeGiftGearService;

    /**
     * 查询充值赠送活动列表
     */
    @ApiOperation("查询充值档位列表")
    @GetMapping("/getGiftList")
    @Anonymous
    public AjaxResult getGiftList() {
        AiRechargeGift aiRechargeGift = new AiRechargeGift();
        aiRechargeGift.setStatus(0);
        List<AiRechargeGift> aiRechargeGifts = rechargeGiftService.selectAiRechargeGiftList(aiRechargeGift);
        return AjaxResult.success(aiRechargeGifts);
    }

    /**
     * 查询充值赠送活动挡位
     */
    @ApiOperation("查询充值档位列表")
    @GetMapping("/getGiftInfo")
    @Anonymous
    public AjaxResult getGiftInfo(Long rechargeId) {
        AiRechargeGiftGear aiRechargeGiftGear = new AiRechargeGiftGear();
        aiRechargeGiftGear.setRechargeId(rechargeId);
        List<AiRechargeGiftGear> aiRechargeGiftGears = aiRechargeGiftGearService.selectAiRechargeGiftGearList(aiRechargeGiftGear);
        return AjaxResult.success(aiRechargeGiftGears);
    }

}
