|
|
@@ -14,6 +14,7 @@ import com.doc.common.core.controller.BaseController;
|
|
|
import com.doc.common.core.domain.AjaxResult;
|
|
|
import com.doc.common.core.page.TableDataInfo;
|
|
|
import com.doc.common.enums.BusinessType;
|
|
|
+import com.doc.common.enums.EventLevel;
|
|
|
import com.doc.common.utils.SecurityUtils;
|
|
|
import com.doc.common.utils.bean.BeanUtils;
|
|
|
import com.doc.common.utils.file.FileUtils;
|
|
|
@@ -63,6 +64,7 @@ public class DocInfoController extends BaseController {
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation("文件上传-单文件")
|
|
|
+ @Log(title = "文件基本信息表", businessType = BusinessType.INSERT,eventLevel = EventLevel.MIDDLE)
|
|
|
@PostMapping("/upload")
|
|
|
public AjaxResult uploadFile(@ApiParam(value = "文件", required = true) @RequestPart(value = "file") MultipartFile file, @ApiParam(value = "空间ID", required = true) @RequestParam Long spaceId, @ApiParam(value = "目录ID", required = true) @RequestParam Long dirId) {
|
|
|
try {
|
|
|
@@ -83,6 +85,7 @@ public class DocInfoController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation("文件上传-多文件")
|
|
|
@PostMapping("/uploadFiles")
|
|
|
+ @Log(title = "文件基本信息表", businessType = BusinessType.INSERT,eventLevel = EventLevel.MIDDLE)
|
|
|
public AjaxResult uploadFile(@ApiParam(value = "文件", required = true) @RequestPart(value = "files") List<MultipartFile> files, @ApiParam(value = "空间ID", required = true) @RequestParam Long spaceId, @ApiParam(value = "目录ID", required = true) @RequestParam Long dirId) {
|
|
|
try {
|
|
|
mongoService.uploadFiles(files).stream().forEach(vo -> {
|
|
|
@@ -123,6 +126,7 @@ public class DocInfoController extends BaseController {
|
|
|
@ApiImplicitParam(name = "spaceId", value = "空间ID", required = true),
|
|
|
@ApiImplicitParam(name = "dirId", value = "目录ID", required = true)
|
|
|
})
|
|
|
+ @Log(title = "文件基本信息表", businessType = BusinessType.INSERT,eventLevel = EventLevel.MIDDLE)
|
|
|
public AjaxResult create(Long spaceId, Long dirId, String type) {
|
|
|
try {
|
|
|
String filePath = "";
|
|
|
@@ -162,6 +166,7 @@ public class DocInfoController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation("文件移动")
|
|
|
@GetMapping("/move")
|
|
|
+ @Log(title = "文件基本信息表", businessType = BusinessType.UPDATE,eventLevel = EventLevel.MIDDLE)
|
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "docId", value = "文件ID", required = true), @ApiImplicitParam(name = "spaceId", value = "空间ID"), @ApiImplicitParam(name = "dirId", value = "新目录ID", required = true)})
|
|
|
public AjaxResult move(Long docId, Long dirId) {
|
|
|
DocInfo info = docInfoService.selectDocInfoByDocId(docId);
|
|
|
@@ -177,6 +182,7 @@ public class DocInfoController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation("文件复制")
|
|
|
@GetMapping("/copy")
|
|
|
+ @Log(title = "文件基本信息表", businessType = BusinessType.INSERT,eventLevel = EventLevel.MIDDLE)
|
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "docId", value = "文件ID", required = true), @ApiImplicitParam(name = "spaceId", value = "空间ID"), @ApiImplicitParam(name = "dirId", value = "新目录ID", required = true)})
|
|
|
public AjaxResult copy(Long docId, Long spaceId, Long dirId) {
|
|
|
DocInfo info = docInfoService.selectDocInfoByDocId(docId);
|
|
|
@@ -204,6 +210,7 @@ public class DocInfoController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation("文件重命名")
|
|
|
@GetMapping("/rename")
|
|
|
+ @Log(title = "文件基本信息表", businessType = BusinessType.UPDATE,eventLevel = EventLevel.MIDDLE)
|
|
|
@ApiImplicitParams({@ApiImplicitParam(name = "docId", value = "文件ID", required = true), @ApiImplicitParam(name = "name", value = "新文件名", required = true)})
|
|
|
public AjaxResult rename(Long docId, String name) {
|
|
|
DocInfo info = new DocInfo();
|
|
|
@@ -313,7 +320,7 @@ public class DocInfoController extends BaseController {
|
|
|
*/
|
|
|
// @ApiOperation("新增文件基本信息表")
|
|
|
//@PreAuthorize("@ss.hasPermi('biz:info:add')")
|
|
|
- @Log(title = "文件基本信息表", businessType = BusinessType.INSERT)
|
|
|
+ @Log(title = "文件基本信息表", businessType = BusinessType.INSERT,eventLevel = EventLevel.MIDDLE)
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody DocInfo docInfo) {
|
|
|
return toAjax(docInfoService.insertDocInfo(docInfo));
|
|
|
@@ -324,7 +331,7 @@ public class DocInfoController extends BaseController {
|
|
|
*/
|
|
|
// @ApiOperation("修改文件基本信息表")
|
|
|
//@PreAuthorize("@ss.hasPermi('biz:info:edit')")
|
|
|
- @Log(title = "文件基本信息表", businessType = BusinessType.UPDATE)
|
|
|
+ @Log(title = "文件基本信息表", businessType = BusinessType.UPDATE,eventLevel = EventLevel.MIDDLE)
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody DocInfo docInfo) {
|
|
|
docInfo.setUpdateBy(SecurityUtils.getUsername());
|
|
|
@@ -336,7 +343,7 @@ public class DocInfoController extends BaseController {
|
|
|
*/
|
|
|
@ApiOperation("文件删除")
|
|
|
//@PreAuthorize("@ss.hasPermi('biz:info:remove')")
|
|
|
- @Log(title = "文件基本信息表", businessType = BusinessType.DELETE)
|
|
|
+ @Log(title = "文件基本信息表", businessType = BusinessType.DELETE,eventLevel = EventLevel.MIDDLE)
|
|
|
@DeleteMapping("/{docIds}")
|
|
|
public AjaxResult remove(@PathVariable Long[] docIds) {
|
|
|
for (Long docId : docIds) {
|