Package com.skyline.user.model

Examples of com.skyline.user.model.User


   */
  @RequestMapping(value = "/{spotId}/postref/{refType}", method = RequestMethod.GET)
  public ModelAndView postRefrenceToSpotRequest(
      @PathVariable("spotId") Long spotId,
      @PathVariable("refType") String refType) {
    User user = (User) WebHelper.getSessionAttribute(null,
        Constant.SESSION_USER);
    ModelAndView mav = new ModelAndView();
    if (user == null) {
      mav.setViewName(ViewPaths.USER_LOGIN);
      return mav;
    }
    Spot spotInfo = spotService.getSpot(spotId);
    mav.addObject("spotInfo", spotInfo);
    Page page = new Page();
    page.setSize(listRefrencePageSize);
    if (refType.equals("ALBUM")) {
      List<Album> albumList = albumService
          .listAlbumsOfUserWithoutPortrait(user.getId(),
              user.getId(), Authority.PUBLIC, page);
      mav.addObject("albumList", albumList);
      mav.setViewName(ViewPaths.SPOTREFRENCE_ADD);
      return mav;
    }
    if (refType.equals("NOTE")) {
View Full Code Here


      String spotPortrait, Long refrenceId, String refrencePortrait,
      String refrenceTitle, String refrenceDigest,
      SpotRefrenceType refrenceType) {
    ModelAndView mav = new ModelAndView();
    try {
      User user = (User) WebHelper.getSessionAttribute(null,
          Constant.SESSION_USER);
      if (user == null) {
        mav.setViewName(ViewPaths.USER_LOGIN);
        return mav;
      }
      Long returnRefId = spotRefrenceService.postToSpot(refrenceId,
          refrencePortrait, refrenceTitle, refrenceDigest,
          refrenceType, spotId, spotName, spotPortrait, user.getId(),
          user.getNickname(), user.getPortrait(), user.getEmail());
      if (returnRefId != null && returnRefId != 0) {
        /**
         * 做成ajax方式的递交
         */
        // map.put("PostSuccess", true);
View Full Code Here

  }

  @RequestMapping(value = "{spotId}/add", method = RequestMethod.GET)
  public ModelAndView addSpotCharaGetRequest(@PathVariable("spotId") Long spotId) {
    ModelAndView mav = new ModelAndView(ViewPaths.SPOTCHARA_ADD);
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (user == null) {
      mav.setViewName(ViewPaths.USER_LOGIN);
      return mav;
    }
    Integer authority = Authority.PUBLIC;
    Page page = new Page();
    page.setSize(6);
    Spot spot = spotService.view(spotId);
    if (user.getId().equals(spot.getAdministratorId())) {
      authority = Authority.ADMIN;
    }
    List<SpotCharacteristic> scList = spotCharaService.queryCharacteristicBySpotId(spotId,
        page, Activity.NORMAL);
    mav.addObject("spotInfo", spot);
View Full Code Here

  }

  @RequestMapping(value = "/add", method = RequestMethod.POST)
  public ModelAndView addSpotCharaPostRequest(SpotCharacteristic sc) {
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    ModelAndView mav = new ModelAndView();
    if (user == null) {
      mav.setViewName(ViewPaths.USER_LOGIN);
      return mav;
    }
    sc.setCreatorId(user.getId());
    sc.setCreatorNickname(user.getNickname());
    sc.setCreatorPortrait(user.getPortrait());
    sc = spotCharaService.addCharacteristic(sc);
    if (sc == null) {
      // TODO 错误页面
      return mav;
    }
View Full Code Here

   * @param request
   * */
  @RequestMapping(value = "/{spotId}/{spotcharaId}/upload/{albumId}", method = RequestMethod.GET)
  public ModelAndView btachUpload(@PathVariable("spotId") Long spotId,
      @PathVariable("spotcharaId") Long spotcharaId, @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.SPOTCHARA_UPLOADPHOTO);
View Full Code Here

  @RequestMapping(value = "/buploadok/{ownerId}/{albumId}", method = RequestMethod.POST)
  public @ResponseBody
  Map<String, Object> batchUploadSpotOk(@PathVariable("ownerId") Long ownerId,
      @PathVariable("albumId") Long albumId, @RequestParam("files") String files) {
    Map<String, Object> result = new HashMap<String, Object>();
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    Spot spot = spotService.getSpot(ownerId);
    if (spot == null) {
      result.put("success", Boolean.FALSE);
      result.put("errmsg", "不存在制定spot");
      return result;
    }
    if (user == null) {
      result.put("success", Boolean.FALSE);
      result.put("errmsg", "压缩图片必须");
      result.put("logined", Boolean.FALSE);
      return result;
    } else {
      result.put("logined", Boolean.TRUE);
    }
    String[] filesPath = files.split("\\|");
    List<File> localFiles = new ArrayList<File>();
    for (String filePath : filesPath) {
      if (!StringUtils.hasLength(filePath)) {
        continue;
      }
      File localFile = new File(filePath);
      localFiles.add(localFile);
    }
    if (localFiles.isEmpty()) {
      result.put("success", Boolean.FALSE);
      result.put("errmsg", "没有找到需要压缩的文件!");
      return result;
    }
    StringBuilder message = new StringBuilder();
    List<SkylineImageResizeTask> tasks = prepareResizeTask(localFiles, ownerId, albumId,
        message);
    if (tasks == null || tasks.isEmpty()) {
      result.put("success", Boolean.FALSE);
      result.put("errmsg", "没有找到需要压缩的文件!");
      return result;
    }

    List<ImageResizeResult> results = imagine.processImage(localStorePath, tasks);
    List<ImageResizeResult> filesInfo = processResizeResult(results, message);

    Album album = null;
    try {
      album = albumService.getAlbumForChange(albumId, ownerId);
    } catch (Exception e) {
      LOGGER.warn("获取相册失败", e);
      result.put("success", Boolean.FALSE);
      result.put("errmsg", "没有找到对应相册,压缩图片失败!");
      return result;

    }
    List<Photo> photos = null;

    if (!filesInfo.isEmpty()) {
      /**
       * 构造一个spot User
       */
      User tempUser = new User();
      tempUser.setId(ownerId);
      tempUser.setNickname(spot.getName());
      tempUser.setPortrait(spot.getPortrait());
      photos = albumService.createPhotos(tempUser, album, filesInfo);
    }

    Map<Long, List<Photo>> filesMap = (Map<Long, List<Photo>>) WebHelper.getSessionAttribute(
        null, Constant.SESSION_UPLOAD_OK_FILES);
View Full Code Here

   * @param request
   * */
  @RequestMapping(value = "/uploadok/{ownerId}/{charaId}/{albumId}", method = RequestMethod.GET)
  public ModelAndView uploadSpotCharaOk(@PathVariable("ownerId") Long ownerId,
      @PathVariable("charaId") Long charaId, @PathVariable("albumId") Long albumId) {
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (user == null) {
      throw new NotLoginException("上传照片必须登录");
    }
//    long userId = user.getId();
    Album album = albumService.getAlbumForChange(albumId, ownerId);
View Full Code Here

  @RequestMapping(value = "/uploadok/{ownerId}/{charaId}/{albumId}", method = RequestMethod.POST)
  public ModelAndView uploadSpotCharaOk(@PathVariable("ownerId") Long ownerId,
      @PathVariable("charaId") Long charaId, @PathVariable("albumId") Long albumId,
      String cover, String ext, @RequestParam("description") List<String> descriptions,
      @RequestParam("id") List<Long> ids, String submitToken) {
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (user == null) {
      throw new NotLoginException("上传照片必须登录");
    }
    // if (!WebHelper.isTokenValid(request, true)) {
    // String url = buildRecirectPath(request, URL_PREFIX + "/uploadok/" +
View Full Code Here

  Map<String, Object> supportCharRequest(@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);
View Full Code Here

  @RequestMapping(value = "/invite", method = RequestMethod.GET)
  public ModelAndView inviteFriends() {
    ModelAndView mav = new ModelAndView();
    mav.setViewName(ViewPaths.SPOT_INVITE);

    User user = WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    long userId = user.getId();

    Page page = new Page();
    page.setCurpage(5);
    page.setSize(20);
    page.setTotal(120);
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.