|
|
@ -6,15 +6,12 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.taobao.api.ApiException;
|
|
|
|
import com.taobao.api.ApiException;
|
|
|
|
import com.taobao.api.DefaultTaobaoClient;
|
|
|
|
import com.taobao.api.DefaultTaobaoClient;
|
|
|
|
import com.taobao.api.TaobaoClient;
|
|
|
|
import com.taobao.api.TaobaoClient;
|
|
|
|
import com.taobao.api.domain.OpenImUser;
|
|
|
|
|
|
|
|
import com.taobao.api.domain.Userinfos;
|
|
|
|
import com.taobao.api.domain.Userinfos;
|
|
|
|
import com.taobao.api.request.OpenimCustmsgPushRequest;
|
|
|
|
import com.taobao.api.request.OpenimCustmsgPushRequest;
|
|
|
|
import com.taobao.api.request.OpenimRelationsGetRequest;
|
|
|
|
|
|
|
|
import com.taobao.api.request.OpenimUsersAddRequest;
|
|
|
|
import com.taobao.api.request.OpenimUsersAddRequest;
|
|
|
|
import com.taobao.api.request.OpenimUsersGetRequest;
|
|
|
|
import com.taobao.api.request.OpenimUsersGetRequest;
|
|
|
|
import com.taobao.api.request.OpenimUsersUpdateRequest;
|
|
|
|
import com.taobao.api.request.OpenimUsersUpdateRequest;
|
|
|
|
import com.taobao.api.response.OpenimCustmsgPushResponse;
|
|
|
|
import com.taobao.api.response.OpenimCustmsgPushResponse;
|
|
|
|
import com.taobao.api.response.OpenimRelationsGetResponse;
|
|
|
|
|
|
|
|
import com.taobao.api.response.OpenimUsersAddResponse;
|
|
|
|
import com.taobao.api.response.OpenimUsersAddResponse;
|
|
|
|
import com.taobao.api.response.OpenimUsersGetResponse;
|
|
|
|
import com.taobao.api.response.OpenimUsersGetResponse;
|
|
|
|
import com.taobao.api.response.OpenimUsersUpdateResponse;
|
|
|
|
import com.taobao.api.response.OpenimUsersUpdateResponse;
|
|
|
@ -23,6 +20,7 @@ import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -112,14 +110,15 @@ public class OpenimClient {
|
|
|
|
String secret = "7639427973bd671be15c9d0c1e9c90b4";
|
|
|
|
String secret = "7639427973bd671be15c9d0c1e9c90b4";
|
|
|
|
String url = "https://eco.taobao.com/router/rest";
|
|
|
|
String url = "https://eco.taobao.com/router/rest";
|
|
|
|
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
|
|
|
|
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
|
|
|
|
OpenimRelationsGetRequest req = new OpenimRelationsGetRequest();
|
|
|
|
OpenimUsersAddRequest req = new OpenimUsersAddRequest();
|
|
|
|
req.setBegDate("20180701");
|
|
|
|
List<Userinfos> list2 = new ArrayList<Userinfos>();
|
|
|
|
req.setEndDate("20180711");
|
|
|
|
Userinfos obj3 = new Userinfos();
|
|
|
|
OpenImUser obj1 = new OpenImUser();
|
|
|
|
list2.add(obj3);
|
|
|
|
obj1.setUid("imuser123");
|
|
|
|
obj3.setNick("im123");
|
|
|
|
obj1.setTaobaoAccount(false);
|
|
|
|
obj3.setUserid("im123");
|
|
|
|
req.setUser(obj1);
|
|
|
|
obj3.setPassword("xxxxxx");
|
|
|
|
OpenimRelationsGetResponse rsp = null;
|
|
|
|
req.setUserinfos(list2);
|
|
|
|
|
|
|
|
OpenimUsersAddResponse rsp = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
rsp = client.execute(req);
|
|
|
|
rsp = client.execute(req);
|
|
|
|
} catch (ApiException e) {
|
|
|
|
} catch (ApiException e) {
|
|
|
|