发送请求的代码
public Object getExcelData(String url, String params, List<XtExcelDownLoadPojo> dataList) {
System.out.println(url);
System.out.println(params);
String resultJson = HttpClientUtil.getInstance().sendHttpPost("http://localhost:8080" + url,params,"application/json");
System.out.println(resultJson);
return null;
}
参数:
url:
/fzzl/hrp/m/employee/controller/mEmployee/queryEmployeeList
params:{"name":"","idCard":"","startDateShort":"","endDateShort":"","customerIds":"","customerStoreIds":"","customerPositionIds":"","employeeStatusId":"1","isSpecificDisease":""}
要请求的代码
@At("/queryEmployeeList")
@Ok("json")
public Object queryEmployeeList(@Param("..") Map map) {
System.out.println("我来了.");
return mEmployeeService.queryEmployeeList(map);
}
log日志:
2018-03-13 17:31:09 [DEBUG] org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) - Found mapping for [POST] path=/hrp/m/employee/controller/mEmployee/queryEmployeeList : MEmployeeAction.queryEmployeeList(MEmployeeAction.java:91)
2018-03-13 17:31:09 [DEBUG] org.nutz.ioc.impl.NutIoc.get(NutIoc.java:157) - Get 'mEmployeeAction'<class com.fzzl.hrp.m.employee.controller.MEmployeeAction>