Package com.skyline.user.model

Examples of com.skyline.user.model.User


   *
   * @return
   */
  @RequestMapping(value = "/{spotId}/editPortrait", method = RequestMethod.GET)
  public ModelAndView uploadPortraitSpotrequest(@PathVariable("spotId") Long spotId) {
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    ModelAndView v = new ModelAndView();
    if (user == null) {
      v.setViewName(ViewPaths.USER_LOGIN);
      return v;
    }
    Spot spot = spotService.getSpot(spotId);
    if (spot.getAdministratorId().equals(user.getId())) {
      Album portraitAlbum = albumService.getUserPortraitAlbum(spotId);
      Photo portraitPhoto = albumService.getCurrentPortraitPhotoFromAlbum(portraitAlbum);
      v.addObject("portraitAlbumId", portraitAlbum.getId());
      v.addObject("portrait", portraitPhoto);
      v.addObject("spotInfo", spot);
View Full Code Here


  }

  @RequestMapping(value = "/{spotId}/editPortrait", method = RequestMethod.POST)
  public ModelAndView uploadPortraitSpotrequestOk(Long spotId, Integer x, Integer y,
      Integer size, String submitToken) {
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (user == null) {
      throw new NotLoginException("上传头像必须登录");
    }

    String errMsg = this.validateForm("portraitUploadForm", submitToken);
View Full Code Here

     * validateForm("discoverySpotForm", data); if(errMsg != null) {
     * ModelAndView errMav = this.processValidationErrors("errMsg", errMsg,
     * discoverySpotrequest()); return errMav; }
     */
    try {
      User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
      if (user == null) {
        v.setViewName(ViewPaths.USER_LOGIN);
        return v;
      }
      if (spotService.isExist(spot.getName())) {
View Full Code Here

    // todo 增加相册
  }

  @RequestMapping(value = "/photoupload", method = RequestMethod.GET)
  public ModelAndView photoUploadRequest() {
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (user == null) {
      throw new NotLoginException("上传头像必须登录");
    }

    long ownerId = user.getId();
    Album portraitAlbum = albumService.getUserPortraitAlbum(ownerId);
    Photo portraitPhoto = albumService.getCurrentPortraitPhotoFromAlbum(portraitAlbum);

    ModelAndView view = new ModelAndView();
    view.addObject("portraitAlbum", portraitAlbum);
View Full Code Here

  public ModelAndView viewSpotRequest(@PathVariable("spotId") Long spotId) {
    ModelAndView v = new ModelAndView(ViewPaths.USER_LOGIN);
    Page page = new Page();
    page.setSize(spotPageSize);
    Integer authority = Authority.PUBLIC;
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    Spot spotInfo = spotService.view(spotId);
    if (spotInfo == null) {
      v.setViewName(ViewPaths.SPOT_NOTFOUND);
      return v;

    }
    spotService.addVisitNum(spotId);

    if (user != null) {
      if (attentionService.isFan(spotId, user.getId())) {
        authority = Authority.ONLY_TO_FANS;
      }

      if (user.getId().equals(spotInfo.getAdministratorId())) {
        authority = Authority.PRIVATE;
      }
    }
    List<SpotCharacteristic> scList = spotCharacteristicService.queryCharacteristicBySpotId(
        spotId, page, Activity.NORMAL);
View Full Code Here

   * @param spotId
   * @return
   */
  @RequestMapping(value = "/{spotId}/edit", method = RequestMethod.GET)
  public ModelAndView modifySpotRequest(@PathVariable("spotId") Long spotId) {
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    ModelAndView v = new ModelAndView(ViewPaths.USER_LOGIN);

    Spot spot = spotService.view(spotId);
    if (spot == null)
      return null;
    if(spot.getAdministratorId().equals(user.getId()))
    {
    v.setViewName(ViewPaths.SPOT_EDIT);
    v.addObject("spotInfo", spot);
    }
    return v;
View Full Code Here

  }

  @RequestMapping(value = "/{spotId}/editbasic", method = RequestMethod.POST)
  public ModelAndView submitModifySpotBasicRequest(@PathVariable("spotId") Long spotId, Spot spot) {
    ModelAndView v = new ModelAndView(ViewPaths.USER_LOGIN);
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (user == null)
      return v;
    if (user.getId().equals(spot.getAdministratorId())) {
      spotService.updateSpotInfo(spot);
      spot = spotService.view(spotId);
      if (spot == null)
        return null;
      v.setViewName(ViewPaths.SPOT_EDIT);
View Full Code Here

  }

  @RequestMapping(value = "/{spotId}/editintro", method = RequestMethod.POST)
  public ModelAndView submitModifySpotIntroRequest(@PathVariable("spotId") Long spotId, Spot spot) {
    ModelAndView v = new ModelAndView(ViewPaths.USER_LOGIN);
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (user == null)
      return v;
    if (user.getId().equals(spot.getAdministratorId())) {
      spotService.updateSpotIntroduction(spotId, spot.getIntroduction());
      spot = spotService.view(spotId);
      if (spot == null)
        return null;
      v.setViewName(ViewPaths.SPOT_EDIT);
View Full Code Here

   * @param request
   * */
  @RequestMapping(value = "/{spotId}/upload/{albumId}", method = RequestMethod.GET)
  public ModelAndView btachUpload(@PathVariable("spotId") Long spotId,
      @PathVariable("albumId") Long albumId) {
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (user == null) {
      throw new NotLoginException("上传照片必须登录");
    }
    Album album = albumService.getAlbumForChange(albumId, spotId);
    ModelAndView mav = new ModelAndView(ViewPaths.SPOT_UPLOADPHOTO);
View Full Code Here

  Map<String, Object> ajaxvote(@RequestParam("objId") Long objId,
      @RequestParam("star") Integer star) {
    Map<String, Object> map = new HashMap<String, Object>();
    try {

      User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
      if (user == null) {
        map.put("loginStatus", false);
        return map;
      }
      map.put("loginStatus", true);
      if (ratyService.isRaty(objId, user.getId())) {
        Spot spot = spotService.view(objId);

        map.put("SpotStar", spot.getStar());
        map.put("VoteNum", spot.getVotes());
        map.put("Raty_Tag", true);
        return map;
      }
      Spot spot = (Spot) ratyService.ratyStar(objId, RatyObjType.SPOT, user.getId(), star);
      map.put("Star", spot.getStar());
      map.put("VoteNum", spot.getVotes());
      return map;

    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.skyline.user.model.User

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.