7
7
import org .springframework .beans .factory .annotation .Autowired ;
8
8
import org .springframework .http .MediaType ;
9
9
import org .springframework .stereotype .Controller ;
10
+ import org .springframework .web .bind .annotation .PathVariable ;
10
11
import org .springframework .web .bind .annotation .RequestMapping ;
11
12
import org .springframework .web .bind .annotation .RequestMethod ;
12
- import org .springframework .web .bind .annotation .RequestParam ;
13
13
import org .springframework .web .bind .annotation .ResponseBody ;
14
14
15
15
import java .util .List ;
20
20
*/
21
21
@ Controller
22
22
@ ResponseBody
23
- @ RequestMapping (value = "/manager/ajax" , method = RequestMethod .GET , produces = MediaType .APPLICATION_JSON_VALUE )
23
+ @ RequestMapping (
24
+ value = "/manager/ajax/{chargeBoxId}" ,
25
+ method = RequestMethod .GET ,
26
+ produces = MediaType .APPLICATION_JSON_VALUE )
24
27
public class AjaxCallController {
25
28
26
29
@ Autowired private ChargePointRepository chargePointRepository ;
@@ -31,32 +34,32 @@ public class AjaxCallController {
31
34
// Paths
32
35
// -------------------------------------------------------------------------
33
36
34
- private static final String CP_DETAILS_PATH = "/getCPDetails " ;
35
- private static final String CONNECTOR_IDS_PATH = "/getConnectorIds " ;
36
- private static final String TRANSACTION_IDS_PATH = "/getTransactionIds " ;
37
- private static final String RESERVATION_IDS_PATH = "/getReservationIds " ;
37
+ private static final String DETAILS_PATH = "/details " ;
38
+ private static final String CONNECTOR_IDS_PATH = "/connectorIds " ;
39
+ private static final String TRANSACTION_IDS_PATH = "/transactionIds " ;
40
+ private static final String RESERVATION_IDS_PATH = "/reservationIds " ;
38
41
39
42
// -------------------------------------------------------------------------
40
43
// HTTP methods
41
44
// -------------------------------------------------------------------------
42
45
43
- @ RequestMapping (value = CP_DETAILS_PATH )
44
- public ChargePoint getCPDetails ( @ RequestParam String chargeBoxId ) {
46
+ @ RequestMapping (value = DETAILS_PATH )
47
+ public ChargePoint getDetails ( @ PathVariable ( "chargeBoxId" ) String chargeBoxId ) {
45
48
return chargePointRepository .getChargePointDetails (chargeBoxId );
46
49
}
47
50
48
51
@ RequestMapping (value = CONNECTOR_IDS_PATH )
49
- public List <Integer > getConnectorIds (@ RequestParam String chargeBoxId ) {
52
+ public List <Integer > getConnectorIds (@ PathVariable ( "chargeBoxId" ) String chargeBoxId ) {
50
53
return chargePointRepository .getConnectorIds (chargeBoxId );
51
54
}
52
55
53
56
@ RequestMapping (value = TRANSACTION_IDS_PATH )
54
- public List <Integer > getTransactionIds (@ RequestParam String chargeBoxId ) {
57
+ public List <Integer > getTransactionIds (@ PathVariable ( "chargeBoxId" ) String chargeBoxId ) {
55
58
return transactionRepository .getActiveTransactionIds (chargeBoxId );
56
59
}
57
60
58
61
@ RequestMapping (value = RESERVATION_IDS_PATH )
59
- public List <Integer > getReservationIds (@ RequestParam String chargeBoxId ) {
62
+ public List <Integer > getReservationIds (@ PathVariable ( "chargeBoxId" ) String chargeBoxId ) {
60
63
return reservationRepository .getActiveReservationIds (chargeBoxId );
61
64
}
62
65
0 commit comments