文件上传
This commit is contained in:
@@ -84,6 +84,12 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.vetti</groupId>
|
||||
<artifactId>vetti-hotake</artifactId>
|
||||
<version>3.9.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.vetti.web.controller.hotake;
|
||||
|
||||
|
||||
import com.vetti.common.annotation.Log;
|
||||
import com.vetti.common.core.controller.BaseController;
|
||||
import com.vetti.common.core.domain.AjaxResult;
|
||||
import com.vetti.common.core.page.TableDataInfo;
|
||||
import com.vetti.common.enums.BusinessType;
|
||||
import com.vetti.common.utils.poi.ExcelUtil;
|
||||
import com.vetti.hotake.domain.HotakeSysFile;
|
||||
import com.vetti.hotake.domain.dto.HotakeSysFileDto;
|
||||
import com.vetti.hotake.service.IHotakeSysFileService;
|
||||
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 org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文件管理Controller
|
||||
*
|
||||
* @author ID
|
||||
* @date 2025-09-06
|
||||
*/
|
||||
@Api(tags = "文件管理")
|
||||
@RestController
|
||||
@RequestMapping("/hotake/sysFile")
|
||||
public class HotakeSysFileController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IHotakeSysFileService hotakeSysFileService;
|
||||
|
||||
/**
|
||||
* 查询文件管理列表
|
||||
*/
|
||||
@ApiOperation("查询文件管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('command:sysFile:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HotakeSysFile HotakeSysFile) {
|
||||
startPage();
|
||||
List<HotakeSysFileDto> list = hotakeSysFileService.selectHotakeSysFileList(HotakeSysFile);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出文件管理列表
|
||||
*/
|
||||
@ApiOperation("导出文件管理列表")
|
||||
@PreAuthorize("@ss.hasPermi('command:sysFile:export')")
|
||||
@Log(title = "文件管理", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(HotakeSysFile HotakeSysFile) {
|
||||
List<HotakeSysFileDto> list = hotakeSysFileService.selectHotakeSysFileList(HotakeSysFile);
|
||||
ExcelUtil<HotakeSysFileDto> util = new ExcelUtil<HotakeSysFileDto>(HotakeSysFileDto.class);
|
||||
return util.exportExcel(list, "文件管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件管理详细信息
|
||||
*/
|
||||
@ApiOperation("获取文件管理详细信息")
|
||||
@PreAuthorize("@ss.hasPermi('command:sysFile:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(hotakeSysFileService.selectHotakeSysFileById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文件管理
|
||||
*/
|
||||
@ApiOperation("新增文件管理")
|
||||
@PreAuthorize("@ss.hasPermi('command:sysFile:add')")
|
||||
@Log(title = "文件管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestPart("file") MultipartFile file, HotakeSysFile HotakeSysFile) {
|
||||
hotakeSysFileService.insertHotakeSysFile(file, HotakeSysFile);
|
||||
return toAjax(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改文件管理
|
||||
*/
|
||||
@ApiOperation("修改文件管理")
|
||||
@PreAuthorize("@ss.hasPermi('command:sysFile:edit')")
|
||||
@Log(title = "文件管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestPart(name = "file", required = false) MultipartFile file, HotakeSysFile HotakeSysFile) {
|
||||
return toAjax(hotakeSysFileService.updateHotakeSysFile(file, HotakeSysFile));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除文件管理
|
||||
*/
|
||||
@ApiOperation("删除文件管理")
|
||||
@PreAuthorize("@ss.hasPermi('command:sysFile:remove')")
|
||||
@Log(title = "文件管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(hotakeSysFileService.deleteHotakeSysFileByIds(ids));
|
||||
}
|
||||
|
||||
@ApiOperation("禁用文件管理")
|
||||
@PreAuthorize("@ss.hasPermi('command:sysFile:edit')")
|
||||
@Log(title = "文件管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/available/{id}")
|
||||
public AjaxResult availableSysFile(@PathVariable Long id) {
|
||||
return toAjax(hotakeSysFileService.availableSysFile(id));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user