Package com.skyline.spot.model

Examples of com.skyline.spot.model.SpotCharacteristic


  }
 
  @Override
  public SpotCharacteristic votes(Long scId, Integer star) {
   
    SpotCharacteristic sc =spotCharacteristicDao.queryCharacteristicById(scId,Activity.NORMAL);
   
    Integer votes = sc.getVotes();
    sc.setVotes(votes + 1);
    float _star = (sc.getStar()*votes + star) / (votes + 1);
    sc.setStar(_star);
    spotCharacteristicDao.updateSpotCharaStar(scId, _star);
    return sc;

  }
View Full Code Here


    return MAPPER;
  }

  public SpotCharacteristic mapRow(ResultSet rs, int rowNum)
      throws SQLException {
    SpotCharacteristic sc = new SpotCharacteristic();
    sc.setId(Long.valueOf(rs.getString(COLUMN_ID)));
    sc.setPortrait(rs.getString(COLUMN_PORTRAIT));
    sc.setSpotId(rs.getLong(COLUMN_SPOT_ID));
    sc.setSpotName(rs.getString(COLUMN_SPOT_NAME));
    sc.setSpotPortrait(rs.getString(COLUMN_SPOT_PORTRAIT));
    sc.setOwnerId(Long.valueOf(rs.getString(COLUMN_OWNER_ID)));
    sc.setOwnerNickname(rs.getString(COLUMN_OWNER_NICKNAME));
    sc.setOwnerPortrait(rs.getString(COLUMN_OWNER_PORTRAIT));

    sc.setCreatorId(Long.valueOf(rs.getString(COLUMN_CREATOR_ID)));
    sc.setCreatorNickname(rs.getString(COLUMN_CREATOR_NICKNAME));
    sc.setCreatorPortrait(rs.getString(COLUMN_CREATOR_PORTRAIT));
    sc.setCharacteristicTitle(rs.getString(COLUMN_CHARA_TITLE));
    sc.setCharacteristicDetail(rs.getString(COLUMN_CHARA_DETAIL));
    sc.setConsume(rs.getInt(COLUMN_CONSUME));
    sc.setAlbumId(rs.getLong(COLUMN_ALBUM_ID));
    sc.setStar(rs.getFloat(COLUMN_STAR));
    sc.setVotes(rs.getInt(COLUMN_VOTES));
    sc.setCreateTime(rs.getDate(COLUMN_CREATETIME));
    sc.setUpdateTime(rs.getDate(COLUMN_UPDATETIME));
    sc.setActivity(Activity.valueOf((rs.getString(COLUMN_ACTIVITY))));
    return sc;
  }
View Full Code Here

  }

  @RequestMapping(value = "{spotId}/{scId}", method = RequestMethod.GET)
  public ModelAndView viewCharRequest(@PathVariable("scId") Long scId) {
    ModelAndView mav = new ModelAndView();
    SpotCharacteristic sc = spotCharaService.queryCharacteristicById(scId, Activity.NORMAL);
    if (sc == null) {
      mav.setViewName(ViewPaths.SPOT_NOTFOUND);
    }
    mav.setViewName(ViewPaths.SPOTCHARA_DETAIL);
    mav.addObject("scInfo", sc);
View Full Code Here

  }

  @RequestMapping(value = "/detail/{charaId}", method = RequestMethod.GET)
  public ModelAndView showCharaDetail(@PathVariable("charaId") Long charaId) {
    ModelAndView mav = new ModelAndView();
    SpotCharacteristic spotChara = spotCharaService.queryCharacteristicById(charaId,
        Activity.NORMAL);
    if (spotChara == null) {
      mav.setViewName(ViewPaths.SPOT_NOTFOUND);
      return mav;
    }
View Full Code Here

      if (user == null) {
        map.put("loginStatus", false);
        return map;
      }
      map.put("loginStatus", true);
      SpotCharacteristic sc = spotCharaService.votes(objId, star);
      map.put("Star", sc.getStar());
      map.put("VoteNum", sc.getVotes());
      return map;

    } catch (Exception e) {
      e.printStackTrace();
      return null;
View Full Code Here

TOP

Related Classes of com.skyline.spot.model.SpotCharacteristic

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.