@Action(value="telephone")
public String telephoneValidation() throws Exception{
ServletActionContext.getResponse().setContentType("utf-8");
//利用web service完成电话号码的验证
//获取telephone
String telephone = (String) ServletActionContext.getContext().getParameters().get("tlephone");
Customer customer = WebClient.create("http://localhost:9002/crm_management/services/customerService/telephoneValidation/"+telephone).accept(MediaType.APPLICATION_JSON).get(Customer.class);
if(customer != null){
ServletActionContext.getResponse().getWriter().write("此号码已经被占用");
System.out.println("此号码已经被占用");
}else {
ServletActionContext.getResponse().getWriter().write("此号码可用");
System.out.println("此号码可用");
}
return NONE;
}
public String telephoneValidation() throws Exception{
ServletActionContext.getResponse().setContentType("utf-8");
//利用web service完成电话号码的验证
//获取telephone
String telephone = (String) ServletActionContext.getContext().getParameters().get("tlephone");
Customer customer = WebClient.create("http://localhost:9002/crm_management/services/customerService/telephoneValidation/"+telephone).accept(MediaType.APPLICATION_JSON).get(Customer.class);
if(customer != null){
ServletActionContext.getResponse().getWriter().write("此号码已经被占用");
System.out.println("此号码已经被占用");
}else {
ServletActionContext.getResponse().getWriter().write("此号码可用");
System.out.println("此号码可用");
}
return NONE;
}