质量接口测试v2

master
yinq 2 years ago
parent de5beb2b10
commit 6157d9c8ce

@ -167,20 +167,24 @@ public class TemporaryFixController {
* @return
*/
@PostMapping("/getURL")
@ResponseBody
public R getURL(Map paramMap) {
// paramMap.put("materialCode","A10000");
public R getURL(@RequestBody Map paramMap) {
String respBody = null;
try {
String requestUrl = yunBpmConfig.getApiBaseUrl() + "/api/login/Authentication/get_code";
Map<String, Object> params = new HashMap<>();
params.put("username", yunBpmConfig.userName);
params.put("password", yunBpmConfig.passWord);
params.put("url", yunBpmConfig.getApiBaseUrl() + "/api/login?redirect_uri="
+ yunBpmConfig.getApiBaseUrl() +
"/api/oauth/authorize?client_id=api&response_type=code&scope=read&redirect_uri="
+ yunBpmConfig.getApiBaseUrl() + "/oauth");
respBody = HttpUtil.post(requestUrl, JSONUtil.toJsonStr(params),1000 * 10);
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";
Map<String, Object> params = new HashMap<>();
params.put("username", yunBpmConfig.userName);
params.put("password", yunBpmConfig.passWord);
params.put("url", yunBpmConfig.getApiBaseUrl() + "/api/login?redirect_uri="
+ yunBpmConfig.getApiBaseUrl() +
"/api/oauth/authorize?client_id=api&response_type=code&scope=read&redirect_uri="
+ yunBpmConfig.getApiBaseUrl() + "/oauth");
respBody = HttpUtil.post(requestUrl, JSONUtil.toJsonStr(params),1000 * 10);
}
} catch (Exception e) {
return R.failed(e.toString());
}

Loading…
Cancel
Save