开启左侧

更新企微通讯录成员

[复制链接]
在线会员 8gzFs0CV 发表于 2022-12-30 14:43:11 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
民间文档地点革新成员 - 交心文档 - 企业微疑开辟者中间
启交上一篇专文读与企微通信录成员_wzn1054162229的专客-CSDN专客
  1. public static Map<String, Object> updateUser(Map<String, Object> userMap) throws Exception {
  2.                 Map<String, Object> resultMap = new HashMap<>();
  3.                 try {
  4.                         // 校验必挖
  5.                         MapUtil.checkStringExistMap(userMap, "userid");
  6.                         String accessToken = getToken("");
  7.                         String result = HttpsUtil.postHttpJson(update_user_url, "access_token=" + accessToken, userMap);
  8.                         resultMap = orderSimpleResult(result);
  9.                         return resultMap;
  10.                 } catch (Exception e) {
  11.                         throw new Exception(e);
  12.                 }
  13.         }
  14. public static Map<String, Object> orderSimpleResult(String result) throws Exception {
  15.                 Map<String, Object> resultMap = CheckJSONDataUtil.checkJSONData(result);
  16.                 // 剖析企业微疑前去
  17.                 if (resultMap == null || StringUtils.isEmpty(resultMap.get("errcode"))) {
  18.                         throw new Exception(-1, "没法得到企业微疑照应成果");
  19.                 }
  20.                 if (ObjectParser.toInteger(resultMap.get("errcode")) != 0) {
  21.                         resultMap.put("code", resultMap.get("errcode"));
  22.                         resultMap.put("msg", resultMap.get("errmsg"));
  23.                         return resultMap;
  24.                 }
  25.                 // 将code变换
  26.                 resultMap.put("code", resultMap.get("errcode"));
  27.                 resultMap.put("msg", "操纵胜利");
  28.                 resultMap.remove("errcode");
  29.                 resultMap.remove("errmsg");
  30.                 return resultMap;
  31.         }
复造代码
您需要登录后才可以回帖 登录 | 立即注册 qq_login

本版积分规则

发布主题
阅读排行更多+
用专业创造成效
400-778-7781
周一至周五 9:00-18:00
意见反馈:server@mailiao.group
紧急联系:181-67184787
ftqrcode

扫一扫关注我们

Powered by 职贝云数A新零售门户 X3.5© 2004-2025 职贝云数 Inc.( 蜀ICP备2024104722号 )