|
|
@ -11,6 +11,7 @@ import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
|
|
|
@ -94,6 +95,19 @@ public class FileController { |
|
|
|
return JsonResponse.newInstance().ok(vos); |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation(value = "通过id批量查询文件信息") |
|
|
|
@ApiImplicitParams({ |
|
|
|
}) |
|
|
|
@RequestMapping(value = "query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) |
|
|
|
public JsonResponse<List<FileVo.FilePosition>> queryById(@RequestBody List<Long> files) throws IOException { |
|
|
|
log.info("通过id批量查询文件信息:{}", files); |
|
|
|
List<FileVo.FilePosition> filePosition = fileService.queryById(files); |
|
|
|
log.info("通过id批量查询文件信息成功"); |
|
|
|
return JsonResponse.newInstance().ok(filePosition); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Long getUserId(HttpServletRequest request) { |
|
|
|
String userIdStr = request.getParameter("userId"); |
|
|
|
return StrUtil.isEmpty(userIdStr) ? null : Long.parseLong(userIdStr); |
|
|
@ -133,6 +147,8 @@ public class FileController { |
|
|
|
return JsonResponse.newInstance().ok(content); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @GetMapping(value = "test/{id}")
|
|
|
|
// public void test(@PathVariable("id")long id) throws IOException {
|
|
|
|
// ResponseEntity<JSONObject> entity = restTemplate.getForEntity("http://localhost:8001/file/read/" + id + "?start=0&end=-1", JSONObject.class);
|
|
|
|