质量接口测试v2

master
yinq 2 years ago
parent de5beb2b10
commit 6157d9c8ce

@ -167,11 +167,14 @@ public class TemporaryFixController {
* @return * @return
*/ */
@PostMapping("/getURL") @PostMapping("/getURL")
@ResponseBody public R getURL(@RequestBody Map paramMap) {
public R getURL(Map paramMap) {
// paramMap.put("materialCode","A10000");
String respBody = null; String respBody = null;
try { try {
if (paramMap.containsKey("url")){
String params = JSONUtil.toJsonStr(paramMap);
respBody = HttpUtil.post(String.valueOf(paramMap.get("url")), params, 1000 * 10);
respBody = respBody.concat("[测试]");
}else {
String requestUrl = yunBpmConfig.getApiBaseUrl() + "/api/login/Authentication/get_code"; String requestUrl = yunBpmConfig.getApiBaseUrl() + "/api/login/Authentication/get_code";
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
params.put("username", yunBpmConfig.userName); params.put("username", yunBpmConfig.userName);
@ -181,6 +184,7 @@ public class TemporaryFixController {
"/api/oauth/authorize?client_id=api&response_type=code&scope=read&redirect_uri=" "/api/oauth/authorize?client_id=api&response_type=code&scope=read&redirect_uri="
+ yunBpmConfig.getApiBaseUrl() + "/oauth"); + yunBpmConfig.getApiBaseUrl() + "/oauth");
respBody = HttpUtil.post(requestUrl, JSONUtil.toJsonStr(params),1000 * 10); respBody = HttpUtil.post(requestUrl, JSONUtil.toJsonStr(params),1000 * 10);
}
} catch (Exception e) { } catch (Exception e) {
return R.failed(e.toString()); return R.failed(e.toString());
} }

Loading…
Cancel
Save