SysFileController.java
1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.glsx.smart.controller;
import com.glsx.smart.dao.entity.SmartSysFile;
import com.glsx.smart.service.SmartSysFileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-03-15
*/
@Slf4j
@RestController
@RequestMapping("/sysFile")
public class SysFileController {
@Autowired
private SmartSysFileService sysFileService;
@RequestMapping(value = "/uploadFile", method = {RequestMethod.POST})
public void uploadFile(@RequestPart(name = "file") MultipartFile file) {
}
@RequestMapping(value = "/updateFile", method = {RequestMethod.POST})
public void updateFile(SmartSysFile sysFile) {
// 实现流程:
// 1、根据 sysFile.id 获取数据库原来的文件记录;
// 2、删除对应 url 的文件;
// 3、更新传来的文件信息到数据库中。
}
}