package com.bizofficer.api.google;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CalendarController {
	
	@Autowired
	private CalendarService cclsObj;

	@RequestMapping(value = {"/call-calendar"}, method = RequestMethod.GET)
	public ResponseEntity<Object> execute(@ModelAttribute("SpringWeb")CalendarBeans objBean) {
		
		try {
			
			cclsObj.callMain();
			
			///ZoomMeetingObjectDTO dtoObj = (ZoomMeetingObjectDTO) (Object) cclsObj.createMeeting(objBean);
			
			//System.out.println("Meeting ID: "+dtoObj.getId());
			//System.out.println("Meeting Password: "+dtoObj.getPassword());
			
			HttpHeaders headers = new HttpHeaders();
	        ////headers.add("Responded", "UserController");
	        return ResponseEntity.ok().headers(headers).body(null);
			
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
	}
	

	
	
}
