Ejemplo n.º 1
0
 @RequestMapping(value = "/teacher/password", method = RequestMethod.PUT)
 @ResponseBody
 public JSONObject changePasswd(@RequestBody JSONObject teacher) throws SQLException {
   teacher.put("tch_passwd", MD5.string2md5(teacher.getString("tch_passwd")));
   teacherService.updatePasswd(teacher);
   return RequestUtil.make_ret();
 }
Ejemplo n.º 2
0
 @RequestMapping(value = "/teacher/{teacher_id}", method = RequestMethod.DELETE)
 @ResponseBody
 public JSONObject delTeacher(@PathVariable("teacher_id") int teacherID) throws SQLException {
   teacherService.deleteByID(teacherID);
   return RequestUtil.make_ret();
 }
Ejemplo n.º 3
0
 @RequestMapping(value = "/teacher", method = RequestMethod.PUT)
 @ResponseBody
 public JSONObject updateTeacher(@RequestBody JSONObject teacher) throws SQLException {
   teacherService.update(teacher);
   return RequestUtil.make_ret();
 }
Ejemplo n.º 4
0
 @RequestMapping(value = "/teacher", method = RequestMethod.POST)
 @ResponseBody
 public JSONObject addTeacher(@RequestBody JSONObject teacher) throws SQLException {
   Log.debug("save Teacher:" + teacher);
   return RequestUtil.make_ret(0, "", teacherService.insertTeacher(teacher));
 }
Ejemplo n.º 5
0
 @RequestMapping(value = "/teachers", method = RequestMethod.GET)
 @ResponseBody
 public JSONObject teachers() throws SQLException {
   return RequestUtil.make_ret(teacherService.selectAll());
 }