6
6
*/
7
7
package org .gridsuite .geodata .server ;
8
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 ;
9
13
import org .gridsuite .geodata .server .dto .LineGeoData ;
10
14
import org .gridsuite .geodata .server .dto .SubstationGeoData ;
11
15
import com .powsybl .iidm .network .Country ;
12
16
import com .powsybl .iidm .network .Network ;
13
17
import com .powsybl .network .store .client .NetworkStoreService ;
14
- import io .swagger .annotations .Api ;
15
- import io .swagger .annotations .ApiOperation ;
16
- import io .swagger .annotations .ApiResponse ;
17
- import io .swagger .annotations .ApiResponses ;
18
18
import org .springframework .beans .factory .annotation .Autowired ;
19
19
import org .springframework .context .annotation .ComponentScan ;
20
20
import org .springframework .http .MediaType ;
32
32
*/
33
33
@ RestController
34
34
@ RequestMapping (value = GeoDataController .API_VERSION )
35
- @ Api ( value = "Geo data" )
35
+ @ Tag ( name = "Geo data" )
36
36
@ ComponentScan (basePackageClasses = {GeoDataController .class , GeoDataService .class , NetworkStoreService .class })
37
37
public class GeoDataController {
38
38
@@ -49,8 +49,8 @@ private static Set<Country> toCountrySet(@RequestParam(required = false) List<St
49
49
}
50
50
51
51
@ GetMapping (value = "/substations" , produces = MediaType .APPLICATION_JSON_VALUE )
52
- @ ApiOperation ( value = "Get substations geographical data" , response = List . class )
53
- @ ApiResponses (value = {@ ApiResponse (code = 200 , message = "Substations geographical data" )})
52
+ @ Operation ( summary = "Get substations geographical data" )
53
+ @ ApiResponses (value = {@ ApiResponse (responseCode = " 200" , description = "Substations geographical data" )})
54
54
public ResponseEntity <List <SubstationGeoData >> getSubstations (@ RequestParam UUID networkUuid ,
55
55
@ RequestParam (required = false ) List <String > countries ) {
56
56
Set <Country > countrySet = toCountrySet (countries );
@@ -60,8 +60,8 @@ public ResponseEntity<List<SubstationGeoData>> getSubstations(@RequestParam UUID
60
60
}
61
61
62
62
@ GetMapping (value = "/lines" , produces = MediaType .APPLICATION_JSON_VALUE )
63
- @ ApiOperation ( value = "Get lines geographical data" , response = List . class )
64
- @ ApiResponses (value = {@ ApiResponse (code = 200 , message = "Lines geographical data" )})
63
+ @ Operation ( summary = "Get lines geographical data" )
64
+ @ ApiResponses (value = {@ ApiResponse (responseCode = " 200" , description = "Lines geographical data" )})
65
65
public ResponseEntity <List <LineGeoData >> getLines (@ RequestParam UUID networkUuid ,
66
66
@ RequestParam (required = false ) List <String > countries ) {
67
67
Set <Country > countrySet = toCountrySet (countries );
@@ -71,15 +71,15 @@ public ResponseEntity<List<LineGeoData>> getLines(@RequestParam UUID networkUuid
71
71
}
72
72
73
73
@ PostMapping (value = "/substations" )
74
- @ ApiOperation ( value = "Save substations geographical data" )
75
- @ ApiResponses (value = {@ ApiResponse (code = 200 , message = "Substations geographical data have been correctly saved" )})
74
+ @ Operation ( summary = "Save substations geographical data" )
75
+ @ ApiResponses (value = {@ ApiResponse (responseCode = " 200" , description = "Substations geographical data have been correctly saved" )})
76
76
public void saveSubstations (@ RequestBody List <SubstationGeoData > substationGeoData ) {
77
77
geoDataService .saveSubstations (substationGeoData );
78
78
}
79
79
80
80
@ PostMapping (value = "/lines" )
81
- @ ApiOperation ( value = "Save lines geographical data" )
82
- @ ApiResponses (value = {@ ApiResponse (code = 200 , message = "Lines geographical data have been correctly saved" )})
81
+ @ Operation ( summary = "Save lines geographical data" )
82
+ @ ApiResponses (value = {@ ApiResponse (responseCode = " 200" , description = "Lines geographical data have been correctly saved" )})
83
83
public void saveLines (@ RequestBody List <LineGeoData > linesGeoData ) {
84
84
geoDataService .saveLines (linesGeoData );
85
85
}
0 commit comments