-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a95915
commit 568f2f3
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
@RestController | ||
@RequestMapping("/api/customers") | ||
|
@@ -73,6 +74,17 @@ public ResponseEntity<CustomerDTO> getCustomerLogin(@PathVariable String email, | |
} | ||
} | ||
|
||
@GetMapping("/loginAdmin/{email}/{password}") | ||
public ResponseEntity<CustomerDTO> getAdminLogin(@PathVariable String email, | ||
@PathVariable String password){ | ||
CustomerDTO response = customerService.customerLogin(email, password); | ||
if(response != null&& Objects.equals(email, "[email protected]")){ | ||
return new ResponseEntity<>(response, HttpStatus.OK); | ||
} else { | ||
return new ResponseEntity<>(HttpStatus.NOT_FOUND); | ||
} | ||
} | ||
|
||
@DeleteMapping("/{id}") | ||
public ResponseEntity<CustomerDTO> deleteCustomer(@PathVariable Integer id){ | ||
CustomerDTO deletedCustomer = customerService.deleteCustomer(id); | ||
|