|
|
@@ -3,6 +3,7 @@ package com.goafanti.customer.service.impl;
|
|
|
import com.goafanti.common.dao.UserArchivesMapper;
|
|
|
import com.goafanti.common.utils.HttpUtils;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
+import com.goafanti.customer.bo.InputCallNumber;
|
|
|
import com.goafanti.customer.service.UserOutboundService;
|
|
|
import org.apache.shiro.crypto.hash.SimpleHash;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -22,6 +23,17 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<UserArchivesMapper>
|
|
|
public Object checkUser(Integer type) {
|
|
|
String url= default_url +"/openapi/"+version+"/getClientInfo";
|
|
|
Map<String,Object> param=new HashMap<>();
|
|
|
+ param.put("authentication",getAuthentication());
|
|
|
+ Map<String,Object> request=new HashMap<>();
|
|
|
+ request.put("type",type);
|
|
|
+ param.put("request",request);
|
|
|
+ HttpUtils httpUtils=new HttpUtils();
|
|
|
+ String s = httpUtils.sendHttpsRequest(url, "POST", param);
|
|
|
+ System.out.println(s);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String, Object> getAuthentication() {
|
|
|
Map<String,Object> authentication=new HashMap<>();
|
|
|
authentication.put("customer","C322");
|
|
|
long timeMillis = System.currentTimeMillis();
|
|
|
@@ -32,12 +44,22 @@ public class UserOutboundServiceImpl extends BaseMybatisDao<UserArchivesMapper>
|
|
|
String md5 = new SimpleHash("MD5", digestSource).toHex();
|
|
|
// System.out.println("md5="+md5);
|
|
|
authentication.put("digest",md5);
|
|
|
- param.put("authentication",authentication);
|
|
|
+ return authentication;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object callNumber(InputCallNumber in) {
|
|
|
+ String url= default_url +"/openapi/"+version+"/callNumber";
|
|
|
+ Map<String,Object> param=new HashMap<>();
|
|
|
+ param.put("authentication",getAuthentication());
|
|
|
Map<String,Object> request=new HashMap<>();
|
|
|
- request.put("type",type);
|
|
|
+ request.put("agent",in.getAgent());
|
|
|
+ request.put("callee",in.getCallee());
|
|
|
param.put("request",request);
|
|
|
HttpUtils httpUtils=new HttpUtils();
|
|
|
String s = httpUtils.sendHttpsRequest(url, "POST", param);
|
|
|
+ System.out.println("url="+url);
|
|
|
+ System.out.println("param="+param);
|
|
|
System.out.println(s);
|
|
|
return null;
|
|
|
}
|