| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- package com.uas.ps.inquiry;
- import com.alibaba.fastjson.JSON;
- import com.uas.ps.inquiry.util.HttpUtil;
- import org.junit.Test;
- import java.util.HashMap;
- /**
- * @author dongbw
- * @since 2018年9月26日
- */
- public class PublicApiTest extends BaseJunitTest {
- /**
- * localhost
- */
- private static final String localhost = "http://10.1.51.82:24002";
- /**
- * dev
- */
- private static final String dev_url = "http://192.168.253.12:24000";
- /**
- * userUU
- */
- private static final Long userUU = 1000002503L;
- /**
- * enUU
- */
- private static final Long enUU = 10041166L;
- /**
- * /sum/publish/personal
- * @throws Exception
- */
- @Test
- public void sumPersonalPublish() throws Exception {
- HashMap<String, Object> params = new HashMap<>();
- params.put("useruu", userUU);
- params.put("enuu", enUU);
- params.put("starttime", System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 2);
- params.put("endtime", System.currentTimeMillis());
- HttpUtil.Response res = HttpUtil.sendGetRequest(localhost+ "/inquiry/api/sum/publish/personal", params);
- System.out.println(JSON.toJSON(res));
- }
- /**
- * /sum/publish/enterprise
- * @throws Exception
- */
- @Test
- public void sumEnterprisePublish() throws Exception {
- HashMap<String, Object> params = new HashMap<>();
- params.put("enuu", enUU);
- params.put("starttime", System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 2);
- params.put("endtime", System.currentTimeMillis());
- HttpUtil.Response res = HttpUtil.sendGetRequest("http://10.1.51.82:24002" + "/inquiry/api/sum/publish/enterprise", params);
- System.out.println(JSON.toJSON(res));
- }
- /**
- * /sum/reply/personal
- * @throws Exception
- */
- @Test
- public void sumPersonalReply() throws Exception {
- HashMap<String, Object> params = new HashMap<>();
- params.put("useruu", userUU);
- params.put("enuu", enUU);
- params.put("starttime", System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 2);
- params.put("endtime", System.currentTimeMillis());
- HttpUtil.Response res = HttpUtil.sendGetRequest(localhost+ "/inquiry/api/sum/reply/personal", params);
- System.out.println(JSON.toJSON(res));
- }
- /**
- * /sum/reply/enterprise
- * @throws Exception
- */
- @Test
- public void sumEnterpriseReply() throws Exception {
- HashMap<String, Object> params = new HashMap<>();
- params.put("enuu", enUU);
- params.put("starttime", System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 2);
- params.put("endtime", System.currentTimeMillis());
- HttpUtil.Response res = HttpUtil.sendGetRequest(localhost + "/inquiry/api/sum/reply/enterprise", params);
- System.out.println(JSON.toJSON(res));
- }
- /**
- * /sum/all/time
- * @throws Exception
- */
- @Test
- public void sumPublishWithTime() throws Exception {
- HttpUtil.Response res = HttpUtil.sendGetRequest(localhost + "/inquiry/api/sum/all/time?time=" + System.currentTimeMillis(), null);
- System.out.println(JSON.toJSON(res));
- }
- /**
- * /sum/all/scope
- * @throws Exception
- */
- @Test
- public void sumPublishWithTimeScope() throws Exception {
- HashMap<String, Object> params = new HashMap<>();
- params.put("starttime", System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 7);
- params.put("endtime", System.currentTimeMillis());
- HttpUtil.Response res = HttpUtil.sendGetRequest(localhost + "/inquiry/api/sum/all/scope", params);
- System.out.println(JSON.toJSON(res));
- }
- }
|