package com.test.test.controller;

import java.util.List;

import com.test.test.domain.UiReport;
import com.test.test.service.IUiReportService;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
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.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.test.common.annotation.Log;
import com.test.common.core.controller.BaseController;
import com.test.common.core.domain.AjaxResult;
import com.test.common.enums.BusinessType;
import com.test.common.utils.poi.ExcelUtil;
import com.test.common.core.page.TableDataInfo;

/**
 * ui报告Controller
 * 
 * @author test
 * @date 2025-04-24
 */
@RestController
@RequestMapping("/test/report")
public class UiReportController extends BaseController
{
    @Autowired
    private IUiReportService uiReportService;

    /**
     * 查询ui报告列表
     */
//    @PreAuthorize("@ss.hasPermi('system:report:list')")
    @GetMapping("/list")
    public TableDataInfo list(UiReport uiReport)
    {
        startPage();
        List<UiReport> list = uiReportService.selectUiReportList(uiReport);
        return getDataTable(list);
    }


    /**
     * 获取ui报告详细信息
     */
//    @PreAuthorize("@ss.hasPermi('system:report:query')")
    @GetMapping(value = "getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(uiReportService.selectUiReportById(id));
    }



    /**
     * 删除ui报告
     */
//    @PreAuthorize("@ss.hasPermi('system:report:remove')")
    @Log(title = "ui报告", businessType = BusinessType.UPDATE)
	@PutMapping("delete/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(uiReportService.deleteUiReportByIds(ids));
    }
}
