package jnpf.dmsController.personal; import jnpf.base.ActionResult; import jakarta.validation.Valid; import jnpf.dmsEntity.permission.form.DmsPersonalFolderFavoriteForm; import jnpf.dmsEntity.permission.vo.DmsPersonalFolderAddResultVO; import jnpf.dmsEntity.permission.vo.DmsPersonalFolderFileVO; import jnpf.dmsEntity.permission.vo.DmsPersonalFolderVO; import jnpf.dmsService.DmsPersonalFolderService; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController @RequestMapping("/personal-folders") @RequiredArgsConstructor public class DmsPersonalFolderController { private final DmsPersonalFolderService personalFolderService; @GetMapping("") public ActionResult> folders() { return ActionResult.success(personalFolderService.folders()); } @GetMapping("/{folderType}/files") public ActionResult> files( @PathVariable("folderType") String folderType, @RequestParam(value = "keyword", required = false) String keyword, @RequestParam(value = "pageSize", required = false) Integer pageSize) { return ActionResult.success(personalFolderService.files(folderType, keyword, pageSize)); } @PostMapping("/favorite/files") public ActionResult addFavorite( @RequestBody @Valid DmsPersonalFolderFavoriteForm form) { return ActionResult.success(personalFolderService.addFavoriteSnapshot(form)); } }