刘光辉
昨天 bb638871a7fb692d80f1b7a758f991dc0879002c
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package jnpf.dmsController.filecenter;
 
import jnpf.base.ActionResult;
import jnpf.dmsEntity.permission.vo.DmsCursorPageVO;
import jnpf.dmsEntity.permission.vo.DmsFileCenterItemVO;
import jnpf.dmsService.DmsFileCenterService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.UUID;
 
@RestController
@RequestMapping
@RequiredArgsConstructor
public class FileCenterController {
    private final DmsFileCenterService fileCenterService;
 
    @GetMapping("/folders/root/children")
    public ActionResult<DmsCursorPageVO<DmsFileCenterItemVO>> rootFolders(
            @RequestParam(value = "cursor", required = false) String cursor,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        return ActionResult.success(fileCenterService.rootFolders(cursor, pageSize));
    }
 
    @GetMapping("/folders/{folderId}/children")
    public ActionResult<DmsCursorPageVO<DmsFileCenterItemVO>> childFolders(
            @PathVariable("folderId") UUID folderId,
            @RequestParam(value = "cursor", required = false) String cursor,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        return ActionResult.success(fileCenterService.childFolders(folderId, cursor, pageSize));
    }
 
    @GetMapping("/folders/{folderId}/documents")
    public ActionResult<DmsCursorPageVO<DmsFileCenterItemVO>> currentDocuments(
            @PathVariable("folderId") UUID folderId,
            @RequestParam(value = "cursor", required = false) String cursor,
            @RequestParam(value = "pageSize", required = false) Integer pageSize,
            @RequestParam(value = "keyword", required = false) String keyword) {
        return ActionResult.success(fileCenterService.currentDocuments(folderId, cursor, pageSize, keyword));
    }
 
    @GetMapping("/folders/{folderId}/historical-versions")
    public ActionResult<DmsCursorPageVO<DmsFileCenterItemVO>> historicalVersions(
            @PathVariable("folderId") UUID folderId,
            @RequestParam(value = "cursor", required = false) String cursor,
            @RequestParam(value = "pageSize", required = false) Integer pageSize,
            @RequestParam(value = "keyword", required = false) String keyword) {
        return ActionResult.success(fileCenterService.historicalVersions(folderId, cursor, pageSize, keyword));
    }
 
    @GetMapping("/documents/{documentId}/versions")
    public ActionResult<DmsCursorPageVO<DmsFileCenterItemVO>> documentVersions(
            @PathVariable("documentId") UUID documentId,
            @RequestParam(value = "cursor", required = false) String cursor,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        return ActionResult.success(fileCenterService.documentVersions(documentId, cursor, pageSize));
    }
 
    @GetMapping("/shared-documents")
    public ActionResult<DmsCursorPageVO<DmsFileCenterItemVO>> sharedDocuments(
            @RequestParam(value = "center", required = false) String center,
            @RequestParam(value = "cursor", required = false) String cursor,
            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        return ActionResult.success(fileCenterService.sharedDocuments(center, cursor, pageSize));
    }
}