You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
3.5 KiB
99 lines
3.5 KiB
10 months ago
|
package com.zc.business.controller;
|
||
|
|
||
|
import java.util.List;
|
||
|
import javax.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.ruoyi.common.annotation.Log;
|
||
|
import com.ruoyi.common.core.controller.BaseController;
|
||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||
|
import com.ruoyi.common.enums.BusinessType;
|
||
|
import com.zc.business.domain.DcFileDownload;
|
||
|
import com.zc.business.service.IDcFileDownloadService;
|
||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||
|
|
||
|
/**
|
||
|
* 文件管理Controller
|
||
|
*
|
||
|
* @author ruoyi
|
||
|
* @date 2024-06-12
|
||
|
*/
|
||
|
@RestController
|
||
|
@RequestMapping("/business/download")
|
||
|
public class DcFileDownloadController extends BaseController {
|
||
|
@Autowired
|
||
|
private IDcFileDownloadService dcFileDownloadService;
|
||
|
|
||
|
/**
|
||
|
* 查询文件管理列表
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('business:download:list')")
|
||
|
@GetMapping("/list")
|
||
|
public TableDataInfo list(DcFileDownload dcFileDownload) {
|
||
|
startPage();
|
||
|
List<DcFileDownload> list = dcFileDownloadService.selectDcFileDownloadList(dcFileDownload);
|
||
|
return getDataTable(list);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 导出文件管理列表
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('business:download:export')")
|
||
|
@Log(title = "文件管理", businessType = BusinessType.EXPORT)
|
||
|
@PostMapping("/export")
|
||
|
public void export(HttpServletResponse response, DcFileDownload dcFileDownload) {
|
||
|
List<DcFileDownload> list = dcFileDownloadService.selectDcFileDownloadList(dcFileDownload);
|
||
|
ExcelUtil<DcFileDownload> util = new ExcelUtil<>(DcFileDownload.class);
|
||
|
util.exportExcel(response, list, "文件管理数据");
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 获取文件管理详细信息
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('business:download:query')")
|
||
|
@GetMapping(value = "/{id}")
|
||
|
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||
|
return AjaxResult.success(dcFileDownloadService.selectDcFileDownloadById(id));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 新增文件管理
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('business:download:add')")
|
||
|
@Log(title = "文件管理", businessType = BusinessType.INSERT)
|
||
|
@PostMapping
|
||
|
public AjaxResult add(@RequestBody DcFileDownload dcFileDownload) {
|
||
|
return toAjax(dcFileDownloadService.insertDcFileDownload(dcFileDownload));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 修改文件管理
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('business:download:edit')")
|
||
|
@Log(title = "文件管理", businessType = BusinessType.UPDATE)
|
||
|
@PutMapping
|
||
|
public AjaxResult edit(@RequestBody DcFileDownload dcFileDownload) {
|
||
|
return toAjax(dcFileDownloadService.updateDcFileDownload(dcFileDownload));
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 删除文件管理
|
||
|
*/
|
||
|
@PreAuthorize("@ss.hasPermi('business:download:remove')")
|
||
|
@Log(title = "文件管理", businessType = BusinessType.DELETE)
|
||
|
@DeleteMapping("/{ids}")
|
||
|
public AjaxResult remove(@PathVariable Long[] ids) {
|
||
|
return toAjax(dcFileDownloadService.deleteDcFileDownloadByIds(ids));
|
||
|
}
|
||
|
}
|