记得上下班打卡 | git大法好,push需谨慎

Commit 499187a2 authored by 张国柄's avatar 张国柄

+log;

parent 5d709780
......@@ -12,6 +12,7 @@ import com.liquidnet.commons.lang.util.HttpUtil;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.commons.lang.util.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
......@@ -98,21 +99,20 @@ public class EasemobUtil{
// ObjectNode objectNode = JsonUtils.OM().createObjectNode();
try {
response = HttpUtil.postJson(requestUrl,json.toString(),commonHeader);
}
catch(HttpClientErrorException e){
} catch(HttpClientErrorException e) {
log.error("createUser error", e);
if(e.getRawStatusCode() == 400){
JSONObject jsonObject = JsonUtils.fromJson(e.getResponseBodyAsString(), new TypeReference<JSONObject>() {});
log.info("createUser error : {}",jsonObject.get("error"));
log.info("createUser error_description : {}",jsonObject.get("error_description"));
return jsonObject.toJSONString();
}
}catch (Exception e) {
e.printStackTrace();
log.error("createUser error : {}",e);
log.error("createUser error",e);
}
log.info("createUsers--->>> response : {} ",response);
if (StringUtils.isEmpty(response)) {
return response;
}
ObjectNode jsonObject = JsonUtils.fromJson(response,ObjectNode.class);
ArrayNode arrayNode = (ArrayNode)jsonObject.get("entities");
response = arrayNode.get(0).toString();
......
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