コード例 #1
0
  /**
   * 获取我的孩子列表
   *
   * @param model
   * @param request
   * @return
   */
  @RequestMapping(value = "/listByMy", method = RequestMethod.GET)
  public String listByMy(ModelMap model, HttpServletRequest request) {
    ResponseMessage responseMessage = RestUtil.addResponseMessageForModelMap(model);

    SessionUserInfoInterface parent = this.getUserInfoBySession(request);

    List<PxStudent> list = pxStudentService.listByMy(parent);
    List list1 = pxClassService.listPxStudentPXClassRelationByStudent(parent);
    model.addAttribute(RestConstants.Return_ResponseMessage_list, list);
    model.addAttribute("class_list", list1);
    responseMessage.setStatus(RestConstants.Return_ResponseMessage_success);
    return "";
  }
コード例 #2
0
  @RequestMapping(value = "/{uuid}", method = RequestMethod.GET)
  public String get(@PathVariable String uuid, ModelMap model, HttpServletRequest request) {
    ResponseMessage responseMessage = RestUtil.addResponseMessageForModelMap(model);
    PxStudent s;
    try {
      if (DBUtil.isSqlInjection(uuid, responseMessage)) return "";

      s = pxStudentService.get(uuid);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      responseMessage.setStatus(RestConstants.Return_ResponseMessage_failed);
      responseMessage.setMessage("服务器异常:" + e.getMessage());
      return "";
    }
    model.addAttribute(RestConstants.Return_G_entity, s);
    responseMessage.setStatus(RestConstants.Return_ResponseMessage_success);
    return "";
  }