| @@ -49,7 +49,6 @@ public class WxMaCloudServiceImpl implements WxMaCloudService { | |||||
| @Override | @Override | ||||
| public List<String> add(String collection, List list) throws WxErrorException { | public List<String> add(String collection, List list) throws WxErrorException { | ||||
| String jsonData = WxMaGsonBuilder.create().toJson(list); | String jsonData = WxMaGsonBuilder.create().toJson(list); | ||||
| String query = JoinerUtils.blankJoiner.join( | String query = JoinerUtils.blankJoiner.join( | ||||
| "db.collection('", collection, "')", | "db.collection('", collection, "')", | ||||
| @@ -67,9 +66,7 @@ public class WxMaCloudServiceImpl implements WxMaCloudService { | |||||
| } | } | ||||
| JsonArray idArray = jsonObject.getAsJsonArray("id_list"); | JsonArray idArray = jsonObject.getAsJsonArray("id_list"); | ||||
| List<String> idList = new ArrayList<>(); | List<String> idList = new ArrayList<>(); | ||||
| Iterator<JsonElement> idIterator = idArray.iterator(); | |||||
| while (idIterator.hasNext()) { | |||||
| JsonElement id = idIterator.next(); | |||||
| for (JsonElement id : idArray) { | |||||
| idList.add(id.getAsString()); | idList.add(id.getAsString()); | ||||
| } | } | ||||
| return idList; | return idList; | ||||
| @@ -124,8 +121,7 @@ public class WxMaCloudServiceImpl implements WxMaCloudService { | |||||
| if (jsonObject.get(WxMaConstants.ERRCODE).getAsInt() != 0) { | if (jsonObject.get(WxMaConstants.ERRCODE).getAsInt() != 0) { | ||||
| throw new WxErrorException(WxError.fromJson(responseContent)); | throw new WxErrorException(WxError.fromJson(responseContent)); | ||||
| } | } | ||||
| Integer deletedNum = jsonObject.get("deleted").getAsInt(); | |||||
| return deletedNum; | |||||
| return jsonObject.get("deleted").getAsInt(); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -174,10 +170,11 @@ public class WxMaCloudServiceImpl implements WxMaCloudService { | |||||
| } | } | ||||
| StringBuilder orderBySb = new StringBuilder(); | StringBuilder orderBySb = new StringBuilder(); | ||||
| if (null != orderBy && !orderBy.isEmpty()) { | if (null != orderBy && !orderBy.isEmpty()) { | ||||
| orderBy.entrySet().forEach( | |||||
| e -> orderBySb.append(".orderBy('").append(e.getKey()).append("', '").append(e.getValue()).append("')") | |||||
| ); | |||||
| for (Map.Entry<String, String> entry : orderBy.entrySet()) { | |||||
| orderBySb.append(".orderBy('").append(entry.getKey()).append("', '").append(entry.getValue()).append("')"); | |||||
| } | |||||
| } | } | ||||
| if (null == limit) { | if (null == limit) { | ||||
| limit = 100; | limit = 100; | ||||
| } | } | ||||