package com.ruoyi.api;

import com.ruoyi.ai.domain.AiOrder;
import com.ruoyi.ai.service.IAiOrderService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 订单管理Controller
 * 
 * @author shi
 * @date 2025-11-13
 */
@Api(tags = "ai-余额消耗管理")
@RestController
@RequestMapping("/api/order")
public class AiOrderApiController extends BaseController
{
    @Autowired
    private IAiOrderService aiOrderService;

    /**
     * 查询充值管理列表
     */
    @ApiOperation("余额消耗记录")
    @GetMapping("/getAiOrderList")
    public TableDataInfo getAiOrderList(AiOrder aiOrder)
    {
        aiOrder.setUserId(SecurityUtils.getAiUserId());
        aiOrder.setStatus(1);
        startPage();
        List<AiOrder> list = aiOrderService.selectAiOrderList(aiOrder);
        return getDataTable(list);
    }

}
