/**
- Created by AI码师 on 2019/4/19.
- 关注公众号【AI码师】领取2021最新面试资料一份(很全)
- @return
*/
@RequestMapping("/home")
@RestController
public class HomeController {
@Autowired
private MongoTemplate mongoTemplate;
@PostMapping
public String addData(@RequestParam(value = “name”) String name,@RequestParam(value = “addr”) String addr,@RequestParam(value = “email”) String email){
Student student = new Student();
student.setAddr(addr);
student.setName(name);http://yezishuju.com/
student.setEmail(email);
mongoTemplate.insert(student);
return “添加成功”;
}
}