Skip to content

Commit 0397e44

Browse files
committed
Merge branch 'master' into develop
2 parents bb12cce + b84674f commit 0397e44

File tree

4 files changed

+85
-4
lines changed

4 files changed

+85
-4
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## WxJava - 微信开发 Java SDK(开发工具包) [![LICENSE](https://img.shields.io/badge/License-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE) [![Badge](https://img.shields.io/badge/Link-996.icu-red.svg)](https://996.icu/#/zh_CN) [![Badge](https://img.shields.io/badge/Link-京东内购福利-red.svg)](https://mp.weixin.qq.com/s/dfwatgMgARaBjh421Todyg)
1+
## WxJava - 微信开发 Java SDK(开发工具包) [![LICENSE](https://img.shields.io/badge/License-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE) [![Badge](https://img.shields.io/badge/Link-996.icu-red.svg)](https://996.icu/#/zh_CN) [![Badge](https://img.shields.io/badge/Link-专属福利-red.svg)](https://mp.weixin.qq.com/s/dfwatgMgARaBjh421Todyg)
22

33
[![码云Gitee](https://gitee.com/binary/weixin-java-tools/badge/star.svg?theme=blue)](https://gitee.com/binary/weixin-java-tools)
44
[![Github](http://github-svg-buttons.herokuapp.com/star.svg?user=Wechat-Group&repo=WxJava&style=flat&background=1081C1)](https://github.com/Wechat-Group/WxJava)
@@ -47,7 +47,7 @@
4747
1. 新手重要提示:本项目仅是一个SDK开发工具包,未提供Web实现,建议使用 `maven``gradle` 引用本项目即可使用本SDK提供的各种功能,详情可参考 **[【Demo项目】](demo.md)** 或本项目中的部分单元测试代码;另外微信开发新手请务必阅读[【开发文档 Wiki 首页】](https://github.com/Wechat-Group/WxJava/wiki)的常见问题部分,可以少走很多弯路,节省不少时间。
4848
1. 技术交流群:想获得QQ群/微信群/钉钉企业群等信息的同学,请使用微信扫描上面的微信公众号二维码关注 `WxJava` 后点击相关菜单即可获取加入方式,同时也可以在微信中搜索 `weixin-java-tools``WxJava` 后选择正确的公众号进行关注,该公众号会及时通知SDK相关更新信息,并不定期分享微信Java开发相关技术知识;
4949
1. 付费QQ群:(**注意:刚入群会有5分钟禁言,稍等片刻即可正常发言**[![加入QQ群](https://img.shields.io/badge/QQ群-343954419-blue.svg)](http://shang.qq.com/wpa/qunwpa?idkey=731dc3e7ea31ebe25376cc1a791445468612c63fd0e9e05399b088ec81fd9e15)[![加入QQ群](https://img.shields.io/badge/QQ群-343954419-blue.svg)](http://jq.qq.com/?_wv=1027&k=40lRskK),或者请自行搜索群号`343954419`进行添加;当然由于某种原因无法入群的,可关注公众号后获取其他群的加入方式;
50-
1. 钉钉企业群:[请点击链接申请加入](https://h5.dingtalk.com/inviteColleague/index.html#/invite/9ed100cc4a/E1DF918E32E398D191E7FE61FE0552A6) 或者 [用手机钉钉APP扫码](https://gitee.com/binary/weixin-java-tools/raw/master/images/qrcodes/ding.jpg) 申请加入
50+
1. 钉钉技术交流群: `30294972`
5151
1. 微信开发新手或者Java开发新手在群内提问或新开Issue提问前,请先阅读[【提问的智慧】](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md),并确保已查阅过 [【开发文档Wiki】](https://github.com/wechat-group/WxJava/wiki) ,避免浪费大家的宝贵时间;
5252
1. 寻求帮助时需贴代码或大长串异常信息的,请利用 http://paste.ubuntu.com
5353

@@ -111,6 +111,7 @@
111111
- 专注批量推送的小而美的工具:https://github.com/rememberber/WePush
112112
- yshop意象商城系统:https://gitee.com/guchengwuyue/yshopmall
113113
- wx-manage(微信公众号管理项目):https://github.com/niefy/wx-manage
114+
- 基于若依开发的微信公众号管理系统:https://gitee.com/joolun/JooLun-wx
114115

115116
#### 小程序:
116117
- (京东)友家铺子,友家铺子店长版,京粉精选

demo.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
21
## `Demo` 项目
2+
33
### 说明
44
1. 在码云和 `GitHub` 上均可访问,会尽量保持同步,请根据自己情况选用。
55
1. 一般来说,`Github`上的版本应该是最新的,但也有可能没及时同步,此种情况下请以 `Github` 上的版本为准,有问题也请在 `Github` 对应项目 `Issues` 页面提问)。
@@ -19,3 +19,4 @@
1919
- 使用 `Spring MVC` 实现的公众号 Demo:[GitHub](http://github.com/binarywang/weixin-java-mp-demo-springmvc)、[码云](https://gitee.com/binary/weixin-java-mp-demo) [![Build Status](https://travis-ci.org/binarywang/weixin-java-mp-demo-springmvc.svg?branch=master)](https://travis-ci.org/binarywang/weixin-java-mp-demo-springmvc)
2020
- 使用 `Spring Boot` 实现的公众号 Demo(支持多公众号):[GitHub](http://github.com/binarywang/weixin-java-mp-demo-springboot)、[码云](http://gitee.com/binary/weixin-java-mp-demo-springboot) [![Build Status](https://travis-ci.org/binarywang/weixin-java-mp-demo-springboot.svg?branch=master)](https://travis-ci.org/binarywang/weixin-java-mp-demo-springboot)
2121
- 含公众号和部分微信支付代码的 Demo:[GitHub](http://github.com/Wechat-Group/weixin-java-demo-springmvc)、[码云](http://gitee.com/binary/weixin-java-tools-springmvc) [![Build Status](https://travis-ci.org/Wechat-Group/weixin-java-demo-springmvc.svg?branch=master)](https://travis-ci.org/Wechat-Group/weixin-java-demo-springmvc)
22+

others/fenxiang.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

weixin-java-cloudbase/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
## 如何使用 `WxJava` 进行小程序云开发
2+
3+
[云开发(CloudBase)](https://www.cloudbase.net/)是基于Serverless架构构建的一站式后端云服务,涵盖函数、数据库、存储、CDN等服务,免后端运维,支持小程序、Web和APP开发。
4+
其中,小程序·云开发是微信和腾讯云联合推出的云端一体化解决方案,基于云开发可以免鉴权调用微信所有开放能力,在微信开发者工具中即可开通使用。
5+
6+
### 一、 引入`maven`依赖
7+
8+
9+
```
10+
<dependency>
11+
<groupId>com.github.binarywang</groupId>
12+
<artifactId>weixin-java-miniapp</artifactId>
13+
<version>3.7.1.B</version>
14+
</dependency>
15+
```
16+
17+
18+
### 二、 构造配置类,填入相关参数
19+
20+
```
21+
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
22+
config.setAppid(...); // 微信小程序的appid
23+
config.setSecret(...); // 微信小程序的Secret
24+
config.setToken(...); // 微信小程序消息服务器配置的token,如果程序不涉及相关功能,可以忽略
25+
config.setAesKey(...); // 微信小程序消息服务器配置的EncodingAESKey,同上,如果不涉及,可以忽略
26+
config.setMsgDataFormat(...); // 消息数据格式,可以为XML或者JSON
27+
```
28+
29+
30+
### 三、 构造service类,关联上述配置
31+
32+
```
33+
WxMaService wxMaService= new WxMaServiceImpl();
34+
35+
wxMaService.setWxMaConfig(config);
36+
```
37+
38+
### 四、 根据小程序前端需要调用相应的方法:
39+
40+
目前 `WxJava` 已支持当前所有接口(当然如果官方后续加入新接口,则还未在最新版本中实现,会考虑在之后版本中加入),所有已支持的接口列表可以参考在线`JavaDoc`http://binary.ac.cn/weixin-java-miniapp-javadoc/cn/binarywang/wx/miniapp/api/WxMaCloudService.html
41+
42+
43+
以触发云函数接口为例,可以采用如下方式调用 `invokeCloudFunction` 方法:
44+
45+
46+
```
47+
String result = wxMaService.getCloudService().invokeCloudFunction("rcn", "login", "{}"); // 拿到result之后,可以在后续加入自己的处理逻辑代码
48+
```
49+
50+
51+
更多方法调用实例可以参考 `WxJava` 源码中的单元测试类:`cn.binarywang.wx.miniapp.api.impl.WxMaCloudServiceImplTest`
52+
53+
54+
另外,顺便在此列出当前已支持云开发的方法如下:
55+
56+
| 接口描述 | 方法名 |
57+
| ---- | ---- |
58+
| 删除文件 | batchDeleteFile(String env, String[] fileIds)|
59+
| 获取文件下载链接 | batchDownloadFile(String env, String[] fileIds, long[] maxAges)|
60+
| 数据库插入记录 | databaseAdd(String env, String query)|
61+
| 数据库聚合记录 | databaseAggregate(String env, String query)|
62+
| 新增集合 | databaseCollectionAdd(String env, String collectionName)|
63+
| 删除集合 | databaseCollectionDelete(String env, String collectionName)|
64+
| 获取特定云环境下集合信息 | databaseCollectionGet(String env, Long limit, Long offset)|
65+
| 统计集合记录数或统计查询语句对应的结果记录数 | databaseCount(String env, String query)|
66+
| 数据库删除记录 | databaseDelete(String env, String query)|
67+
| 数据库导出 | databaseMigrateExport(String env, String filePath, int fileType, String query)|
68+
| 数据库导入 | databaseMigrateImport(String env, String collectionName, String filePath, int fileType, boolean stopOnError, int conflictMode)|
69+
| 数据库迁移状态查询 | databaseMigrateQueryInfo(String env, Long jobId)|
70+
| 数据库查询记录 | databaseQuery(String env, String query)|
71+
| 数据库更新记录 | databaseUpdate(String env, String query)|
72+
| 获取腾讯云API调用凭证 | getQcloudToken(long lifeSpan)|
73+
| 触发云函数 | invokeCloudFunction(String env, String name, String body)|
74+
| 变更数据库索引 | updateIndex(String env, String collectionName, List<WxCloudDatabaseCreateIndexRequest> createIndexes, List<String> dropIndexNames)|
75+
| 获取文件上传链接 | uploadFile(String env, String path)|
76+
77+
### 五、 `Spring` 框架整合:
78+
79+
可以参考https://github.com/binarywang/weixin-java-miniapp-demo 此项目整合 `Spring` 开发。
80+
此项目基于 `Spring Boot` ,如果需要支持`Spring MVC`项目,适当改造即可。

0 commit comments

Comments
 (0)