package com.fs.app.controller;


import com.fs.common.annotation.Log;
import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.core.page.TableDataInfo;
import com.fs.common.enums.BusinessType;
import com.fs.common.utils.poi.ExcelUtil;
import com.fs.sop.domain.QwSopLogsDetalis;
import com.fs.sop.service.IQwSopLogsDetalisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * qwSopLogsDetalisController
 *
 * @author fs
 * @date 2025-02-04
 */
@RestController
@RequestMapping("/qwSop/Detalis")
public class QwSopLogsDetalisController extends BaseController
{
    @Autowired
    private IQwSopLogsDetalisService qwSopLogsDetalisService;

    /**
     * 查询qwSopLogsDetalis列表
     */
    @PreAuthorize("@ss.hasPermi('qwSopLogsDetalis:qwSopLogsDetalis:list')")
    @GetMapping("/list")
    public TableDataInfo list(QwSopLogsDetalis qwSopLogsDetalis)
    {
        startPage();
        List<QwSopLogsDetalis> list = qwSopLogsDetalisService.selectQwSopLogsDetalisList(qwSopLogsDetalis);
        return getDataTable(list);
    }

    /**
     * 导出qwSopLogsDetalis列表
     */
    @PreAuthorize("@ss.hasPermi('qwSopLogsDetalis:qwSopLogsDetalis:export')")
    @Log(title = "qwSopLogsDetalis", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(QwSopLogsDetalis qwSopLogsDetalis)
    {
        List<QwSopLogsDetalis> list = qwSopLogsDetalisService.selectQwSopLogsDetalisList(qwSopLogsDetalis);
        ExcelUtil<QwSopLogsDetalis> util = new ExcelUtil<QwSopLogsDetalis>(QwSopLogsDetalis.class);
        return util.exportExcel(list, "qwSopLogsDetalis数据");
    }

    /**
     * 获取qwSopLogsDetalis详细信息
     */
    @PreAuthorize("@ss.hasPermi('qwSopLogsDetalis:qwSopLogsDetalis:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(qwSopLogsDetalisService.selectQwSopLogsDetalisById(id));
    }

    /**
     * 新增qwSopLogsDetalis
     */
    @PreAuthorize("@ss.hasPermi('qwSopLogsDetalis:qwSopLogsDetalis:add')")
    @Log(title = "qwSopLogsDetalis", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody QwSopLogsDetalis qwSopLogsDetalis)
    {
        return toAjax(qwSopLogsDetalisService.insertQwSopLogsDetalis(qwSopLogsDetalis));
    }

    /**
     * 修改qwSopLogsDetalis
     */
    @PreAuthorize("@ss.hasPermi('qwSopLogsDetalis:qwSopLogsDetalis:edit')")
    @Log(title = "qwSopLogsDetalis", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody QwSopLogsDetalis qwSopLogsDetalis)
    {
        return toAjax(qwSopLogsDetalisService.updateQwSopLogsDetalis(qwSopLogsDetalis));
    }

    /**
     * 删除qwSopLogsDetalis
     */
    @PreAuthorize("@ss.hasPermi('qwSopLogsDetalis:qwSopLogsDetalis:remove')")
    @Log(title = "qwSopLogsDetalis", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(qwSopLogsDetalisService.deleteQwSopLogsDetalisByIds(ids));
    }
}
