public class WxMaCloudServiceImpl extends Object implements WxMaCloudService
BATCH_DELETE_FILE_URL, BATCH_DOWNLOAD_FILE_URL, DATABASE_ADD_URL, DATABASE_AGGREGATE_URL, DATABASE_COLLECTION_ADD_URL, DATABASE_COLLECTION_DELETE_URL, DATABASE_COLLECTION_GET_URL, DATABASE_COUNT_URL, DATABASE_DELETE_URL, DATABASE_MIGRATE_EXPORT_URL, DATABASE_MIGRATE_IMPORT_URL, DATABASE_MIGRATE_QUERY_INFO_URL, DATABASE_QUERY_URL, DATABASE_UPDATE_URL, GET_QCLOUD_TOKEN_URL, INVOKE_CLOUD_FUNCTION_URL, UPDATE_INDEX_URL, UPLOAD_FILE_URL| 构造器和说明 | 
|---|
WxMaCloudServiceImpl()  | 
| 限定符和类型 | 方法和说明 | 
|---|---|
List<String> | 
add(String collection,
   List list)  | 
String | 
add(String collection,
   Object obj)  | 
WxCloudBatchDeleteFileResult | 
batchDeleteFile(String[] fileIds)  | 
WxCloudBatchDeleteFileResult | 
batchDeleteFile(String env,
               String[] fileIds)
 删除文件
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/storage/batchDeleteFile.html
 请求地址:POST https://api.weixin.qq.com/tcb/batchdeletefile? 
 | 
WxCloudBatchDownloadFileResult | 
batchDownloadFile(String[] fileIds,
                 long[] maxAges)  | 
WxCloudBatchDownloadFileResult | 
batchDownloadFile(String env,
                 String[] fileIds,
                 long[] maxAges)
 获取文件下载链接
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/storage/batchDownloadFile.html
 请求地址:POST https://api.weixin.qq.com/tcb/batchdownloadfile? 
 | 
Long | 
count(String collection,
     String whereJson)  | 
com.google.gson.JsonArray | 
databaseAdd(String query)  | 
com.google.gson.JsonArray | 
databaseAdd(String env,
           String query)
 数据库插入记录
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseAdd.html
 请求地址:POST https://api.weixin.qq.com/tcb/databaseadd? 
 | 
com.google.gson.JsonArray | 
databaseAggregate(String query)  | 
com.google.gson.JsonArray | 
databaseAggregate(String env,
                 String query)
 数据库聚合记录
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseAggregate.html
 请求地址:POST https://api.weixin.qq.com/tcb/databaseaggregate? 
 | 
void | 
databaseCollectionAdd(String collectionName)  | 
void | 
databaseCollectionAdd(String env,
                     String collectionName)
 新增集合
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseCollectionAdd
 .html
 请求地址:POST https://api.weixin.qq.com/tcb/databasecollectionadd? 
 | 
void | 
databaseCollectionDelete(String collectionName)  | 
void | 
databaseCollectionDelete(String env,
                        String collectionName)
 删除集合
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database
 /databaseCollectionDelete.html
 请求地址:POST https://api.weixin.qq.com/tcb/databasecollectionadd? 
 | 
WxCloudDatabaseCollectionGetResult | 
databaseCollectionGet(Long limit,
                     Long offset)  | 
WxCloudDatabaseCollectionGetResult | 
databaseCollectionGet(String env,
                     Long limit,
                     Long offset)
 获取特定云环境下集合信息
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseCollectionGet
 .html
 请求地址:POST https://api.weixin.qq.com/tcb/databasecollectionget? 
 | 
Long | 
databaseCount(String query)  | 
Long | 
databaseCount(String env,
             String query)
 统计集合记录数或统计查询语句对应的结果记录数
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseCount.html
 请求地址:POST https://api.weixin.qq.com/tcb/databasecount? 
 | 
int | 
databaseDelete(String query)  | 
int | 
databaseDelete(String env,
              String query)
 数据库删除记录
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseDelete.html
 请求地址:POST https://api.weixin.qq.com/tcb/databasedelete? 
 | 
Long | 
databaseMigrateExport(String filePath,
                     int fileType,
                     String query)  | 
Long | 
databaseMigrateExport(String env,
                     String filePath,
                     int fileType,
                     String query)
 数据库导出
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseMigrateExport
 .html
 请求地址: POST https://api.weixin.qq.com/tcb/databasemigrateexport? 
 | 
Long | 
databaseMigrateImport(String collectionName,
                     String filePath,
                     int fileType,
                     boolean stopOnError,
                     int conflictMode)  | 
Long | 
databaseMigrateImport(String env,
                     String collectionName,
                     String filePath,
                     int fileType,
                     boolean stopOnError,
                     int conflictMode)
 数据库导入
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseMigrateImport
 .html
 请求地址: POST https://api.weixin.qq.com/tcb/databasemigrateimport? 
 | 
WxCloudCloudDatabaseMigrateQueryInfoResult | 
databaseMigrateQueryInfo(Long jobId)  | 
WxCloudCloudDatabaseMigrateQueryInfoResult | 
databaseMigrateQueryInfo(String env,
                        Long jobId)
   数据库迁移状态查询
  文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database
  /databaseMigrateQueryInfo.html
  请求地址:POST https://api.weixin.qq.com/tcb/databasemigratequeryinfo? 
 | 
WxCloudDatabaseQueryResult | 
databaseQuery(String query)  | 
WxCloudDatabaseQueryResult | 
databaseQuery(String env,
             String query)
 数据库查询记录
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseQuery.html
 请求地址:POST https://api.weixin.qq.com/tcb/databasequery? 
 | 
WxCloudDatabaseUpdateResult | 
databaseUpdate(String query)  | 
WxCloudDatabaseUpdateResult | 
databaseUpdate(String env,
              String query)
 数据库更新记录
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseUpdate.html
 请求地址:POST https://api.weixin.qq.com/tcb/databaseupdate? 
 | 
Integer | 
delete(String collection,
      String whereJson)  | 
WxCloudGetQcloudTokenResult | 
getQcloudToken(long lifeSpan)
  获取腾讯云API调用凭证
  文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/utils/getQcloudToken.html
  请求地址:POST https://api.weixin.qq.com/tcb/getqcloudtoken? 
 | 
String | 
invokeCloudFunction(String name,
                   String body)  | 
String | 
invokeCloudFunction(String env,
                   String name,
                   String body)
 触发云函数。 
 | 
WxCloudDatabaseQueryResult | 
query(String collection,
     String whereJson,
     Map<String,String> orderBy,
     Integer skip,
     Integer limit)
db.collection('geo')
   .where({
     price: _.gt(10)
   })
   .orderBy('_id', 'asc')
   .orderBy('price', 'desc')
   .skip(1)
   .limit(10)
   .get() 
 | 
WxCloudDatabaseUpdateResult | 
update(String collection,
      String whereJson,
      String updateJson)  | 
void | 
updateIndex(String collectionName,
           List<WxCloudDatabaseCreateIndexRequest> createIndexes,
           List<String> dropIndexNames)  | 
void | 
updateIndex(String env,
           String collectionName,
           List<WxCloudDatabaseCreateIndexRequest> createIndexes,
           List<String> dropIndexNames)
 变更数据库索引
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/updateIndex.html
 请求地址:POST https://api.weixin.qq.com/tcb/updateindex? 
 | 
WxCloudUploadFileResult | 
uploadFile(String path)  | 
WxCloudUploadFileResult | 
uploadFile(String env,
          String path)
 获取文件上传链接
 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/storage/uploadFile.html
 请求地址:POST https://api.weixin.qq.com/tcb/uploadfile? 
 | 
public String invokeCloudFunction(String name, String body) throws WxErrorException
invokeCloudFunction 在接口中 WxMaCloudServiceWxErrorExceptionpublic String invokeCloudFunction(String env, String name, String body) throws WxErrorException
WxMaCloudService触发云函数。注意:HTTP API 途径触发云函数不包含用户信息。 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/functions/invokeCloudFunction.html 请求地址 POST https://api.weixin.qq.com/tcb/invokecloudfunction?access_token=ACCESS_TOKEN&env=ENV&name=FUNCTION_NAME
invokeCloudFunction 在接口中 WxMaCloudServiceenv - string          是       云开发环境IDname - string          是       云函数名称body - string          是       云函数的传入参数,具体结构由开发者定义。WxErrorException - .public List<String> add(String collection, List list) throws WxErrorException
add 在接口中 WxMaCloudServiceWxErrorExceptionpublic String add(String collection, Object obj) throws WxErrorException
add 在接口中 WxMaCloudServiceWxErrorExceptionpublic com.google.gson.JsonArray databaseAdd(String query) throws WxErrorException
databaseAdd 在接口中 WxMaCloudServiceWxErrorExceptionpublic com.google.gson.JsonArray databaseAdd(String env, String query) throws WxErrorException
WxMaCloudService数据库插入记录 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseAdd.html 请求地址:POST https://api.weixin.qq.com/tcb/databaseadd?access_token=ACCESS_TOKEN
databaseAdd 在接口中 WxMaCloudServiceenv - 云环境IDquery - 数据库操作语句WxErrorException - .public Integer delete(String collection, String whereJson) throws WxErrorException
delete 在接口中 WxMaCloudServiceWxErrorExceptionpublic int databaseDelete(String query) throws WxErrorException
databaseDelete 在接口中 WxMaCloudServiceWxErrorExceptionpublic int databaseDelete(String env, String query) throws WxErrorException
WxMaCloudService数据库删除记录 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseDelete.html 请求地址:POST https://api.weixin.qq.com/tcb/databasedelete?access_token=ACCESS_TOKEN
databaseDelete 在接口中 WxMaCloudServiceenv - 云环境IDquery - 数据库操作语句WxErrorException - .public WxCloudDatabaseUpdateResult update(String collection, String whereJson, String updateJson) throws WxErrorException
update 在接口中 WxMaCloudServiceWxErrorExceptionpublic WxCloudDatabaseUpdateResult databaseUpdate(String query) throws WxErrorException
databaseUpdate 在接口中 WxMaCloudServiceWxErrorExceptionpublic WxCloudDatabaseUpdateResult databaseUpdate(String env, String query) throws WxErrorException
WxMaCloudService数据库更新记录 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseUpdate.html 请求地址:POST https://api.weixin.qq.com/tcb/databaseupdate?access_token=ACCESS_TOKEN
databaseUpdate 在接口中 WxMaCloudServiceenv - 云环境IDquery - 数据库操作语句WxErrorException - .public WxCloudDatabaseQueryResult query(String collection, String whereJson, Map<String,String> orderBy, Integer skip, Integer limit) throws WxErrorException
WxMaCloudServicequery 在接口中 WxMaCloudServiceWxErrorExceptionpublic WxCloudDatabaseQueryResult databaseQuery(String query) throws WxErrorException
databaseQuery 在接口中 WxMaCloudServiceWxErrorExceptionpublic WxCloudDatabaseQueryResult databaseQuery(String env, String query) throws WxErrorException
WxMaCloudService数据库查询记录 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseQuery.html 请求地址:POST https://api.weixin.qq.com/tcb/databasequery?access_token=ACCESS_TOKEN
databaseQuery 在接口中 WxMaCloudServiceenv - 云环境IDquery - 数据库操作语句WxErrorException - .public com.google.gson.JsonArray databaseAggregate(String query) throws WxErrorException
databaseAggregate 在接口中 WxMaCloudServiceWxErrorExceptionpublic com.google.gson.JsonArray databaseAggregate(String env, String query) throws WxErrorException
WxMaCloudService数据库聚合记录 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseAggregate.html 请求地址:POST https://api.weixin.qq.com/tcb/databaseaggregate?access_token=ACCESS_TOKEN
databaseAggregate 在接口中 WxMaCloudServiceenv - 云环境IDquery - 数据库操作语句WxErrorException - .public Long count(String collection, String whereJson) throws WxErrorException
count 在接口中 WxMaCloudServiceWxErrorExceptionpublic Long databaseCount(String query) throws WxErrorException
databaseCount 在接口中 WxMaCloudServiceWxErrorExceptionpublic Long databaseCount(String env, String query) throws WxErrorException
WxMaCloudService统计集合记录数或统计查询语句对应的结果记录数 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseCount.html 请求地址:POST https://api.weixin.qq.com/tcb/databasecount?access_token=ACCESS_TOKEN
databaseCount 在接口中 WxMaCloudServiceenv - 云环境IDquery - 数据库操作语句WxErrorException - .public void updateIndex(String collectionName, List<WxCloudDatabaseCreateIndexRequest> createIndexes, List<String> dropIndexNames) throws WxErrorException
updateIndex 在接口中 WxMaCloudServiceWxErrorExceptionpublic void updateIndex(String env, String collectionName, List<WxCloudDatabaseCreateIndexRequest> createIndexes, List<String> dropIndexNames) throws WxErrorException
WxMaCloudService变更数据库索引 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/updateIndex.html 请求地址:POST https://api.weixin.qq.com/tcb/updateindex?access_token=ACCESS_TOKEN
updateIndex 在接口中 WxMaCloudServiceenv - 云环境IDcollectionName - 集合名称createIndexes - 新增索引对象dropIndexNames - 要删除的索引的名字WxErrorException - .public Long databaseMigrateImport(String collectionName, String filePath, int fileType, boolean stopOnError, int conflictMode) throws WxErrorException
databaseMigrateImport 在接口中 WxMaCloudServiceWxErrorExceptionpublic Long databaseMigrateImport(String env, String collectionName, String filePath, int fileType, boolean stopOnError, int conflictMode) throws WxErrorException
WxMaCloudService数据库导入 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseMigrateImport .html 请求地址: POST https://api.weixin.qq.com/tcb/databasemigrateimport?access_token=ACCESS_TOKEN
databaseMigrateImport 在接口中 WxMaCloudServiceenv - 云环境IDcollectionName - 导入collection名filePath - 导入文件路径(导入文件需先上传到同环境的存储中,可使用开发者工具或 HTTP API的上传文件 API上传)fileType - 导入文件类型, 1       JSON, 2 CSVstopOnError - 是否在遇到错误时停止导入conflictMode - 冲突处理模式 : 1      INSERT  ,    2  UPSERTWxErrorException - .public Long databaseMigrateExport(String filePath, int fileType, String query) throws WxErrorException
databaseMigrateExport 在接口中 WxMaCloudServiceWxErrorExceptionpublic Long databaseMigrateExport(String env, String filePath, int fileType, String query) throws WxErrorException
WxMaCloudService数据库导出 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseMigrateExport .html 请求地址: POST https://api.weixin.qq.com/tcb/databasemigrateexport?access_token=ACCESS_TOKEN
databaseMigrateExport 在接口中 WxMaCloudServiceenv - 云环境IDfilePath - 导出文件路径(文件会导出到同环境的云存储中,可使用获取下载链接 API 获取下载链接)fileType - 导出文件类型, 1       JSON, 2 CSVquery - 导出条件WxErrorException - .public WxCloudCloudDatabaseMigrateQueryInfoResult databaseMigrateQueryInfo(Long jobId) throws WxErrorException
databaseMigrateQueryInfo 在接口中 WxMaCloudServiceWxErrorExceptionpublic WxCloudCloudDatabaseMigrateQueryInfoResult databaseMigrateQueryInfo(String env, Long jobId) throws WxErrorException
WxMaCloudService数据库迁移状态查询 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database /databaseMigrateQueryInfo.html 请求地址:POST https://api.weixin.qq.com/tcb/databasemigratequeryinfo?access_token=ACCESS_TOKEN
databaseMigrateQueryInfo 在接口中 WxMaCloudServiceenv - 云环境IDjobId - 迁移任务IDWxErrorException - .public WxCloudUploadFileResult uploadFile(String path) throws WxErrorException
uploadFile 在接口中 WxMaCloudServiceWxErrorExceptionpublic WxCloudUploadFileResult uploadFile(String env, String path) throws WxErrorException
WxMaCloudService获取文件上传链接 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/storage/uploadFile.html 请求地址:POST https://api.weixin.qq.com/tcb/uploadfile?access_token=ACCESS_TOKEN
uploadFile 在接口中 WxMaCloudServiceenv - 云环境IDpath - 上传路径WxErrorException - .public WxCloudBatchDownloadFileResult batchDownloadFile(String[] fileIds, long[] maxAges) throws WxErrorException
batchDownloadFile 在接口中 WxMaCloudServiceWxErrorExceptionpublic WxCloudBatchDownloadFileResult batchDownloadFile(String env, String[] fileIds, long[] maxAges) throws WxErrorException
WxMaCloudService获取文件下载链接 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/storage/batchDownloadFile.html 请求地址:POST https://api.weixin.qq.com/tcb/batchdownloadfile?access_token=ACCESS_TOKEN
batchDownloadFile 在接口中 WxMaCloudServiceenv - 云环境IDfileIds - 文件ID列表maxAges - 下载链接有效期列表,对应文件id列表WxErrorException - .public WxCloudBatchDeleteFileResult batchDeleteFile(String[] fileIds) throws WxErrorException
batchDeleteFile 在接口中 WxMaCloudServiceWxErrorExceptionpublic WxCloudBatchDeleteFileResult batchDeleteFile(String env, String[] fileIds) throws WxErrorException
WxMaCloudService删除文件 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/storage/batchDeleteFile.html 请求地址:POST https://api.weixin.qq.com/tcb/batchdeletefile?access_token=ACCESS_TOKEN
batchDeleteFile 在接口中 WxMaCloudServiceenv - 云环境IDfileIds - 文件ID列表WxErrorException - .public WxCloudGetQcloudTokenResult getQcloudToken(long lifeSpan) throws WxErrorException
WxMaCloudService获取腾讯云API调用凭证 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/utils/getQcloudToken.html 请求地址:POST https://api.weixin.qq.com/tcb/getqcloudtoken?access_token=ACCESS_TOKEN
getQcloudToken 在接口中 WxMaCloudServicelifeSpan - 有效期(单位为秒,最大7200)WxErrorException - .public void databaseCollectionAdd(String collectionName) throws WxErrorException
databaseCollectionAdd 在接口中 WxMaCloudServiceWxErrorExceptionpublic void databaseCollectionAdd(String env, String collectionName) throws WxErrorException
WxMaCloudService新增集合 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseCollectionAdd .html 请求地址:POST https://api.weixin.qq.com/tcb/databasecollectionadd?access_token=ACCESS_TOKEN
databaseCollectionAdd 在接口中 WxMaCloudServiceenv - 云环境IDcollectionName - 集合名称WxErrorException - .public void databaseCollectionDelete(String collectionName) throws WxErrorException
databaseCollectionDelete 在接口中 WxMaCloudServiceWxErrorExceptionpublic void databaseCollectionDelete(String env, String collectionName) throws WxErrorException
WxMaCloudService删除集合 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database /databaseCollectionDelete.html 请求地址:POST https://api.weixin.qq.com/tcb/databasecollectionadd?access_token=ACCESS_TOKEN
databaseCollectionDelete 在接口中 WxMaCloudServiceenv - 云环境IDcollectionName - 集合名称WxErrorException - .public WxCloudDatabaseCollectionGetResult databaseCollectionGet(Long limit, Long offset) throws WxErrorException
databaseCollectionGet 在接口中 WxMaCloudServiceWxErrorExceptionpublic WxCloudDatabaseCollectionGetResult databaseCollectionGet(String env, Long limit, Long offset) throws WxErrorException
WxMaCloudService获取特定云环境下集合信息 文档地址:https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-http-api/database/databaseCollectionGet .html 请求地址:POST https://api.weixin.qq.com/tcb/databasecollectionget?access_token=ACCESS_TOKEN
databaseCollectionGet 在接口中 WxMaCloudServiceenv - 云环境IDlimit - 获取数量限制,默认值:10offset - 偏移量,默认值:0WxErrorException - .Copyright © 2020. All rights reserved.