Commit 07383f9d authored by 张艳玲's avatar 张艳玲

小程序分享增加短链

parent 7965fb6c
...@@ -8,6 +8,7 @@ import com.kjj.cases.admin.Authorization; ...@@ -8,6 +8,7 @@ import com.kjj.cases.admin.Authorization;
import com.kjj.config.BasicConfig; import com.kjj.config.BasicConfig;
import com.kjj.constants.LiveConstants; import com.kjj.constants.LiveConstants;
import com.kjj.utils.JsonUtil; import com.kjj.utils.JsonUtil;
import com.kjj.utils.ThreadSleepUtils;
import io.restassured.response.Response; import io.restassured.response.Response;
import org.apache.commons.lang3.RandomUtils; import org.apache.commons.lang3.RandomUtils;
import org.testng.Assert; import org.testng.Assert;
...@@ -440,6 +441,24 @@ public class Agent implements Authorization { ...@@ -440,6 +441,24 @@ public class Agent implements Authorization {
} }
@Test(description="获取小程序短链",priority = 28)
public void 获取小程序短链() {
Map<String, Object> params = new HashMap<String, Object>();
params.put("liveId", LiveConstants.getValue(LiveConstants.StringKeyEnum.ENCODE_LIVE_ID.getKey()));
params.put("shortType",2);
Response response =null;
for (int i = 0; i < 10; i++) {
response = network.postResponse(params,MOBILE_getShortUrl);
String data = response.jsonPath().getString("data");
System.out.println(data);
if (data!=null) return;
}
Assert.fail(network.message(params, BasicConfig.MOBILE_getShortUrl, "获取小程序短链失败", response.body().asString()));
}
} }
......
...@@ -49,7 +49,7 @@ public class SaveLive implements Authorization { ...@@ -49,7 +49,7 @@ public class SaveLive implements Authorization {
long broadcastTime = DateUtils.addHours(new Date(), 5).getTime(); long broadcastTime = DateUtils.addHours(new Date(), 5).getTime();
Params.put("noticeTime", noticeTime); Params.put("noticeTime", noticeTime);
Params.put("broadcastTime", broadcastTime); Params.put("broadcastTime", broadcastTime);
Params.put("shareContent", "自动化直播"); Params.put("shareContent", "自动化直播 #{shortLink}");
Params.put("shelfStatus", 2); Params.put("shelfStatus", 2);
Params.put("secondPoster", "https://streamimg.kjjcrm.com/kjy/image/20210201/cc999ebde48e49f99ac3f0d93480453f.jpg"); Params.put("secondPoster", "https://streamimg.kjjcrm.com/kjy/image/20210201/cc999ebde48e49f99ac3f0d93480453f.jpg");
Params.put("regionType",2); Params.put("regionType",2);
......
...@@ -470,7 +470,7 @@ public class BasicConfig { ...@@ -470,7 +470,7 @@ public class BasicConfig {
public static final String MOBILE_pasterOn = MOBILE_HOST + "/conf/live/push/pasterOn"; public static final String MOBILE_pasterOn = MOBILE_HOST + "/conf/live/push/pasterOn";
public static final String MOBILE_pasterInfo = MOBILE_HOST + "/clue/paster/info"; public static final String MOBILE_pasterInfo = MOBILE_HOST + "/clue/paster/info";
public static final String MOBILE_pasterOff = MOBILE_HOST + "/conf/live/push/pasterOff"; public static final String MOBILE_pasterOff = MOBILE_HOST + "/conf/live/push/pasterOff";
public static final String MOBILE_getShortUrl = MOBILE_HOST + "/kjy/live/share/short/getShortUrl";
//投票 //投票
......
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