Package net.baguajie.exceptions

Examples of net.baguajie.exceptions.ResourceNotFoundException


  @RequestMapping(value="/track/{targetId}", method=RequestMethod.GET)
  public @ResponseBody AjaxResult follow(@PathVariable String targetId,
      @ModelAttribute(ApplicationConstants.SESSION_SIGNIN_USER) User signInUser,
      Model model, HttpServletRequest request, HttpSession session){
    if(!ajaxUtil.isAjaxRequest(request)){
      throw new ResourceNotFoundException();
    }
    Spot target = spotRepository.findOne(targetId);
    if(target==null){
      throw new RuntimeException("Invalid spot id : " + targetId);
    }
View Full Code Here


  public @ResponseBody AjaxResult defollow(@PathVariable String targetId,
      @ModelAttribute(ApplicationConstants.SESSION_SIGNIN_USER) User signInUser,
      Model model, HttpServletRequest request,
      HttpSession session){
    if(!ajaxUtil.isAjaxRequest(request)){
      throw new ResourceNotFoundException();
    }
    Spot target = spotRepository.findOne(targetId);
    if(target==null){
      throw new RuntimeException("Invalid spot id : " + targetId);
    }
View Full Code Here

  @RequestMapping(value = "/checksignin", method = RequestMethod.GET)
  public @ResponseBody
  AjaxResult checkSignIn(HttpServletRequest request, ModelAndView mav,
      HttpSession session) {
    if (!ajaxUtil.isAjaxRequest(request)) {
      throw new ResourceNotFoundException();
    }
    if (sessionUtil.getSignInUser(session) != null) {
      Calendar c = Calendar.getInstance();
      c.setTimeZone(TimeZone.getTimeZone("UTC"));
      return new AjaxResult(AjaxResultCode.SUCCESS, c.getTimeInMillis());
View Full Code Here

      @ModelAttribute(ApplicationConstants.SESSION_SIGNIN_USER)
        User signInUser,
      BindingResult result,
      Model model, HttpServletRequest request, HttpSession session){
    if(!ajaxUtil.isAjaxRequest(request)){
      throw new ResourceNotFoundException();
    }
    if(result.hasErrors()){
      return new AjaxResult(AjaxResultCode.INVALID,
          BindingErrors.from(result));
    }
View Full Code Here

  @RequestMapping(value="/fwd/{id}/view/{type}", method=RequestMethod.GET)
  public String view(@PathVariable String id,
      @PathVariable String type, Model model,
      HttpServletRequest request, HttpSession session){
    if(!ajaxUtil.isAjaxRequest(request)){
      throw new ResourceNotFoundException();
    }
    Forward fwd = forwadRepository.findOne(id);
    model.addAttribute("fwd", fwd);
    return "ops/fwd."+ type;
  }
View Full Code Here

  public @ResponseBody AjaxResult create(@Valid CommentFormBean bean,
      @ModelAttribute(ApplicationConstants.SESSION_SIGNIN_USER) User signInUser,
      BindingResult result,
      Model model, HttpServletRequest request, HttpSession session){
    if(!ajaxUtil.isAjaxRequest(request)){
      throw new ResourceNotFoundException();
    }
    if(result.hasErrors()){
      return new AjaxResult(AjaxResultCode.INVALID,
          BindingErrors.from(result));
    }
View Full Code Here

 
  @RequestMapping(value="/citymeta", method=RequestMethod.GET)
  public @ResponseBody AjaxResult meta(HttpServletRequest request,
      ModelAndView mav, HttpSession session){
    if(!ajaxUtil.isAjaxRequest(request)){
      throw new ResourceNotFoundException();
    }
    CityMeta city = sessionUtil.getGeoCityMeta(session);
    return city != null ? new AjaxResult(AjaxResultCode.SUCCESS, city) :
      meta(null, request, mav, session);
  }
View Full Code Here

 
  @RequestMapping(value="/citymeta/{pinyin}", method=RequestMethod.GET)
  public @ResponseBody AjaxResult meta(@PathVariable String pinyin,
      HttpServletRequest request, ModelAndView mav, HttpSession session){
    if(!ajaxUtil.isAjaxRequest(request)){
      throw new ResourceNotFoundException();
    }
    String py = pinyin;
    if(!StringUtils.hasText(pinyin)){
      py = ApplicationConfig.defaultCityPinyin;
    }
View Full Code Here

  @RequestMapping(value="/follow/{targetId}", method=RequestMethod.GET)
  public @ResponseBody AjaxResult follow(@PathVariable String targetId,
      @ModelAttribute(ApplicationConstants.SESSION_SIGNIN_USER) User signInUser,
      Model model, HttpServletRequest request, HttpSession session){
    if(!ajaxUtil.isAjaxRequest(request)){
      throw new ResourceNotFoundException();
    }
    User target = userRepository.findOne(targetId);
    if(target==null){
      throw new RuntimeException("Invalid user id : " + targetId);
    }
View Full Code Here

  public @ResponseBody AjaxResult defollow(@PathVariable String targetId,
      @ModelAttribute(ApplicationConstants.SESSION_SIGNIN_USER) User signInUser,
      Model model, HttpServletRequest request,
      HttpSession session){
    if(!ajaxUtil.isAjaxRequest(request)){
      throw new ResourceNotFoundException();
    }
    if(signInUser==null){
      throw new UnauthorizedOperationException();
    }
    User target = userRepository.findOne(targetId);
View Full Code Here

TOP

Related Classes of net.baguajie.exceptions.ResourceNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.