Skip to content

Commit 0b9a0bb

Browse files
committed
update weixin miniprogram openapi
0 parents  commit 0b9a0bb

15 files changed

+5886
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea
2+
.vscode
3+
.DS_Store
4+

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# wxmp
2+
3+
微信小程序接口,使用protobuf生成的。
4+
5+
生成工具是[protoc-gen-go_api](https://github.com/dev-openapi/protoc-gen-go_api)
6+
7+
8+
## 如何使用
9+
10+
在自己的项目中添加此包 github.com/dev-openapi/wx-miniprogram
11+
12+
初始化包 `wxLoginService := miniprogram.NewLoginService()`
13+
14+
然后根据自己的需要,用`wxLoginService`去调用想用的接口
15+
16+
## 如何添加新接口
17+
18+
首先要安装protoc,protoc-gen-go和protoc-gen-go_api。前面两个如何安装,请参考网上教程搜索
19+
20+
```shell
21+
go install github.com/dev-openapi/protoc-gen-go_api@latest
22+
```
23+
24+
下载[protocol](https://github.com/dev-openapi/protocol)仓库
25+
26+
下载本项目,与protocol是同一级目录
27+
28+
然后根据文档在protocol项目中写好proto文件,再执行make wx-miniprogram会自动生成到本项目目录,最后提交两个项目即可

go.mod

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module github.com/dev-openapi/wx-miniprogram
2+
3+
go 1.16
4+
5+
require (
6+
github.com/golang/protobuf v1.5.3
7+
google.golang.org/genproto/googleapis/api v0.0.0-20230710151506-e685fd7b542b
8+
)

go.sum

Lines changed: 1715 additions & 0 deletions
Large diffs are not rendered by default.

login.api.go

Lines changed: 89 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

login.pb.go

Lines changed: 185 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)