You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.3 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. package in.gov.chennaicorporation.gccoffice.callcenter.controller;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.http.ResponseEntity;
  4. import org.springframework.web.bind.annotation.GetMapping;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestParam;
  7. import org.springframework.web.bind.annotation.RestController;
  8. import org.springframework.web.client.RestTemplate;
  9. import in.gov.chennaicorporation.gccoffice.configuration.AppConfig;
  10. @RequestMapping("/gcc/api/attendance")
  11. @RestController
  12. public class AttendanceAPIController {
  13. private AppConfig appConfig;
  14. private final RestTemplate restTemplate;
  15. @Autowired
  16. public AttendanceAPIController(RestTemplate restTemplate, AppConfig appConfig) {
  17. this.restTemplate = restTemplate;
  18. this.appConfig = appConfig;
  19. }
  20. @GetMapping("/getAttendancedetails")
  21. public String getAttendancedetails(@RequestParam String fromDate,@RequestParam String toDate){
  22. String apiUrl = appConfig.attendanceReport + "/callcenter/api/attendance/getattendancereport"+"?fromDate="+ fromDate + "&toDate="+ toDate;
  23. ResponseEntity<String> responseEntity = restTemplate.getForEntity(apiUrl, String.class);
  24. return responseEntity.getBody();
  25. }
  26. }