コード例 #1
0
ファイル: Weights.java プロジェクト: dengtong/godlike
 public void index(Map<String, Object> context) {
   final String service = StringUtils.trimToNull((String) context.get("service"));
   String address = (String) context.get("address");
   address = Tool.getIP(address);
   List<Weight> weights;
   if (service != null && service.length() > 0) {
     weights = OverrideUtils.overridesToWeights(overrideService.findByService(service));
   } else if (address != null && address.length() > 0) {
     weights = OverrideUtils.overridesToWeights(overrideService.findByAddress(address));
   } else {
     weights = OverrideUtils.overridesToWeights(overrideService.findAll());
   }
   context.put("weights", weights);
 }