|
@@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
|
|
import lombok.extern.log4j.Log4j2;
|
|
import lombok.extern.log4j.Log4j2;
|
|
import org.apache.shiro.authz.annotation.RequiresRoles;
|
|
import org.apache.shiro.authz.annotation.RequiresRoles;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.data.domain.Page;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
@@ -60,25 +61,19 @@ public class DemController {
|
|
public R list(@RequestBody PageDto param, HttpServletRequest req) {
|
|
public R list(@RequestBody PageDto param, HttpServletRequest req) {
|
|
String token = req.getHeader("Authorization");
|
|
String token = req.getHeader("Authorization");
|
|
|
|
|
|
-// Page<OutputFileEntity> page = demServer.findByList(TypeCode.FILE_TYPE_DEM, param, token);
|
|
|
|
-// return new R(200, page);
|
|
|
|
|
|
+ Page<OutputFileEntity> page = demServer.findByList(TypeCode.FILE_TYPE_DEM, param, token);
|
|
|
|
+ return new R(200, page);
|
|
|
|
|
|
- return demServer.findByType(TypeCode.FILE_TYPE_DEM, param);
|
|
|
|
|
|
+// return demServer.findByType(TypeCode.FILE_TYPE_DEM, param);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-// @ApiOperation("进度查询")
|
|
|
|
-// @GetMapping("progress/{fileId}/")
|
|
|
|
-// public R getProgress(@PathVariable("fileId") Long fileId) {
|
|
|
|
-// OutputFileEntity entity = demServer.findById(fileId);
|
|
|
|
-// return new R(200, entity);
|
|
|
|
-// }
|
|
|
|
|
|
|
|
- @GetMapping("test")
|
|
|
|
- public R test(){
|
|
|
|
-// demServer.test();
|
|
|
|
- return new R(200,"1111");
|
|
|
|
- }
|
|
|
|
|
|
+// @GetMapping("test")
|
|
|
|
+// public R test(){
|
|
|
|
+//// demServer.test();
|
|
|
|
+// return new R(200,"1111");
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
@ApiOperation("删除文件")
|
|
@ApiOperation("删除文件")
|
|
@@ -89,7 +84,7 @@ public class DemController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-// @RequiresRoles("admin")
|
|
|
|
|
|
+ @RequiresRoles("admin")
|
|
@ApiOperation("移动数据到服务器上")
|
|
@ApiOperation("移动数据到服务器上")
|
|
@PostMapping("move/{fileId}/")
|
|
@PostMapping("move/{fileId}/")
|
|
public R moveFile(@PathVariable("fileId") Long fileId, @RequestBody ConfigJsonDto param) {
|
|
public R moveFile(@PathVariable("fileId") Long fileId, @RequestBody ConfigJsonDto param) {
|
|
@@ -98,5 +93,13 @@ public class DemController {
|
|
return demServer.moveFileToServer(fileId, param);
|
|
return demServer.moveFileToServer(fileId, param);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @RequiresRoles("admin")
|
|
|
|
+ @ApiOperation("测试")
|
|
|
|
+ @PostMapping("test")
|
|
|
|
+ public R test() {
|
|
|
|
+ log.info("run test ");
|
|
|
|
+ return new R(2000, "admin 权限可以查看 dem");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
}
|
|
}
|