Commit d5325d3f by 王祖波

test

parent 137bf8de
...@@ -58,13 +58,6 @@ public class QWmediaTest { ...@@ -58,13 +58,6 @@ public class QWmediaTest {
int TOTAL_REQUESTS = 1800; // 总请求数 int TOTAL_REQUESTS = 1800; // 总请求数
List<String> list = FileUtil.readLines("/Users/wang/Downloads/image.txt", "UTF-8"); List<String> list = FileUtil.readLines("/Users/wang/Downloads/image.txt", "UTF-8");
List<String> qrList = FileUtil.readLines("/Users/wang/Downloads/qrcode.txt", "UTF-8"); List<String> qrList = FileUtil.readLines("/Users/wang/Downloads/qrcode.txt", "UTF-8");
JSONObject jo = new JSONObject();
jo.put("wxEnterpriseId", "b18ffdc9d0644912865a248859914d80");
jo.put("qrCodeUrl", "https://gicinner-1251519181.cos.ap-shanghai.myqcloud.com/image/material_content-4ffc77073ca1476fb264bf1be9f11383.png");
jo.put("showStyle", "0");
jo.put("lineOne", "门店CCA");
jo.put("lineTwo", "宇智222为您推荐");
jo.put("mediaType", 1);
ExecutorService executorService = Executors.newFixedThreadPool(30); // 创建线程池 ExecutorService executorService = Executors.newFixedThreadPool(30); // 创建线程池
Semaphore semaphore = new Semaphore(30); // 限制并发请求数为30 Semaphore semaphore = new Semaphore(30); // 限制并发请求数为30
...@@ -81,6 +74,13 @@ public class QWmediaTest { ...@@ -81,6 +74,13 @@ public class QWmediaTest {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
try { try {
semaphore.acquire(); // 获取许可,控制并发请求 semaphore.acquire(); // 获取许可,控制并发请求
JSONObject jo = new JSONObject();
jo.put("wxEnterpriseId", "b18ffdc9d0644912865a248859914d80");
jo.put("qrCodeUrl", "https://gicinner-1251519181.cos.ap-shanghai.myqcloud.com/image/material_content-4ffc77073ca1476fb264bf1be9f11383.png");
jo.put("showStyle", "0");
jo.put("lineOne", "门店CCA");
jo.put("lineTwo", "宇智222为您推荐");
jo.put("mediaType", 1);
jo.put("imageUrl", list.get(imageId)); jo.put("imageUrl", list.get(imageId));
jo.put("qrCodeUrl", qrList.get(qrId)); jo.put("qrCodeUrl", qrList.get(qrId));
HttpResponse execute = HttpRequest.post("https://www.gicdev.com/haoban-manage3-wx/combined-qw-materialid.json").timeout(-1).body(jo.toJSONString()).execute(); HttpResponse execute = HttpRequest.post("https://www.gicdev.com/haoban-manage3-wx/combined-qw-materialid.json").timeout(-1).body(jo.toJSONString()).execute();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment