package com.db.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.db.demo.dao.StudentCourseDao;
import com.db.demo.entity.StudentCourseInfo;



@RestController
@RequestMapping("/api")
public class Controller {
	
	@Autowired
	StudentCourseDao studentCourseDao;
	
	@PostMapping("save")
	public ResponseEntity addStudentCourse(@RequestBody StudentCourseInfo bean){
		StudentCourseInfo studentCourseInfo = studentCourseDao.saveStudent(bean);
		
		return new ResponseEntity(studentCourseInfo, HttpStatus.OK);
	}
	

}