24
24
import de .rwth .idsg .steve .web .api .ApiControllerAdvice .ApiErrorResponse ;
25
25
import de .rwth .idsg .steve .web .dto .OcppTagForm ;
26
26
import de .rwth .idsg .steve .web .dto .OcppTagQueryForm ;
27
+ import io .swagger .v3 .oas .annotations .Operation ;
27
28
import io .swagger .v3 .oas .annotations .media .Content ;
28
29
import io .swagger .v3 .oas .annotations .media .Schema ;
29
30
import io .swagger .v3 .oas .annotations .responses .ApiResponse ;
30
31
import io .swagger .v3 .oas .annotations .responses .ApiResponses ;
32
+ import io .swagger .v3 .oas .annotations .tags .Tag ;
31
33
import lombok .RequiredArgsConstructor ;
32
34
import lombok .extern .slf4j .Slf4j ;
33
35
import org .springframework .http .HttpStatus ;
50
52
* @author Sevket Goekay <[email protected] >
51
53
* @since 13.09.2022
52
54
*/
55
+ @ Tag (name = "ocpp-tag-controller" ,
56
+ description = """
57
+ Operations related to managing Ocpp Tags.
58
+ An Ocpp Tag is the identifier of the actor that interacts with the charge box.
59
+ It can be used for authorization, but also to start and stop charging sessions.
60
+ An RFID card is an example of an Ocpp Tag.
61
+ """
62
+ )
53
63
@ Slf4j
54
64
@ RestController
55
65
@ RequestMapping (value = "/api/v1/ocppTags" , produces = MediaType .APPLICATION_JSON_VALUE )
@@ -58,7 +68,10 @@ public class OcppTagsRestController {
58
68
59
69
private final OcppTagService ocppTagService ;
60
70
61
-
71
+ @ Operation (description = """
72
+ Returns a list of Ocpp Tags based on the query parameters.
73
+ The query parameters can be used to filter the Ocpp Tags.
74
+ """ )
62
75
@ ApiResponses (value = {
63
76
@ ApiResponse (responseCode = "200" , description = "OK" ),
64
77
@ ApiResponse (responseCode = "400" , description = "Bad Request" , content = {@ Content (mediaType = "application/json" , schema = @ Schema (implementation = ApiErrorResponse .class ))}),
@@ -75,6 +88,9 @@ public List<OcppTag.Overview> get(OcppTagQueryForm.ForApi params) {
75
88
return response ;
76
89
}
77
90
91
+ @ Operation (description = """
92
+ Returns a single Ocpp Tag based on the ocppTagPk.
93
+ """ )
78
94
@ ApiResponses (value = {
79
95
@ ApiResponse (responseCode = "200" , description = "OK" ),
80
96
@ ApiResponse (responseCode = "400" , description = "Bad Request" , content = {@ Content (mediaType = "application/json" , schema = @ Schema (implementation = ApiErrorResponse .class ))}),
@@ -92,6 +108,10 @@ public OcppTag.Overview getOne(@PathVariable("ocppTagPk") Integer ocppTagPk) {
92
108
return response ;
93
109
}
94
110
111
+ @ Operation (description = """
112
+ Creates a new Ocpp Tag with the provided parameters.
113
+ The request body should contain the necessary information.
114
+ """ )
95
115
@ ApiResponses (value = {
96
116
@ ApiResponse (responseCode = "201" , description = "Created" ),
97
117
@ ApiResponse (responseCode = "400" , description = "Bad Request" , content = {@ Content (mediaType = "application/json" , schema = @ Schema (implementation = ApiErrorResponse .class ))}),
@@ -113,6 +133,9 @@ public OcppTag.Overview create(@RequestBody @Valid OcppTagForm params) {
113
133
return response ;
114
134
}
115
135
136
+ @ Operation (description = """
137
+ Updates an existing Ocpp Tag with the provided parameters.
138
+ """ )
116
139
@ ApiResponses (value = {
117
140
@ ApiResponse (responseCode = "200" , description = "OK" ),
118
141
@ ApiResponse (responseCode = "400" , description = "Bad Request" , content = {@ Content (mediaType = "application/json" , schema = @ Schema (implementation = ApiErrorResponse .class ))}),
@@ -133,6 +156,10 @@ public OcppTag.Overview update(@PathVariable("ocppTagPk") Integer ocppTagPk, @Re
133
156
return response ;
134
157
}
135
158
159
+ @ Operation (description = """
160
+ Deletes an existing Ocpp Tag based on the ocppTagPk.
161
+ Returns the deleted Ocpp Tag.
162
+ """ )
136
163
@ ApiResponses (value = {
137
164
@ ApiResponse (responseCode = "200" , description = "OK" ),
138
165
@ ApiResponse (responseCode = "400" , description = "Bad Request" , content = {@ Content (mediaType = "application/json" , schema = @ Schema (implementation = ApiErrorResponse .class ))}),
0 commit comments