R-Sandor / FindFirst

Organizing the information that matters to you and your teams. The knowledge of your world.
https://findfirst.dev
Apache License 2.0
10 stars 18 forks source link

[Server] - Search for Bookmarks by Tag #279

Open R-Sandor opened 4 days ago

R-Sandor commented 4 days ago

Details

There is a scafolded function in src/main/java/dev/findfirst/core/controller/SearchController.java`:

  @GetMapping("/api/search/tags")
  public ResponseEntity<List<BookmarkDTO>> bookmarkSearchByTag(
      @Valid @RequestBody SearchBkmkByTagReq searchBkmkByTagReq) {
    // TODO finish
    return new Response<>(List.of(new BookmarkDTO(0, null, null, null, false, null, null, null)),
        HttpStatus.OK).get();
  }

Use this function from the TagJDBCRepository:

@Query("SELECT * FROM Tag t WHERE t.user_id = :userId AND t.tag_title IN :tagTitles ")
  List<TagDTO> findByTagTitles(@Param("tagTitles") List<String> tagTitles,
      @Param("tenantID") int userId);

Tasks