package com.hzs.activity.add.controller.manage;


import com.hzs.activity.add.param.AcAddUpgradeListParam;
import com.hzs.activity.add.service.IAcAddUpgradeConfigService;
import com.hzs.activity.add.service.IAcAddUpgradeRecordService;
import com.hzs.activity.add.vo.AcAddUpgradeListVO;
import com.hzs.common.core.annotation.Log;
import com.hzs.common.core.enums.EOperationBusiness;
import com.hzs.common.core.enums.EOperationMethod;
import com.hzs.common.core.enums.EOperationModule;
import com.hzs.common.core.utils.poi.ExcelUtil;
import com.hzs.common.core.web.controller.BaseController;
import com.hzs.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

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

/**
 * <p>
 * 加购活动明细表 前端控制器
 * </p>
 *
 * @author bd
 * @since 2025-10-13
 */
@RestController
@RequestMapping("/manage/addUpgradeRecord")
public class AcAddUpgradeRecordController extends BaseController {

    @Autowired
    private IAcAddUpgradeRecordService acAddUpgradeRecordService;
    /**
     *
     * @param param
     * @return
     */
    @Log(module = EOperationModule.AC_ADD_UPGRADE_LIST, business = EOperationBusiness.AC_ADD_UPGRADE_LIST, method = EOperationMethod.SELECT)
    @GetMapping("/list")
    public TableDataInfo directPushUpgradeList(AcAddUpgradeListParam param) {
        startPage();
        return getDataTable(acAddUpgradeRecordService.queryList(param));
    }

    @Log(module = EOperationModule.AC_ADD_UPGRADE_LIST_EXPORT, business = EOperationBusiness.AC_ADD_UPGRADE_LIST_EXPORT, method = EOperationMethod.SELECT)
    @PostMapping("/listExport")
    public void export(AcAddUpgradeListParam param, HttpServletResponse response) {
        startPage();
        List<AcAddUpgradeListVO> list = acAddUpgradeRecordService.queryList(param);
        ExcelUtil<AcAddUpgradeListVO> util = new ExcelUtil<>(AcAddUpgradeListVO.class);
        util.exportExcel(response, list, "加购升级数据导出");
    }

}
