Package com.skyline.spot.model

Examples of com.skyline.spot.model.Suggestion


  //返回autocomplete的数据
  @SuppressWarnings("unchecked")
  @RequestMapping(value="/invite/getSuggestion")
  public @ResponseBody Suggestion getSuggestion(String query){
   
    Suggestion sgg = new Suggestion();
    sgg.setQuery(query);
   
    ArrayList<Fan> fanList = null;
    fanList = (ArrayList<Fan>)WebHelper.getSessionAttribute(null, Constant.SESSION_FANS);
    List<String> suggs = new ArrayList<String>();
    List<String> datas = new ArrayList<String>();
   
    for(Fan fan:fanList){
      //忽略大小写 首字母匹配
      if(fan.getFanNickname().toLowerCase().indexOf(query.toLowerCase()) == 0){
        suggs.add(fan.getFanNickname());
        datas.add(fan.getFanId()+","+fan.getFanNickname()+","+fan.getFanPortrait());
      }
    }
    sgg.setSuggestions(suggs);
    sgg.setData(datas);   
   
    return sgg;
  }
View Full Code Here

TOP

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

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.