forked from mrizky-kur/Redux-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UpdateCustomerDetailsController.java
32 lines (26 loc) · 1.13 KB
/
UpdateCustomerDetailsController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.simactivation.controller;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.simactivation.service.CustomerAddressServices;
import com.simactivation.validation.ValidateUpdateDetail;
@RestController
@RequestMapping("/customer/update")
@Valid
// ON BASIS OF CITY AND STATE: NEED IMPROVEMENT: REPLACE WITH UIDN
public class UpdateCustomerDetailsController {
@Autowired
private CustomerAddressServices customerAddressServices;
@PutMapping(value = "/validate")
public ResponseEntity<String> validateAddreessDetails
(@Valid @RequestBody ValidateUpdateDetail vpd)
{
String message = customerAddressServices.updationCustomerAddress(
(int) vpd.getPincode(), vpd.getAddress(), vpd.getCity(), vpd.getState());
return ResponseEntity.ok(message);
}
}