-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SKYEDEN-3234 | Add endpoint for inactive topics
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...anagement/src/main/java/pl/allegro/tech/hermes/management/api/InactiveTopicsEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package pl.allegro.tech.hermes.management.api; | ||
|
||
import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; | ||
|
||
import io.swagger.annotations.ApiOperation; | ||
import jakarta.annotation.security.RolesAllowed; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.HttpMethod; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import java.util.List; | ||
import org.springframework.stereotype.Component; | ||
import pl.allegro.tech.hermes.management.api.auth.Roles; | ||
import pl.allegro.tech.hermes.management.domain.detection.InactiveTopic; | ||
import pl.allegro.tech.hermes.management.domain.detection.InactiveTopicsStorageService; | ||
|
||
@Component | ||
@Path("/inactive-topics") | ||
public class InactiveTopicsEndpoint { | ||
private final InactiveTopicsStorageService storageService; | ||
|
||
public InactiveTopicsEndpoint(InactiveTopicsStorageService storageService) { | ||
this.storageService = storageService; | ||
} | ||
|
||
@GET | ||
@Produces(APPLICATION_JSON) | ||
@RolesAllowed(Roles.ADMIN) | ||
@ApiOperation(value = "All inactive topics", response = List.class, httpMethod = HttpMethod.GET) | ||
public List<InactiveTopic> getConsumersWorkloadConstraints() { | ||
return storageService.getInactiveTopics(); | ||
} | ||
} |