Skip to content

Commit

Permalink
chore: update @tag descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
astappiev committed Aug 7, 2024
1 parent 9022c69 commit c7c15dd
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
info = @Info(
title = "Interweb API",
version = "4.0.0",
description = "Unified API for Information Retrieval.",
contact = @Contact(
name = "Learnweb Team",
url = "https://learnweb.l3s.uni-hannover.de/lw/contact.jsf",
email = "[email protected]"),
license = @License(name = "The MIT License", url = "https://opensource.org/licenses/MIT")
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
import io.quarkus.security.identity.SecurityIdentity;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.Uni;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import org.hibernate.reactive.mutiny.Mutiny;

import de.l3s.interweb.core.chat.*;
import de.l3s.interweb.core.util.StringUtils;
import de.l3s.interweb.server.features.user.Token;

@Tag(name = "Chat")
@Path("/chat")
@Authenticated
public class ChatResource {

@Inject
Expand All @@ -30,7 +33,6 @@ public class ChatResource {
SecurityIdentity securityIdentity;

@GET
@Authenticated
public Uni<List<Chat>> chats(
@QueryParam("user") String user,
@QueryParam("sort") @DefaultValue("-created") String order,
Expand Down Expand Up @@ -63,7 +65,6 @@ private static Uni<List<ChatMessage>> createChatTitle(Chat chat) {
}

@GET
@Authenticated
@Path("{uuid}")
public Uni<Conversation> chat(@PathParam("uuid") UUID id) {
Token token = securityIdentity.getCredential(Token.class);
Expand All @@ -81,7 +82,6 @@ public Uni<Conversation> chat(@PathParam("uuid") UUID id) {
}

@POST
@Authenticated
@Path("/completions")
public Uni<CompletionsResults> completions(@Valid CompletionsQuery query) {
Token token = securityIdentity.getCredential(Token.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.ArrayList;
import java.util.List;

import jakarta.annotation.security.PermitAll;
import jakarta.inject.Inject;
import jakarta.validation.Valid;
import jakarta.validation.ValidationException;
Expand All @@ -14,21 +13,23 @@
import io.quarkus.cache.CacheResult;
import io.quarkus.security.Authenticated;
import io.smallrye.mutiny.Uni;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import org.jboss.resteasy.reactive.RestQuery;

import de.l3s.interweb.core.describe.DescribeConnector;
import de.l3s.interweb.core.describe.DescribeQuery;
import de.l3s.interweb.core.describe.DescribeResults;
import de.l3s.interweb.core.util.StringUtils;

@Tag(name = "Describe", description = "Retrieve information about a resource (URL)")
@Path("/describe")
@Authenticated
public class DescribeResource {

@Inject
DescribeService describeService;

@GET
@Authenticated
public Uni<DescribeResults> describe(@RestQuery String link,
@RestQuery String id,
@RestQuery String services) {
Expand All @@ -42,7 +43,6 @@ public Uni<DescribeResults> describe(@RestQuery String link,
}

@POST
@Authenticated
@CacheResult(cacheName = "describe")
public Uni<DescribeResults> describe(@Valid DescribeQuery query) {
describeService.validateServices(query.getServices());
Expand All @@ -56,7 +56,6 @@ public Uni<DescribeResults> describe(@Valid DescribeQuery query) {
}

@GET
@PermitAll
@Path("/services")
public Uni<List<ServiceEntity>> services() {
List<ServiceEntity> services = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,25 @@

import io.quarkus.security.Authenticated;
import io.smallrye.mutiny.Uni;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;

import de.l3s.interweb.core.ObjectWrapper;
import de.l3s.interweb.core.models.Model;

@Tag(name = "Models", description = "List all available models")
@Path("/models")
@Authenticated
public class ModelsResource {

@Inject
ModelsService modelsService;

@GET
@Authenticated
public Uni<ObjectWrapper<List<Model>>> models() {
return modelsService.getModels().map(models -> new ObjectWrapper<>("list", models));
}

@GET
@Authenticated
@Path("{model}")
public Uni<Model> chat(@PathParam("model") String model) {
return modelsService.getModel(model);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@
import io.quarkus.security.identity.SecurityIdentity;
import io.smallrye.mutiny.Uni;
import org.eclipse.microprofile.openapi.annotations.parameters.Parameter;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import org.jboss.resteasy.reactive.RestQuery;

import de.l3s.interweb.core.search.*;
import de.l3s.interweb.core.util.StringUtils;

@Tag(name = "Search", description = "Search internet by query")
@Path("/search")
@Authenticated
public class SearchResource {
private static final String NO_CACHE = "no-cache";

Expand All @@ -37,7 +40,6 @@ public class SearchResource {
SecurityIdentity securityIdentity;

@GET
@Authenticated
public Uni<SearchResults> search(@Parameter(description = "The search query", example = "hello world") @NotEmpty @RestQuery("query") String query,
@Parameter(description = "A content types to search for") @NotEmpty @RestQuery("content_types") ContentType[] contentTypes,
@Parameter(description = "A services to search in") @RestQuery("services") String[] services,
Expand Down Expand Up @@ -66,7 +68,6 @@ public Uni<SearchResults> search(@Parameter(description = "The search query", ex
}

@POST
@Authenticated
public Uni<SearchResults> search(@NotNull @Valid SearchQuery query, @HeaderParam("Cache-Control") String cacheControl) {
long start = System.currentTimeMillis();
if (NO_CACHE.equals(cacheControl)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.ArrayList;
import java.util.List;

import jakarta.annotation.security.PermitAll;
import jakarta.inject.Inject;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
Expand All @@ -15,21 +14,23 @@
import io.quarkus.cache.CacheResult;
import io.quarkus.security.Authenticated;
import io.smallrye.mutiny.Uni;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import org.jboss.resteasy.reactive.RestQuery;

import de.l3s.interweb.core.suggest.SuggestConnector;
import de.l3s.interweb.core.suggest.SuggestQuery;
import de.l3s.interweb.core.suggest.SuggestResults;
import de.l3s.interweb.core.util.StringUtils;

@Tag(name = "Suggest", description = "Suggest completions for a query")
@Path("/suggest")
@Authenticated
public class SuggestResource {

@Inject
SuggestService suggestService;

@GET
@Authenticated
public Uni<SuggestResults> suggest(@NotEmpty @RestQuery String q,
@Size(min = 2, max = 2) @RestQuery String lang,
@RestQuery String services) {
Expand All @@ -45,7 +46,6 @@ public Uni<SuggestResults> suggest(@NotEmpty @RestQuery String q,
}

@POST
@Authenticated
@CacheResult(cacheName = "suggest")
public Uni<SuggestResults> suggest(@Valid SuggestQuery query) {
long start = System.currentTimeMillis();
Expand All @@ -58,7 +58,6 @@ public Uni<SuggestResults> suggest(@Valid SuggestQuery query) {
}

@GET
@PermitAll
@Path("/services")
public Uni<List<ServiceEntity>> services() {
List<ServiceEntity> services = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@

import io.quarkus.hibernate.reactive.panache.PanacheEntityBase;
import io.quarkus.hibernate.reactive.panache.common.WithTransaction;
import io.quarkus.security.Authenticated;
import io.quarkus.security.identity.SecurityIdentity;
import io.smallrye.mutiny.Uni;
import org.eclipse.microprofile.openapi.annotations.Operation;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;

import de.l3s.interweb.server.Roles;

@Path("/users/tokens")
@Tag(name = "Tokens", description = "Use to create a new client with Api-Key auth.")
@Tag(name = "API Keys", description = "Manage application access")
@Path("/tokens")
@Authenticated
public class TokenResource {

@Context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

import de.l3s.interweb.server.Roles;

@Tag(name = "Auth & Identity", description = "User management")
@Path("/")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Tag(name = "Identity", description = "Identity & tokens management")
public class UserResource {

@Context
Expand Down

0 comments on commit c7c15dd

Please sign in to comment.