|
| 1 | +/** |
| 2 | + * Copyright (c) 2025, RTE (http://www.rte-france.com) |
| 3 | + * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | + * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | + * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 | + */ |
| 7 | +package org.gridsuite.mapping.server.controller; |
| 8 | + |
| 9 | +import io.swagger.v3.oas.annotations.Operation; |
| 10 | +import io.swagger.v3.oas.annotations.responses.ApiResponse; |
| 11 | +import io.swagger.v3.oas.annotations.responses.ApiResponses; |
| 12 | +import io.swagger.v3.oas.annotations.tags.Tag; |
| 13 | +import lombok.AllArgsConstructor; |
| 14 | +import org.gridsuite.mapping.server.service.SupervisionService; |
| 15 | +import org.springframework.http.MediaType; |
| 16 | +import org.springframework.http.ResponseEntity; |
| 17 | +import org.springframework.web.bind.annotation.GetMapping; |
| 18 | +import org.springframework.web.bind.annotation.RequestMapping; |
| 19 | +import org.springframework.web.bind.annotation.RestController; |
| 20 | + |
| 21 | +import java.util.List; |
| 22 | +import java.util.UUID; |
| 23 | + |
| 24 | +/** |
| 25 | + * @author Mathieu Deharbe <mathieu.deharbe at rte-france.com> |
| 26 | + * |
| 27 | + * endpoints only used for supervision from the admins, should never be used by any other users |
| 28 | + */ |
| 29 | +@RestController |
| 30 | +@RequestMapping(value = "/supervision") |
| 31 | +@Tag(name = "Mapping server - Supervision") |
| 32 | +@AllArgsConstructor |
| 33 | +public class SupervisionController { |
| 34 | + private final SupervisionService supervisionService; |
| 35 | + |
| 36 | + @GetMapping(value = "/filters") |
| 37 | + @Operation(summary = "Get all the uuids of the filters used by the mapping server") |
| 38 | + @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "List of all the filters uuids")}) |
| 39 | + public ResponseEntity<List<UUID>> getAllRootNetworks() { |
| 40 | + return ResponseEntity.ok().contentType(MediaType.APPLICATION_JSON).body(supervisionService.getAllFiltersUuids()); |
| 41 | + } |
| 42 | +} |
0 commit comments