Commit 16762587 authored by 赵然's avatar 赵然

zr

parent 07a27783
...@@ -27,7 +27,7 @@ public class HbaseService { ...@@ -27,7 +27,7 @@ public class HbaseService {
private static String activtyHost = "http://activity.m.duibatest.com.cn"; private static String activtyHost = "http://activity.m.duibatest.com.cn";
public static Response getHBASEKey(String key,String reverse) { public static Response getHBASEKey(String key,String reverse,String hashkey) {
String url = activtyHost + "/aaw/hb/get"; String url = activtyHost + "/aaw/hb/get";
...@@ -38,12 +38,15 @@ public class HbaseService { ...@@ -38,12 +38,15 @@ public class HbaseService {
}else { }else {
parm.put("reverse", reverse); parm.put("reverse", reverse);
} }
if(hashkey.equals("2")){
parm.put("hashkey", hashkey);
}
Response response = given().params(parm).get(url); Response response = given().params(parm).get(url);
return response; return response;
} }
public static Response reset(String key,String lvalue,String reverse) { public static Response reset(String key,String lvalue,String reverse,String hashkey) {
String url = activtyHost + "/aaw/hb/reset/lvalue"; String url = activtyHost + "/aaw/hb/reset/lvalue";
...@@ -55,6 +58,9 @@ public class HbaseService { ...@@ -55,6 +58,9 @@ public class HbaseService {
}else { }else {
parm.put("reverse", reverse); parm.put("reverse", reverse);
} }
if(hashkey.equals("2")){
parm.put("hashkey", hashkey);
}
Response response = given().params(parm).get(url); Response response = given().params(parm).get(url);
return response; return response;
} }
......
...@@ -23,26 +23,31 @@ public class HbaseModule { ...@@ -23,26 +23,31 @@ public class HbaseModule {
@ResponseBody @ResponseBody
public Map urlLink(HttpServletRequest request) throws Exception { public Map urlLink(HttpServletRequest request) throws Exception {
String select = request.getParameter("select"); String select = request.getParameter("select");
String reverse = request.getParameter("reverse"); String reverse = request.getParameter("reverse");
if(reverse.equals(null) || reverse.equals("") || reverse.isEmpty()){ String hashkey = request.getParameter("hashkey");
reverse = "false";
} // if(reverse.equals(null) || reverse.equals("") || reverse.isEmpty()){
// reverse = "false";
// }
// if(hashkey.equals(null) || hashkey.equals("") || hashkey.isEmpty()){
// hashkey = "false";
// }
String key = request.getParameter("key"); String key = request.getParameter("key");
String value = request.getParameter("value"); String value = request.getParameter("value");
System.out.println("select为:"+select); System.out.println("select为:"+select);
System.out.println("reverse为:"+reverse); System.out.println("reverse为:"+reverse);
System.out.println("hashkey为:"+hashkey);
System.out.println("key为:"+key); System.out.println("key为:"+key);
System.out.println("value为:"+value); System.out.println("value为:"+value);
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
if(select.equals("search")){ if(select.equals("search")){
Response response = HbaseService.getHBASEKey(key,reverse); Response response = HbaseService.getHBASEKey(key,reverse,hashkey);
map.put("message", response.asString()); map.put("message", response.asString());
} }
if(select.equals("reset")){ if(select.equals("reset")){
Response response = HbaseService.reset(key,value,reverse); Response response = HbaseService.reset(key,value,reverse,hashkey);
map.put("message", response.asString()); map.put("message", response.asString());
} }
return map; return map;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment