fix
This commit is contained in:
parent
d638a36b0f
commit
a8c8682920
@ -31,7 +31,7 @@ import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/file")
|
||||
@RequestMapping("/api/v1/doc")
|
||||
@RequiredArgsConstructor
|
||||
public class FileQueryController {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(FileQueryController.class);
|
||||
@ -64,26 +64,10 @@ public class FileQueryController {
|
||||
return buildSearchResponse(response, requestBody.getFlatKeywords(), page, size);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public Map<String, Object> search(@RequestParam String q) throws IOException {
|
||||
int page = 1;
|
||||
int size = defaultPageSize;
|
||||
int from = 0;
|
||||
|
||||
// 单关键词转换成一组组结构
|
||||
List<List<String>> keywordGroups = Collections.singletonList(Collections.singletonList(q));
|
||||
List<String> flatKeywords = Collections.singletonList(q);
|
||||
|
||||
SearchSourceBuilder builder = new SearchSourceBuilder()
|
||||
.query(buildSearchQuery(keywordGroups))
|
||||
.from(from)
|
||||
.size(size)
|
||||
.sort("mtime", SortOrder.DESC);
|
||||
|
||||
SearchRequest request = new SearchRequest("documents").source(builder);
|
||||
SearchResponse response = esClient.search(request, RequestOptions.DEFAULT);
|
||||
|
||||
return buildSearchResponse(response, flatKeywords, page, size);
|
||||
// 查询指定用户被授权文件
|
||||
@GetMapping("/listUserFiles")
|
||||
public ResponseEntity<List<UserFileDTO>> listUserFiles(@RequestParam Long userId) {
|
||||
return ResponseEntity.ok(userAppService.listUserFiles(userId));
|
||||
}
|
||||
|
||||
@PostMapping("file-path")
|
||||
@ -173,9 +157,4 @@ public class FileQueryController {
|
||||
}
|
||||
|
||||
|
||||
// 查询指定用户被授权文件
|
||||
@GetMapping("/listUserFiles")
|
||||
public ResponseEntity<List<UserFileDTO>> listUserFiles(@RequestParam Long userId) {
|
||||
return ResponseEntity.ok(userAppService.listUserFiles(userId));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user