Compare commits
190 Commits
Author | SHA1 | Date | |
---|---|---|---|
b4c3fef78c | |||
019379f729 | |||
1a52833467 | |||
77bea77f4e | |||
4f5f90298d | |||
003cdd18f4 | |||
f863a25498 | |||
66ccf11560 | |||
5603ae28db | |||
d0dd1b82d7 | |||
9446b1a636 | |||
e92e97ca11 | |||
bce4e5a324 | |||
03c5092164 | |||
9124457533 | |||
d217b67cf6 | |||
3e617b3a4c | |||
bb3b148de4 | |||
927361987f | |||
68bc4e84b4 | |||
44208b4fab | |||
57079fecfd | |||
f16561c82a | |||
fba63df660 | |||
5c1aef79c8 | |||
aa235ae02f | |||
53bed19f45 | |||
75003069f9 | |||
670766282a | |||
706a42f7b2 | |||
3bdd0a99fa | |||
34d1d5db58 | |||
c881e857ae | |||
f676c1239d | |||
4fa242751e | |||
45010d1575 | |||
21a71adba8 | |||
1822d39c12 | |||
e69e7edd02 | |||
faeb62abd8 | |||
84acfa03f7 | |||
5dd10f3adc | |||
51185a972c | |||
9ba61c9f9b | |||
29cccd94b2 | |||
b8d15f0124 | |||
d629d61250 | |||
704a41b1e2 | |||
0a21e62667 | |||
e4f18688e1 | |||
fd98fad567 | |||
6a20373254 | |||
c6a20f1a72 | |||
3655e95a67 | |||
09684077ea | |||
843193024c | |||
5d906b1fba | |||
2081e708a8 | |||
6a8bde04be | |||
c59e8740d6 | |||
2836428f68 | |||
54d4e054e6 | |||
b5c654d3fc | |||
ddf6d80599 | |||
5c23311d69 | |||
f0c1ea178b | |||
89cf809f5f | |||
7e20e4a59a | |||
081e0b7e6e | |||
e1cf8088be | |||
73c2a89f70 | |||
79b5a11a9e | |||
ad67ed3441 | |||
6ba6e1829f | |||
677e796990 | |||
05b85efc0f | |||
c8cc611085 | |||
8edbe341ed | |||
4812dc26dc | |||
38faf619a9 | |||
a8fe23030f | |||
|
112f7c100e | ||
|
abae2cfce9 | ||
|
6ccbf900db | ||
|
64e29af498 | ||
|
521ea08ba9 | ||
|
1557894954 | ||
|
e425817e69 | ||
|
0d1320a48f | ||
|
87c33ac776 | ||
|
90556820ba | ||
|
b7ceeed557 | ||
|
baa8a6da37 | ||
|
901fceba27 | ||
|
e0a39c8d68 | ||
|
749f326f94 | ||
|
90d8098d93 | ||
|
b35645ee67 | ||
|
a3a8295262 | ||
|
8088c4ada8 | ||
|
c443dc1fd1 | ||
|
c0a7376e22 | ||
|
5776914faa | ||
|
d2571d094b | ||
|
d3552245a5 | ||
|
57859d8d80 | ||
|
6205568948 | ||
|
327e6ffa05 | ||
|
d68956df72 | ||
|
c7ade5b2d5 | ||
|
07c4615d7e | ||
|
99a55e6bc9 | ||
|
3ced24eb9e | ||
|
431e83bf4f | ||
|
3f6e5d8d51 | ||
|
c702f787f7 | ||
|
0721b01cdb | ||
|
e636362585 | ||
|
ace4f9a278 | ||
|
60fdf91ce7 | ||
|
d94b42b6ee | ||
|
1e13645f72 | ||
|
43a460a28b | ||
|
c109e81842 | ||
|
c26b055ccf | ||
|
4888d1576b | ||
|
48a86940e2 | ||
|
199c109a3d | ||
|
9522585074 | ||
|
ae08833323 | ||
|
bf9c0571f8 | ||
|
30264bfaae | ||
|
edb098500d | ||
|
46921e0e55 | ||
|
df759717cd | ||
|
31d446a6bd | ||
|
48a22a0e60 | ||
|
512975fb86 | ||
|
62490c77b6 | ||
|
2eb6180567 | ||
|
4118e8bba6 | ||
|
10414d9971 | ||
|
c1e7d095ed | ||
|
6b21f1a234 | ||
|
69cf2bcb90 | ||
|
a8a5359c9f | ||
|
9b78acd0e5 | ||
|
b08530917c | ||
|
791ec8d2db | ||
|
b6ad48dff7 | ||
|
809ff15709 | ||
|
bb65189fb8 | ||
|
8a161cfa2c | ||
|
4ca4dec37e | ||
|
d759317396 | ||
|
3bd517a007 | ||
|
7219c2dbd0 | ||
|
26e2cbcb60 | ||
|
320bbfe7be | ||
|
65134bd1ca | ||
|
81cb16bf9f | ||
|
aa19a2874d | ||
|
3477e41ad2 | ||
|
7f7c0a3765 | ||
|
b8d0baae5b | ||
|
286596f8a2 | ||
|
310e1d91be | ||
|
3918005b1f | ||
|
a435ee5a01 | ||
|
7a200c0574 | ||
|
80cc0e4939 | ||
|
81bb1f3563 | ||
|
57ff6a80ec | ||
|
d19fec73d4 | ||
|
db5826cfcf | ||
|
dc8b5454e2 | ||
|
30a0eb8e98 | ||
|
6e5800181b | ||
|
4d526dbd7a | ||
|
152e6a01fa | ||
|
d39062353c | ||
|
8c461bbaf2 | ||
|
3e09168019 | ||
|
3abaa2c1d1 | ||
|
1dfde62772 | ||
|
36602d58a5 | ||
|
f94e67056d | ||
|
066c77c752 | ||
|
c3f4943acd | ||
|
e9c351a083 |
@ -1,15 +0,0 @@
|
|||||||
# EditorConfig: http://editorconfig.org/
|
|
||||||
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
indent_style = space
|
|
||||||
indent_size = 2
|
|
||||||
end_of_line = lf
|
|
||||||
charset = utf-8
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
insert_final_newline = true
|
|
||||||
|
|
||||||
[*.md]
|
|
||||||
trim_trailing_whitespace = false
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
强烈建议大家到 `github` 相关页面提交问题,方便统一查询管理,具体页面地址:https://github.com/Wechat-Group/WxJava/issues
|
|
||||||
|
|
||||||
当然如果必须在这里提问,请务必按以下格式填写,谢谢配合~
|
|
||||||
|
|
||||||
# 提问前,请确保阅读过项目首页说明以及wiki开发文档相关内容,尤其是常见问题部分。完成内容后,请务必移除包括本句在内的无用内容,以免影响阅读,谢谢合作~
|
|
||||||
# 另外如果确认属于bug,而且已明确如何修复,请参考贡献指南直接提交PR,省的浪费时间在这里描述问题,非常感谢配合
|
|
||||||
|
|
||||||
### 简要描述
|
|
||||||
__简单概括描述下你所遇到的问题。__
|
|
||||||
|
|
||||||
### 模块版本情况
|
|
||||||
* `WxJava` 模块名:
|
|
||||||
* `WxJava` 版本号:
|
|
||||||
|
|
||||||
### 详细描述
|
|
||||||
__尽量详细描述。请不要使用截图,尽量使用文字描述,代码直接贴上来,日志则请附在后面所示区域。__
|
|
||||||
|
|
||||||
### 日志
|
|
||||||
__将日志放在 [`Pastebin`](https://paste.ubuntu.com/) 或者其他地方,并将其url地址贴在这里__
|
|
4
.github/FUNDING.yml
vendored
4
.github/FUNDING.yml
vendored
@ -1,4 +0,0 @@
|
|||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
github: [binarywang]
|
|
||||||
custom: https://github.com/Wechat-Group/WxJava/blob/master/images/qrcodes/wepay.jpg?raw=true
|
|
28
.github/ISSUE_TEMPLATE/bug_report.md
vendored
28
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,28 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug报告
|
|
||||||
about: 本项目仅对最新版本进行维护,使用老版本出现问题的盆友,请先升级到最新版本,升级完后如果发现bug依然存在,请继续填写此issue。
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# 提问前,请确保阅读过项目首页说明以及wiki开发文档相关内容,尤其是常见问题部分。完成内容后,请务必移除包括本句在内的无用内容,以免影响阅读,否则直接关闭,谢谢合作~
|
|
||||||
|
|
||||||
## 另外如果确认属于bug,而且已明确如何修复,请参考贡献指南直接提交PR,省的浪费时间在这里描述问题,非常感谢配合
|
|
||||||
|
|
||||||
### 简要描述
|
|
||||||
__请简单概括描述下你所遇到的问题。__
|
|
||||||
|
|
||||||
### 模块版本情况
|
|
||||||
* WxJava 模块名:
|
|
||||||
* WxJava 版本号:(旧版本不予支持,谢谢配合)
|
|
||||||
|
|
||||||
### 详细描述
|
|
||||||
__尽量详细描述。请不要使用截图,尽量使用文字描述,代码直接贴上来,日志则请附在后面所示区域。__
|
|
||||||
|
|
||||||
### 日志
|
|
||||||
__如果日志不多,直接使用md代码引用格式贴在此处,否则如果太长,请将日志放在 [pastebin](https://paste.ubuntu.com/) 或者其他地方,然后将其url地址贴在这里__
|
|
||||||
```
|
|
||||||
日志请写于此处
|
|
||||||
```
|
|
16
.github/ISSUE_TEMPLATE/feature_request.md
vendored
16
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,16 +0,0 @@
|
|||||||
---
|
|
||||||
name: 请求添加新功能
|
|
||||||
about: 如果有什么新功能需要添加,请告诉我们
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# 提问前,请确保阅读过项目首页说明以及wiki开发文档相关内容,完成内容后,请务必移除包括本句在内的无用内容,以免影响他人阅读,否则直接关闭,谢谢合作~
|
|
||||||
|
|
||||||
### 简要描述
|
|
||||||
|
|
||||||
|
|
||||||
### 官方文档地址
|
|
||||||
__请提供所需功能对应的微信官方文档地址以便进行确认。__
|
|
17
.github/stale.yml
vendored
17
.github/stale.yml
vendored
@ -1,17 +0,0 @@
|
|||||||
# Number of days of inactivity before an issue becomes stale
|
|
||||||
daysUntilStale: 60
|
|
||||||
# Number of days of inactivity before a stale issue is closed
|
|
||||||
daysUntilClose: 7
|
|
||||||
# Issues with these labels will never be considered stale
|
|
||||||
exemptLabels:
|
|
||||||
- pinned
|
|
||||||
- security
|
|
||||||
# Label to use when marking an issue as stale
|
|
||||||
staleLabel: stale
|
|
||||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
|
||||||
markComment: >
|
|
||||||
This issue has been automatically marked as stale because it has not had
|
|
||||||
recent activity. It will be closed if no further activity occurs. Thank you
|
|
||||||
for your contributions.
|
|
||||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
|
||||||
closeComment: false
|
|
271
.gitignore
vendored
271
.gitignore
vendored
@ -1,56 +1,235 @@
|
|||||||
.bash
|
### Gradle ###
|
||||||
.history
|
.gradle
|
||||||
|
build/
|
||||||
|
|
||||||
*.class
|
# Ignore Gradle GUI config
|
||||||
test-output
|
gradle-app.setting
|
||||||
|
|
||||||
# Package Files #
|
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
||||||
*.jar
|
!gradle-wrapper.jar
|
||||||
*.war
|
|
||||||
*.ear
|
|
||||||
|
|
||||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
# Cache of project
|
||||||
hs_err_pid*
|
.gradletasknamecache
|
||||||
|
|
||||||
target
|
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
|
||||||
bin
|
# gradle/wrapper/gradle-wrapper.properties
|
||||||
.project
|
|
||||||
.classpath
|
|
||||||
.settings
|
|
||||||
|
|
||||||
sw-pom.xml
|
### Gradle Patch ###
|
||||||
*.iml
|
|
||||||
test-config.xml
|
|
||||||
.idea
|
|
||||||
/.gradle/
|
|
||||||
/gradle/
|
|
||||||
*.bat
|
|
||||||
/gradlew
|
|
||||||
**/build/
|
**/build/
|
||||||
|
|
||||||
|
### Intellij ###
|
||||||
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
|
||||||
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
|
|
||||||
._*
|
# User-specific stuff
|
||||||
.DS_Store
|
.idea/**/workspace.xml
|
||||||
.AppleDouble
|
.idea/**/tasks.xml
|
||||||
.LSOverride
|
.idea/**/usage.statistics.xml
|
||||||
.DocumentRevisions-V100
|
.idea/**/dictionaries
|
||||||
.fseventsd
|
.idea/**/shelf
|
||||||
.Spotlight-V100
|
|
||||||
.TemporaryItems
|
|
||||||
.Trashes
|
|
||||||
.vscode
|
|
||||||
.VolumeIcon.icns
|
|
||||||
.AppleDB
|
|
||||||
.AppleDesktop
|
|
||||||
Network Trash Folder
|
|
||||||
Temporary Items
|
|
||||||
.apdisk
|
|
||||||
/.sonar/
|
|
||||||
sonar-project.properties
|
|
||||||
|
|
||||||
!/.mvn/wrapper/maven-wrapper.jar
|
# Generated files
|
||||||
*.versionsBackup
|
.idea/**/contentModel.xml
|
||||||
|
|
||||||
# STS
|
# Sensitive or high-churn files
|
||||||
.factorypath
|
.idea/**/dataSources/
|
||||||
*.zip
|
.idea/**/dataSources.ids
|
||||||
|
.idea/**/dataSources.local.xml
|
||||||
|
.idea/**/sqlDataSources.xml
|
||||||
|
.idea/**/dynamic.xml
|
||||||
|
.idea/**/uiDesigner.xml
|
||||||
|
.idea/**/dbnavigator.xml
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
.idea/**/gradle.xml
|
||||||
|
.idea/**/libraries
|
||||||
|
|
||||||
|
# Gradle and Maven with auto-import
|
||||||
|
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||||
|
# since they will be recreated, and may cause churn. Uncomment if using
|
||||||
|
# auto-import.
|
||||||
|
# .idea/modules.xml
|
||||||
|
# .idea/*.iml
|
||||||
|
# .idea/modules
|
||||||
|
# *.iml
|
||||||
|
# *.ipr
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
cmake-build-*/
|
||||||
|
|
||||||
|
# Mongo Explorer plugin
|
||||||
|
.idea/**/mongoSettings.xml
|
||||||
|
|
||||||
|
# File-based project format
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
out/
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Cursive Clojure plugin
|
||||||
|
.idea/replstate.xml
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
|
# Editor-based Rest Client
|
||||||
|
.idea/httpRequests
|
||||||
|
|
||||||
|
# Android studio 3.1+ serialized cache file
|
||||||
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
|
### Intellij Patch ###
|
||||||
|
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||||
|
|
||||||
|
# *.iml
|
||||||
|
# modules.xml
|
||||||
|
# .idea/misc.xml
|
||||||
|
# *.ipr
|
||||||
|
|
||||||
|
# Sonarlint plugin
|
||||||
|
.idea/sonarlint
|
||||||
|
|
||||||
|
|
||||||
|
### Intellij+iml ###
|
||||||
|
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
|
||||||
|
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||||
|
|
||||||
|
# User-specific stuff
|
||||||
|
.idea/**/workspace.xml
|
||||||
|
.idea/**/tasks.xml
|
||||||
|
.idea/**/usage.statistics.xml
|
||||||
|
.idea/**/dictionaries
|
||||||
|
.idea/**/shelf
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
.idea/**/contentModel.xml
|
||||||
|
|
||||||
|
# Sensitive or high-churn files
|
||||||
|
.idea/**/dataSources/
|
||||||
|
.idea/**/dataSources.ids
|
||||||
|
.idea/**/dataSources.local.xml
|
||||||
|
.idea/**/sqlDataSources.xml
|
||||||
|
.idea/**/dynamic.xml
|
||||||
|
.idea/**/uiDesigner.xml
|
||||||
|
.idea/**/dbnavigator.xml
|
||||||
|
|
||||||
|
# Gradle
|
||||||
|
.idea/**/gradle.xml
|
||||||
|
.idea/**/libraries
|
||||||
|
|
||||||
|
# Gradle and Maven with auto-import
|
||||||
|
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||||
|
# since they will be recreated, and may cause churn. Uncomment if using
|
||||||
|
# auto-import.
|
||||||
|
# .idea/modules.xml
|
||||||
|
# .idea/*.iml
|
||||||
|
# .idea/modules
|
||||||
|
# *.iml
|
||||||
|
# *.ipr
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
cmake-build-*/
|
||||||
|
|
||||||
|
# Mongo Explorer plugin
|
||||||
|
.idea/**/mongoSettings.xml
|
||||||
|
|
||||||
|
# File-based project format
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
out/
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Cursive Clojure plugin
|
||||||
|
.idea/replstate.xml
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
|
# Editor-based Rest Client
|
||||||
|
.idea/httpRequests
|
||||||
|
|
||||||
|
# Android studio 3.1+ serialized cache file
|
||||||
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
|
### Intellij+iml Patch ###
|
||||||
|
# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
|
||||||
|
|
||||||
|
*.iml
|
||||||
|
modules.xml
|
||||||
|
.idea/misc.xml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Maven ###
|
||||||
|
target/
|
||||||
|
pom.xml.tag
|
||||||
|
pom.xml.releaseBackup
|
||||||
|
pom.xml.versionsBackup
|
||||||
|
pom.xml.next
|
||||||
|
release.properties
|
||||||
|
dependency-reduced-pom.xml
|
||||||
|
buildNumber.properties
|
||||||
|
.mvn/timing.properties
|
||||||
|
.mvn/wrapper/maven-wrapper.jar
|
||||||
|
.flattened-pom.xml
|
||||||
|
|
||||||
|
# CMake
|
||||||
|
cmake-build-*/
|
||||||
|
|
||||||
|
# Mongo Explorer plugin
|
||||||
|
.idea/**/mongoSettings.xml
|
||||||
|
|
||||||
|
# File-based project format
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
out/
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Cursive Clojure plugin
|
||||||
|
.idea/replstate.xml
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
|
# Editor-based Rest Client
|
||||||
|
.idea/httpRequests
|
||||||
|
|
||||||
|
# Android studio 3.1+ serialized cache file
|
||||||
|
.idea/caches/build_file_checksums.ser
|
||||||
|
|
||||||
|
### Intellij Patch ###
|
||||||
|
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
|
||||||
|
|
||||||
|
# *.iml
|
||||||
|
# modules.xml
|
||||||
|
# .idea/misc.xml
|
||||||
|
# *.ipr
|
||||||
|
|
||||||
|
# Sonarlint plugin
|
||||||
|
.idea/sonarlint
|
||||||
|
16
.idea/checkstyle-idea.xml
generated
Normal file
16
.idea/checkstyle-idea.xml
generated
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CheckStyle-IDEA" serialisationVersion="2">
|
||||||
|
<checkstyleVersion>10.22.0</checkstyleVersion>
|
||||||
|
<scanScope>JavaOnly</scanScope>
|
||||||
|
<copyLibs>true</copyLibs>
|
||||||
|
<option name="thirdPartyClasspath" />
|
||||||
|
<option name="activeLocationIds" />
|
||||||
|
<option name="locations">
|
||||||
|
<list>
|
||||||
|
<ConfigurationLocation id="bundled-sun-checks" type="BUNDLED" scope="All" description="Sun Checks">(bundled)</ConfigurationLocation>
|
||||||
|
<ConfigurationLocation id="bundled-google-checks" type="BUNDLED" scope="All" description="Google Checks">(bundled)</ConfigurationLocation>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
18
.idea/compiler.xml
generated
Normal file
18
.idea/compiler.xml
generated
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile name="Maven default annotation processors profile" enabled="true">
|
||||||
|
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||||
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||||
|
<outputRelativeToContentRoot value="true" />
|
||||||
|
<module name="wechat-j-open" />
|
||||||
|
<module name="wechat-j-pay" />
|
||||||
|
<module name="wechat-j-work" />
|
||||||
|
<module name="wechat-j-common" />
|
||||||
|
<module name="wechat-j-mp" />
|
||||||
|
<module name="wechat-j-oa" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
19
.idea/encodings.xml
generated
Normal file
19
.idea/encodings.xml
generated
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="file://$PROJECT_DIR$/common/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/common/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/mp/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/mp/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/oa/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/oa/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/open/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/open/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/pay/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/pay/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/work/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/work/src/main/resources" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
30
.idea/jarRepositories.xml
generated
Normal file
30
.idea/jarRepositories.xml
generated
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="ossez-repo-releases" />
|
||||||
|
<option name="name" value="iSharkFly Private Releases" />
|
||||||
|
<option name="url" value="https://repo.isharkfly.com/repository/isharkfly-maven-releases/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Central Repository" />
|
||||||
|
<option name="url" value="https://repo.isharkfly.com/repository/maven/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="ossez-repo-snapshots" />
|
||||||
|
<option name="name" value="iSharkFly Private Snapshots" />
|
||||||
|
<option name="url" value="https://repo.isharkfly.com/repository/isharkfly-maven-snapshots/" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Maven Central repository" />
|
||||||
|
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="jboss.community" />
|
||||||
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
17
.travis.yml
17
.travis.yml
@ -1,17 +0,0 @@
|
|||||||
language: java
|
|
||||||
|
|
||||||
jdk:
|
|
||||||
- openjdk8
|
|
||||||
script: "mvn clean package -DskipTests=true -Dcheckstyle.skip=true"
|
|
||||||
|
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- develop
|
|
||||||
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- '$HOME/.m2/repository'
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
email:
|
|
||||||
- a@binarywang.com
|
|
@ -1,36 +0,0 @@
|
|||||||
# 代码贡献指南
|
|
||||||
1. 首先非常欢迎和感谢对本项目发起 `Pull Request` 的热心小伙伴们。
|
|
||||||
1. **特别提示:请务必在 `develop` 分支提交 `PR`,`release` 分支目前仅是正式版的代码,即发布正式版本后才会从 `develop` 分支进行合并。**
|
|
||||||
1. 本项目代码风格为使用2个空格代表一个Tab,因此在提交代码时请注意一下,否则很容易在IDE格式化代码后与原代码产生大量diff,这样会给其他人阅读代码带来极大的困扰。
|
|
||||||
1. 为了便于设置,本项目引入`editorconfig`支持,请使用Eclipse的同学在贡献代码前安装相关插件,而`IntelliJ IDEA`新版本自带支持,如果没有可自行安装插件。
|
|
||||||
1. **提交代码前,请检查代码是否已经格式化,并且保证新增加或者修改的方法都有完整的参数说明,而public方法必须拥有相应的单元测试并通过测试。**
|
|
||||||
1. 本项目可以采用两种方式接受代码贡献:
|
|
||||||
- 第一种就是基于[Git Flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支,详细步骤参考后文,推荐使用此种方式贡献代码。
|
|
||||||
- (***暂停此种方式,请使用第一种***)另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题。
|
|
||||||
|
|
||||||
### PR方式贡献代码步骤
|
|
||||||
* 在 GitHub 上 `fork` 到自己的仓库,如 `my_user/WxJava`,然后 `clone` 到本地,并设置用户信息。
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ git clone git@github.com:{your-github-username}/WxJava.git
|
|
||||||
$ cd WxJava
|
|
||||||
$ git config user.name "yourname"
|
|
||||||
$ git config user.email "your email"
|
|
||||||
```
|
|
||||||
* 修改代码后提交,并推送到自己的仓库。
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ #do some change on the content
|
|
||||||
$ git commit -am "Fix issue #1: change something"
|
|
||||||
$ git push
|
|
||||||
```
|
|
||||||
* 在 `GitHub` 或 `Gitee` 网站上提交 `Pull Request`。
|
|
||||||
* 定期使用项目仓库内容更新自己仓库内容。
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ git remote add upstream https://github.com/Wechat-Group/WxJava
|
|
||||||
$ git fetch upstream
|
|
||||||
$ git checkout develop
|
|
||||||
$ git rebase upstream/develop
|
|
||||||
$ git push -f origin develop
|
|
||||||
```
|
|
66
LICENSE
66
LICENSE
@ -1,53 +1,21 @@
|
|||||||
Apache License
|
MIT License
|
||||||
|
|
||||||
Version 2.0, January 2004
|
Copyright (c) 2023 OSSEZ
|
||||||
|
|
||||||
http://www.apache.org/licenses/
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
1. Definitions.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
SOFTWARE.
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
||||||
|
|
||||||
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
||||||
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
||||||
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
||||||
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
290
README.md
290
README.md
@ -1,196 +1,150 @@
|
|||||||
## WxJava - 微信开发 Java SDK
|
# WeChat-J - 微信开发 Java SDK
|
||||||
|
|
||||||
[](https://gitee.com/binary/weixin-java-tools)
|
<p align="center">
|
||||||
[](https://github.com/Wechat-Group/WxJava)
|
<a href="https://github.com/honeymoose">
|
||||||
[](https://github.com/Wechat-Group/WxJava/releases)
|
<img height=85 src="https://avatars1.githubusercontent.com/u/45009982?s=200&v=4">
|
||||||
[](http://mvnrepository.com/artifact/com.github.binarywang/wx-java)
|
</a>
|
||||||
[](https://app.travis-ci.com/github/Wechat-Group/WxJava)
|
<br>This project builds by JDK 11 and OpenJ9 for JVM.
|
||||||
[](https://www.jetbrains.com/?from=WxJava-weixin-java-tools)
|
</p>
|
||||||
[](https://opensource.org/licenses/Apache-2.0)
|
|
||||||
|
|
||||||
#### 微信`Java`开发工具包,支持包括微信支付、开放平台、公众号、企业微信/企业号、小程序等微信功能模块的后端开发。
|
* [社区和讨论 (community)](https://www.ossez.com/tag/wechat)
|
||||||
|
|
||||||
<div align="center">
|
WeChat-J 开发使用的库。
|
||||||
<b>特别赞助</b>
|
|
||||||
</div>
|
|
||||||
<table align="center" cellspacing="0" cellpadding="0" width="500">
|
|
||||||
<tr>
|
|
||||||
<td align="center" valign="middle" colspan="3">
|
|
||||||
<a href="http://www.ccflow.org/?from=wxjava" target="_blank">
|
|
||||||
<img height="120" src="http://binary.ac.cn/images/banners/ccflow.png" alt="">
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="center" valign="middle" colspan="3">
|
|
||||||
<a href="https://www.jeequan.com/product/jeepay.html" target="_blank">
|
|
||||||
<img height="120" src="https://jeequan.oss-cn-beijing.aliyuncs.com/jeepay/img/wxjava_jeepay.png" alt="计全支付Jeepay,开源支付系统">
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td align="left" valign="middle">
|
|
||||||
<a href="http://mp.weixin.qq.com/mp/homepage?__biz=MzI3MzAwMzk4OA==&hid=1&sn=f31af3bf562b116b061c9ab4edf70b61&scene=18#wechat_redirect" target="_blank">
|
|
||||||
<img height="120" src="http://binary.ac.cn/images/qrcodes/mp.png" alt="">
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td valign="middle">
|
|
||||||
<a href="https://www.diboot.com/" target="_blank">
|
|
||||||
<img height="120" src="http://binary.ac.cn/images/banners/diboot.png" alt="diboot低代码开发平台"/>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td align="right" valign="middle">
|
|
||||||
<a href="https://promotion.aliyun.com/ntms/act/qwbk.html?userCode=7makzf5h" target="_blank">
|
|
||||||
<img height="120" src="http://binary.ac.cn/images/banners/aliyun.jpg" alt="">
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
### 重要信息
|
我们旨在提供一个初始化的开发框架,能够让应用在使用 Spring Boot 框架的基础上让你的微信公众号快速接入微信平台。
|
||||||
1. 项目合作洽谈请联系微信`binary0000`(在微信里自行搜索并添加好友,请注明来意,如有关于SDK问题需讨论请参考下文入群讨论,不要加此微信)。
|
|
||||||
2. **2022-4-10 发布 [【4.3.0正式版】](https://mp.weixin.qq.com/s/yCsa7nD4_DLjW1RDcrEk6g)**!
|
|
||||||
3. 贡献源码可以参考视频:[【贡献源码全过程(上集)】](https://mp.weixin.qq.com/s/3xUZSATWwHR_gZZm207h7Q)、[【贡献源码全过程(下集)】](https://mp.weixin.qq.com/s/nyzJwVVoYSJ4hSbwyvTx9A) ,友情提供:[程序员小山与Bug](https://space.bilibili.com/473631007)
|
|
||||||
4. 新手重要提示:本项目仅是一个SDK开发工具包,未提供Web实现,建议使用 `maven` 或 `gradle` 引用本项目即可使用本SDK提供的各种功能,详情可参考 **[【Demo项目】](demo.md)** 或本项目中的部分单元测试代码;
|
|
||||||
5. 微信开发新手请务必阅读【开发文档】([Gitee Wiki](https://gitee.com/binary/weixin-java-tools/wikis/Home) 或者 [Github Wiki](https://github.com/Wechat-Group/WxJava/wiki))的常见问题部分,可以少走很多弯路,节省不少时间。
|
|
||||||
6. 技术交流群:想获得QQ群/微信群/钉钉企业群等信息的同学,请使用微信扫描上面的微信公众号二维码关注 `WxJava` 后点击相关菜单即可获取加入方式,同时也可以在微信中搜索 `weixin-java-tools` 或 `WxJava` 后选择正确的公众号进行关注,该公众号会及时通知SDK相关更新信息,并不定期分享微信Java开发相关技术知识;
|
|
||||||
7. 钉钉技术交流群:`32206329`(技术交流2群), `30294972`(技术交流1群,目前已满),`35724728`(通知群,实时通知Github项目变更记录)。
|
|
||||||
8. 微信开发新手或者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) ,避免浪费大家的宝贵时间;
|
|
||||||
9. 寻求帮助时需贴代码或大长串异常信息的,请利用 http://paste.ubuntu.com
|
|
||||||
|
|
||||||
--------------------------------
|
# 项目说明
|
||||||
### 其他说明
|
|
||||||
1. **阅读源码的同学请注意,本SDK为简化代码编译时加入了`lombok`支持,如果不了解`lombok`的话,请先学习下相关知识,比如可以阅读[此文章](https://mp.weixin.qq.com/s/cUc-bUcprycADfNepnSwZQ);**
|
|
||||||
2. 如有新功能需求,发现BUG,或者由于微信官方接口调整导致的代码问题,可以直接在[【Issues】](https://github.com/Wechat-Group/WxJava/issues)页提出issue,便于讨论追踪问题;
|
|
||||||
3. 如果需要贡献代码,请务必在提交PR之前先仔细阅读[【代码贡献指南】](CONTRIBUTING.md),谢谢理解配合;
|
|
||||||
4. 目前本`SDK`最新版本要求的`JDK`最低版本是`8`,使用`7`的同学可以使用`WxJava` `3.8.0`及以前版本,而还在使用`JDK`6的用户请参考[【此项目】]( https://github.com/binarywang/weixin-java-tools-for-jdk6) ,而其他更早的JDK版本则需要自己改造实现。
|
|
||||||
5. [本项目在开源中国的页面](https://www.oschina.net/p/weixin-java-tools-new),欢迎大家积极留言评分 🙂
|
|
||||||
6. SDK开发文档请查阅 [【开发文档Wiki】](https://github.com/wechat-group/WxJava/wiki),部分文档可能未能及时更新,如有发现,可以及时上报或者自行修改。
|
|
||||||
7. **如果本开发工具包对您有所帮助,欢迎对我们的努力进行肯定,可以直接前往[【托管于码云的项目首页】](http://gitee.com/binary/weixin-java-tools),在页尾部分找到“捐助”按钮进行打赏,多多益善 😄。非常感谢各位打赏和捐助的同学!**
|
|
||||||
8. 各个模块的Javadoc可以在线查看:[weixin-java-miniapp](http://binary.ac.cn/weixin-java-miniapp-javadoc/)、[weixin-java-pay](http://binary.ac.cn/weixin-java-pay-javadoc/)、[weixin-java-mp](http://binary.ac.cn/weixin-java-mp-javadoc/)、[weixin-java-common](http://binary.ac.cn/weixin-java-common-javadoc/)、[weixin-java-cp](http://binary.ac.cn/weixin-java-cp-javadoc/)、[weixin-java-open](http://binary.ac.cn/weixin-java-open-javadoc/)
|
|
||||||
9. 本SDK项目在以下代码托管网站同步更新:
|
|
||||||
* 码云:https://gitee.com/binary/weixin-java-tools
|
|
||||||
* GitHub:https://github.com/wechat-group/WxJava
|
|
||||||
|
|
||||||
---------------------------------
|
我们在网上找了一些微信相关的 SDK,要不就是缺少维护,要不就是集成了非常多的功能,因我们的公众号希望能够尽量的自动化处理,所以我们在已有的基础上进行了一些修改和整合。
|
||||||
### Maven 引用方式
|
|
||||||
注意:最新版本(包括测试版)为 [](http://mvnrepository.com/artifact/com.github.binarywang/wx-java),以下为最新正式版。
|
## 必要的准备
|
||||||
|
|
||||||
|
因微信开发 Java SDK 的开发其实并不非常复杂,主要是通过 HTTP 发送请求并且将获得的返回数据进行一些处理返回对象就可以了。
|
||||||
|
|
||||||
|
我们需要调用微信的 HTTP 接口,所以我们需要在 Java 中使用一个 Http 客户端,在当前我们的环境中,我们只使用 OkHttp 来进行实现。
|
||||||
|
|
||||||
|
在老的项目中,可能不少人会使用 Apache 的 HttpClient 来进行实现,但因为 OkHttp 广泛的被使用在安卓的手机上,所以使用 OkHttp
|
||||||
|
会更加简便。
|
||||||
|
|
||||||
|
* [Retrofit 是什么](https://www.ossez.com/t/retrofit/14302)
|
||||||
|
* [RxJava 是什么](https://www.ossez.com/t/rxjava/14305)
|
||||||
|
* [微信测试平台获得测试账号](https://www.ossez.com/t/topic/14281)
|
||||||
|
|
||||||
|
### Maven 和依赖
|
||||||
|
|
||||||
|
当前我们还没有把正式版发布到仓库中,我们还在使用 0.0.1-SNAPSHOT 版本进行内部测试。
|
||||||
|
|
||||||
|
最好的版本就是下载我们的源代码后 Fork 到你本地,然后直接使用 Maven 来进行编译。
|
||||||
|
|
||||||
|
#### 微信公众号(WeChat Java Official Account)
|
||||||
|
|
||||||
|
模块名:wechat-j-oa
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.binarywang</groupId>
|
<groupId>com.ossez.wechat</groupId>
|
||||||
<artifactId>(不同模块参考下文)</artifactId>
|
<artifactId>wechat-j-oa</artifactId>
|
||||||
<version>4.3.0</version>
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
- 微信小程序:`weixin-java-miniapp`
|
#### 微信小程序(WeChat Java Mini Programs)
|
||||||
- 微信支付:`weixin-java-pay`
|
|
||||||
- 微信开放平台:`weixin-java-open`
|
|
||||||
- 公众号(包括订阅号和服务号):`weixin-java-mp`
|
|
||||||
- 企业号/企业微信:`weixin-java-cp`
|
|
||||||
|
|
||||||
|
模块名:wechat-j-mp
|
||||||
|
|
||||||
---------------------------------
|
```xml
|
||||||
### 版本说明
|
|
||||||
|
|
||||||
<details>
|
<dependency>
|
||||||
<summary>点此展开查看</summary>
|
<groupId>com.ossez.wechat</groupId>
|
||||||
|
<artifactId>wechat-j-mp</artifactId>
|
||||||
1. 本项目定为大约每两个月发布一次正式版(同时 `develop` 分支代码合并进入 `master` 分支),版本号格式为 `X.X.0`(如`2.1.0`,`2.2.0`等),遇到重大问题需修复会及时提交新版本,欢迎大家随时提交Pull Request;
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
2. BUG修复和新特性一般会先发布成小版本作为临时测试版本(如`3.6.8.B`,即尾号不为0,并添加B,以区别于正式版),代码仅存在于 `develop` 分支中;
|
</dependency>
|
||||||
3. 目前最新版本号为 [](http://mvnrepository.com/artifact/com.github.binarywang/wx-java) ,也可以通过访问链接 [【微信支付】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-pay%22) 、[【微信小程序】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-miniapp%22) 、[【公众号】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-mp%22) 、[【企业微信】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-cp%22)、[【开放平台】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-open%22)
|
```
|
||||||
分别查看所有最新的版本。
|
|
||||||
|
|
||||||
</details>
|
#### 微信支付(WeChat Java Pay)
|
||||||
|
|
||||||
----------------------------------
|
模块名:wechat-j-pay
|
||||||
### 应用案例
|
|
||||||
完整案例登记列表,请[【访问这里】](https://github.com/Wechat-Group/weixin-java-tools/issues/729)查看,欢迎登记更多的案例。
|
|
||||||
|
|
||||||
以下为节选的部分案例:
|
```xml
|
||||||
|
|
||||||
#### 开源项目:
|
<dependency>
|
||||||
- 基于微信公众号的签到、抽奖、发送弹幕程序:https://github.com/workcheng/weiya
|
<groupId>com.ossez.wechat</groupId>
|
||||||
- Jeepay 支付系统:https://gitee.com/jeequan/jeepay
|
<artifactId>wechat-j-pay</artifactId>
|
||||||
- 微同商城:https://gitee.com/fuyang_lipengjun/platform
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
- 微信点餐系统:https://github.com/sqmax/springboot-project
|
</dependency>
|
||||||
- 专注批量推送的小而美的工具:https://github.com/rememberber/WePush
|
```
|
||||||
- yshop意象商城系统:https://gitee.com/guchengwuyue/yshopmall
|
|
||||||
- wx-manage(微信公众号管理项目):https://github.com/niefy/wx-manage
|
|
||||||
- 基于若依开发的微信公众号管理系统:https://gitee.com/joolun/JooLun-wx
|
|
||||||
- SAAS微信小程序电商:https://gitee.com/wei-it/weiit-saas
|
|
||||||
- mall4j 电商商城系统:https://gitee.com/gz-yami/mall4j
|
|
||||||
|
|
||||||
#### 小程序:
|
#### 企业微信(WeChat Java WeCom)
|
||||||
- (京东)友家铺子,友家铺子店长版,京粉精选
|
|
||||||
- [喵星人贴吧助手(扫码关注)](http://p98ahz3tg.bkt.clouddn.com/miniappqrcode.jpg)
|
|
||||||
- 树懒揽书+
|
|
||||||
- 广廉快线,鹏城巴士等
|
|
||||||
- 当燃挑战、sportlight轻灵运动
|
|
||||||
- 360考试宝典
|
|
||||||
- 民医台
|
|
||||||
- 来一团商家版
|
|
||||||
- 史必达(史丹利)
|
|
||||||
- 嘀嗒云印
|
|
||||||
- 维沃吼吼
|
|
||||||
- 王朝社区(比亚迪新能源社区)
|
|
||||||
- 极吼吼手机上门回收换新
|
|
||||||
- 未来信封
|
|
||||||
- 5G惠享
|
|
||||||
- 生菜wordpress转小程序
|
|
||||||
- 丽日购
|
|
||||||
|
|
||||||
#### 公众号:
|
模块名:wechat-j-work
|
||||||
- 中国电信上海网厅(sh_189)
|
|
||||||
- E答平台
|
|
||||||
- 宁夏生鲜365
|
|
||||||
- 通服货滴
|
|
||||||
- 神龙养车
|
|
||||||
- 沃音乐商务智能
|
|
||||||
- 光环云社群
|
|
||||||
- 手机排队
|
|
||||||
- [全民约跑健身便利店](http://www.oneminsport.com/)
|
|
||||||
- 民医台
|
|
||||||
- YshopMall
|
|
||||||
- 好行景区直通车以及全国40多个公众号
|
|
||||||
- 我奥篮球公众号
|
|
||||||
- 未来信封官微
|
|
||||||
- 银川智云问诊
|
|
||||||
- 5G惠享
|
|
||||||
|
|
||||||
#### 企业微信:
|
```xml
|
||||||
- HTC企业微信
|
|
||||||
- 掌上史丹利
|
|
||||||
- 药店益
|
|
||||||
|
|
||||||
#### 其他:
|
<dependency>
|
||||||
- 高善人力资源
|
<groupId>com.ossez.wechat</groupId>
|
||||||
- 小猪餐餐
|
<artifactId>wechat-j-work</artifactId>
|
||||||
- 餐饮系统
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
- 微信公众号管理系统:http://demo.joolun.com
|
</dependency>
|
||||||
- 锐捷网络:Saleslink
|
```
|
||||||
|
|
||||||
----------------------------------
|
#### 微信开放平台(WeChat Java Open)
|
||||||
### 贡献者列表
|
|
||||||
特别感谢参与贡献的所有同学,所有贡献者列表请在[此处](https://github.com/Wechat-Group/WxJava/graphs/contributors)查看,欢迎大家继续踊跃贡献代码!
|
|
||||||
<details>
|
|
||||||
<summary>点击此处展开查看贡献次数最多的几位小伙伴</summary>
|
|
||||||
|
|
||||||
1. [chanjarster (Daniel Qian)](https://github.com/chanjarster)
|
模块名:wechat-j-open
|
||||||
1. [binarywang (Binary Wang)](https://github.com/binarywang)
|
|
||||||
1. [007gzs](https://github.com/007gzs)
|
|
||||||
1. [Silloy](https://github.com/silloy)
|
|
||||||
1. [mgcnrx11](https://github.com/mgcnrx11)
|
|
||||||
1. [0katekate0 (Wang_Wong)](https://github.com/0katekate0)
|
|
||||||
1. [yuanqixun](https://github.com/yuanqixun)
|
|
||||||
1. [kakotor](https://github.com/kakotor)
|
|
||||||
1. [aimilin6688 (Jonk)](https://github.com/aimilin6688)
|
|
||||||
1. [lkqm (Mario Luo)](https://github.com/lkqm)
|
|
||||||
1. [kareanyi (MillerLin)](https://github.com/kareanyi)
|
|
||||||
|
|
||||||
</details>
|
```xml
|
||||||
|
|
||||||
### GitHub Stargazers over time
|
<dependency>
|
||||||
|
<groupId>com.ossez.wechat</groupId>
|
||||||
|
<artifactId>wechat-j-open</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
```
|
||||||
|
|
||||||
[](https://starchart.cc/Wechat-Group/WxJava)
|
### 其他内容
|
||||||
|
|
||||||
|
* 任何有关讨论,请访问 [社区](https://www.ossez.com/tag/wechat),您可以在这里提出功能需求,Bug 修复,问题解答。
|
||||||
|
* 可以考虑使用 http://paste.ubuntu.com 来对你在提交问题的时候出现的为代码进行简化。
|
||||||
|
|
||||||
|
### 框架和案例
|
||||||
|
|
||||||
|
如果你想登记你的项目,请[访问这里](https://www.ossez.com/t/wechat-j-demo/14303)。
|
||||||
|
|
||||||
|
同时,我们也提供了一些开发框架,能够让你直接检出项目就可以直接对微信 SDK 进行接入和测试。
|
||||||
|
|
||||||
|
* [公众号 Spring Boot 测试程序](https://github.com/honeymoose/WeChat-Official-Account-Spring)
|
||||||
|
|
||||||
|
# 联系方式
|
||||||
|
|
||||||
|
请使用下面的联系方式和我们联系。
|
||||||
|
|
||||||
|
* [社区和讨论](https://www.ossez.com/tag/chat-gpt)
|
||||||
|
|
||||||
|
| 联系方式名称 | 联系方式 |
|
||||||
|
|------------------|-----------------------------------------------|
|
||||||
|
| 电子邮件(Email) | [yhu@ossez.com](mailto:yhu@ossez.com) |
|
||||||
|
| QQ 或微信(WeChat) | 103899765 |
|
||||||
|
| QQ 交流群 | 15186112 |
|
||||||
|
| 社区论坛 (Community) | https://www.ossez.com/c/computer-technology/7 |
|
||||||
|
|
||||||
|
# 公众平台
|
||||||
|
|
||||||
|
我们建议您通过社区论坛来和我们进行沟通,请关注我们公众平台上的账号
|
||||||
|
|
||||||
|
## 微信公众号
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 头条号
|
||||||
|
|
||||||
|
我们也在头条号上创建了我们的公众号,请扫描下面的 QR 关注我们的头条号。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 知乎
|
||||||
|
|
||||||
|
请关注我们的知乎:https://www.zhihu.com/people/huyuchengus
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
|
[WeChat-J is licensed under the MIT License](https://src.ossez.com/honeymoose/WeChat-J/src/branch/main/LICENSE)
|
||||||
|
186
common/pom.xml
Normal file
186
common/pom.xml
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.ossez.wechat</groupId>
|
||||||
|
<artifactId>wechat-j-common</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>com.ossez.wechat</groupId>
|
||||||
|
<artifactId>wechat-j</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<name>WeChat Java Common</name>
|
||||||
|
<description>The module is common for all other package</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jodd</groupId>
|
||||||
|
<artifactId>jodd-http</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.thoughtworks.xstream</groupId>
|
||||||
|
<artifactId>xstream</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpmime</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>jcl-over-slf4j</artifactId>
|
||||||
|
<version>1.7.36</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.guava</groupId>
|
||||||
|
<artifactId>guava</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-classic</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.inject</groupId>
|
||||||
|
<artifactId>guice</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-server</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.jetty</groupId>
|
||||||
|
<artifactId>jetty-servlet</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.assertj</groupId>
|
||||||
|
<artifactId>assertj-guava</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dom4j</groupId>
|
||||||
|
<artifactId>dom4j</artifactId>
|
||||||
|
<version>2.1.3</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>pull-parser</groupId>
|
||||||
|
<artifactId>pull-parser</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>redis.clients</groupId>
|
||||||
|
<artifactId>jedis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.jedis-lock</groupId>
|
||||||
|
<artifactId>jedis-lock</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.redisson</groupId>
|
||||||
|
<artifactId>redisson</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.data</groupId>
|
||||||
|
<artifactId>spring-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains</groupId>
|
||||||
|
<artifactId>annotations</artifactId>
|
||||||
|
<version>RELEASE</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<suiteXmlFiles>
|
||||||
|
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
|
||||||
|
</suiteXmlFiles>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>native-image</id>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>false</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.5.1</version>
|
||||||
|
<configuration>
|
||||||
|
<annotationProcessors>
|
||||||
|
com.github.binarywang.wx.graal.GraalProcessor,lombok.launch.AnnotationProcessorHider$AnnotationProcessor,lombok.launch.AnnotationProcessorHider$ClaimingProcessor
|
||||||
|
</annotationProcessors>
|
||||||
|
<annotationProcessorPaths>
|
||||||
|
<path>
|
||||||
|
<groupId>com.github.binarywang</groupId>
|
||||||
|
<artifactId>weixin-graal</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</path>
|
||||||
|
</annotationProcessorPaths>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
|
</project>
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.annotation;
|
package com.ossez.wechat.common.annotation;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.ossez.wechat.common.api;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.model.WeChatAccessToken;
|
||||||
|
import com.ossez.wechat.common.model.WeChatApiDomainIp;
|
||||||
|
import com.ossez.wechat.common.model.req.NetworkCheck;
|
||||||
|
import com.ossez.wechat.common.model.req.QueryQuota;
|
||||||
|
import com.ossez.wechat.common.model.res.NetworkCheckResponse;
|
||||||
|
import com.ossez.wechat.common.model.res.QueryQuotaResponse;
|
||||||
|
import io.reactivex.Single;
|
||||||
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface WeChatOfficialAccountApi {
|
||||||
|
|
||||||
|
@GET("/cgi-bin/token")
|
||||||
|
Single<WeChatAccessToken> getAccessToken(@Query("grant_type") String grantType, @Query("appid") String appId, @Query("secret") String secret);
|
||||||
|
|
||||||
|
@GET("/cgi-bin/get_api_domain_ip")
|
||||||
|
Single<WeChatApiDomainIp> getDomainIPs();
|
||||||
|
|
||||||
|
@POST("/cgi-bin/callback/check")
|
||||||
|
Single<NetworkCheckResponse> checkNetwork(@Body NetworkCheck request);
|
||||||
|
|
||||||
|
@POST("/cgi-bin/clear_quota")
|
||||||
|
Single<NetworkCheckResponse> clearQuota(@Body NetworkCheck request);
|
||||||
|
|
||||||
|
@POST("/cgi-bin/openapi/quota/get")
|
||||||
|
Single<QueryQuotaResponse> queryQuota(@Body QueryQuota request);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.ossez.wechat.common.api;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.model.WeChatAccessToken;
|
||||||
|
import com.ossez.wechat.common.model.WeChatApiDomainIp;
|
||||||
|
import com.ossez.wechat.common.model.WeChatOAuth2AccessToken;
|
||||||
|
import com.ossez.wechat.common.model.entity.WeChatOAuth2UserInfo;
|
||||||
|
import com.ossez.wechat.common.model.req.NetworkCheck;
|
||||||
|
import com.ossez.wechat.common.model.req.QueryQuota;
|
||||||
|
import com.ossez.wechat.common.model.res.NetworkCheckResponse;
|
||||||
|
import com.ossez.wechat.common.model.res.QueryQuotaResponse;
|
||||||
|
import io.reactivex.Single;
|
||||||
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
public interface WeChatOpenApi {
|
||||||
|
|
||||||
|
@GET("/sns/oauth2/access_token")
|
||||||
|
Single<WeChatOAuth2AccessToken> getAccessToken(@Query("grant_type") String grantType, @Query("appid") String appId, @Query("secret") String secret, @Query("code") String code);
|
||||||
|
|
||||||
|
@GET("/sns/userinfo")
|
||||||
|
Single<WeChatOAuth2UserInfo> getWeChatUserInfo(@Query("access_token") String accessToken, @Query("openid") String openId);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package me.chanjar.weixin.common.api;
|
package com.ossez.wechat.common.api;
|
||||||
|
|
||||||
import me.chanjar.weixin.common.error.WxErrorException;
|
import com.ossez.wechat.common.exception.WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WxErrorException处理器.
|
* WxErrorException处理器.
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.api;
|
package com.ossez.wechat.common.api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.api;
|
package com.ossez.wechat.common.api;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.api;
|
package com.ossez.wechat.common.api;
|
||||||
|
|
||||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -12,10 +12,10 @@ import java.util.concurrent.TimeUnit;
|
|||||||
* @author jiangby
|
* @author jiangby
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* <p>
|
* <p>
|
||||||
* 消息去重,记录消息ID首次出现时的时间戳,
|
* 消息去重,记录消息ID首次出现时的时间戳,
|
||||||
* 15S后定时任务触发时废除该记录消息ID
|
* 15S后定时任务触发时废除该记录消息ID
|
||||||
* </p>
|
* </p>
|
||||||
* @date 2022/5/26 1:32
|
* created on 2022/5/26 1:32
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class WxMessageInMemoryDuplicateCheckerSingleton implements WxMessageDuplicateChecker {
|
public class WxMessageInMemoryDuplicateCheckerSingleton implements WxMessageDuplicateChecker {
|
||||||
@ -34,7 +34,7 @@ public class WxMessageInMemoryDuplicateCheckerSingleton implements WxMessageDupl
|
|||||||
* 线程池
|
* 线程池
|
||||||
*/
|
*/
|
||||||
private static final ScheduledThreadPoolExecutor SCHEDULED_THREAD_POOL_EXECUTOR = new ScheduledThreadPoolExecutor(1,
|
private static final ScheduledThreadPoolExecutor SCHEDULED_THREAD_POOL_EXECUTOR = new ScheduledThreadPoolExecutor(1,
|
||||||
new ThreadFactoryBuilder().setNameFormat("wxMessage-memory-pool-%d").build(), new ThreadPoolExecutor.AbortPolicy());
|
new ThreadFactoryBuilder().setNameFormat("wxMessage-memory-pool-%d").setDaemon(true).build(), new ThreadPoolExecutor.AbortPolicy());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消息id->消息时间戳的map.
|
* 消息id->消息时间戳的map.
|
||||||
@ -71,7 +71,7 @@ public class WxMessageInMemoryDuplicateCheckerSingleton implements WxMessageDupl
|
|||||||
* 内部类实现单例
|
* 内部类实现单例
|
||||||
*/
|
*/
|
||||||
private static class WxMessageInnerClass {
|
private static class WxMessageInnerClass {
|
||||||
static final WxMessageInMemoryDuplicateCheckerSingleton CHECKER_SINGLETON = new WxMessageInMemoryDuplicateCheckerSingleton();
|
static final WxMessageInMemoryDuplicateCheckerSingleton CHECKER_SINGLETON = new WxMessageInMemoryDuplicateCheckerSingleton();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
@ -1,10 +1,10 @@
|
|||||||
package me.chanjar.weixin.common.bean;
|
package com.ossez.wechat.common.bean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 包含toJson()方法的接口.
|
* 包含toJson()方法的接口.
|
||||||
*
|
*
|
||||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||||
* @date 2020-10-05
|
* created on 2020-10-05
|
||||||
*/
|
*/
|
||||||
public interface ToJson {
|
public interface ToJson {
|
||||||
/**
|
/**
|
@ -1,9 +1,9 @@
|
|||||||
package me.chanjar.weixin.common.bean;
|
package com.ossez.wechat.common.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 卡券Api签名.
|
* 卡券Api签名.
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.bean;
|
package com.ossez.wechat.common.bean;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
package me.chanjar.weixin.common.bean;
|
package com.ossez.wechat.common.bean;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.bean.imgproc;
|
package com.ossez.wechat.common.bean.imgproc;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.bean.imgproc;
|
package com.ossez.wechat.common.bean.imgproc;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.bean.imgproc;
|
package com.ossez.wechat.common.bean.imgproc;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.bean.ocr;
|
package com.ossez.wechat.common.bean.ocr;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.bean.ocr;
|
package com.ossez.wechat.common.bean.ocr;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.bean.ocr;
|
package com.ossez.wechat.common.bean.ocr;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.bean.ocr;
|
package com.ossez.wechat.common.bean.ocr;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.bean.ocr;
|
package com.ossez.wechat.common.bean.ocr;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.bean.ocr;
|
package com.ossez.wechat.common.bean.ocr;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ import java.io.Serializable;
|
|||||||
* OCR身份证识别结果.
|
* OCR身份证识别结果.
|
||||||
*
|
*
|
||||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||||
* @date 2019-06-23
|
* created on 2019-06-23
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class WxOcrIdCardResult implements Serializable {
|
public class WxOcrIdCardResult implements Serializable {
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.bean.ocr;
|
package com.ossez.wechat.common.bean.ocr;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.bean.ocr;
|
package com.ossez.wechat.common.bean.ocr;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -1,9 +1,9 @@
|
|||||||
package me.chanjar.weixin.common.bean.result;
|
package com.ossez.wechat.common.bean.result;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
@ -1,9 +1,9 @@
|
|||||||
package me.chanjar.weixin.common.bean.result;
|
package com.ossez.wechat.common.bean.result;
|
||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -1,10 +1,10 @@
|
|||||||
package me.chanjar.weixin.common.bean.result;
|
package com.ossez.wechat.common.bean.result;
|
||||||
|
|
||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.bean.result;
|
package com.ossez.wechat.common.bean.result;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.bean.result;
|
package com.ossez.wechat.common.bean.result;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.bean.subscribemsg;
|
package com.ossez.wechat.common.bean.subscribemsg;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ import java.io.Serializable;
|
|||||||
* .
|
* .
|
||||||
*
|
*
|
||||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||||
* @date 2021-01-27
|
* created on 2021-01-27
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class CategoryData implements Serializable {
|
public class CategoryData implements Serializable {
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.bean.subscribemsg;
|
package com.ossez.wechat.common.bean.subscribemsg;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ import java.io.Serializable;
|
|||||||
* .
|
* .
|
||||||
*
|
*
|
||||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||||
* @date 2021-01-27
|
* created on 2021-01-27
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class PubTemplateKeyword implements Serializable {
|
public class PubTemplateKeyword implements Serializable {
|
@ -1,7 +1,7 @@
|
|||||||
package me.chanjar.weixin.common.bean.subscribemsg;
|
package com.ossez.wechat.common.bean.subscribemsg;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.bean.subscribemsg;
|
package com.ossez.wechat.common.bean.subscribemsg;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ import java.io.Serializable;
|
|||||||
* .
|
* .
|
||||||
*
|
*
|
||||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||||
* @date 2021-01-27
|
* created on 2021-01-27
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class TemplateInfo implements Serializable {
|
public class TemplateInfo implements Serializable {
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.mp.config;
|
package com.ossez.wechat.common.config;
|
||||||
|
|
||||||
import me.chanjar.weixin.common.bean.WxAccessToken;
|
import com.ossez.wechat.common.model.WeChatAccessToken;
|
||||||
import me.chanjar.weixin.common.enums.TicketType;
|
import com.ossez.wechat.common.enums.TicketType;
|
||||||
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
|
import com.ossez.wechat.common.util.http.apache.ApacheHttpClientBuilder;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
@ -12,7 +12,7 @@ import java.util.concurrent.locks.Lock;
|
|||||||
*
|
*
|
||||||
* @author chanjarster
|
* @author chanjarster
|
||||||
*/
|
*/
|
||||||
public interface WxMpConfigStorage {
|
public interface ConfigStorage {
|
||||||
/**
|
/**
|
||||||
* Gets access token.
|
* Gets access token.
|
||||||
*
|
*
|
||||||
@ -44,7 +44,7 @@ public interface WxMpConfigStorage {
|
|||||||
*
|
*
|
||||||
* @param accessToken 要更新的WxAccessToken对象
|
* @param accessToken 要更新的WxAccessToken对象
|
||||||
*/
|
*/
|
||||||
void updateAccessToken(WxAccessToken accessToken);
|
void updateAccessToken(WeChatAccessToken accessToken);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应该是线程安全的.
|
* 应该是线程安全的.
|
||||||
@ -95,6 +95,8 @@ public interface WxMpConfigStorage {
|
|||||||
*/
|
*/
|
||||||
void updateTicket(TicketType type, String ticket, int expiresInSeconds);
|
void updateTicket(TicketType type, String ticket, int expiresInSeconds);
|
||||||
|
|
||||||
|
String getOpenAppId();
|
||||||
|
String getOpenSecret();
|
||||||
/**
|
/**
|
||||||
* Gets app id.
|
* Gets app id.
|
||||||
*
|
*
|
||||||
@ -175,7 +177,7 @@ public interface WxMpConfigStorage {
|
|||||||
/**
|
/**
|
||||||
* http 请求重试间隔
|
* http 请求重试间隔
|
||||||
* <pre>
|
* <pre>
|
||||||
* {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setRetrySleepMillis(int)}
|
* {@link BaseWeChatOfficialAccountServiceImpl#setRetrySleepMillis(int)}
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
int getRetrySleepMillis();
|
int getRetrySleepMillis();
|
||||||
@ -183,7 +185,7 @@ public interface WxMpConfigStorage {
|
|||||||
/**
|
/**
|
||||||
* http 请求最大重试次数
|
* http 请求最大重试次数
|
||||||
* <pre>
|
* <pre>
|
||||||
* {@link me.chanjar.weixin.mp.api.impl.BaseWxMpServiceImpl#setMaxRetryTimes(int)}
|
* {@link BaseWeChatOfficialAccountServiceImpl#setMaxRetryTimes(int)}
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
int getMaxRetryTimes();
|
int getMaxRetryTimes();
|
@ -1,12 +1,9 @@
|
|||||||
package me.chanjar.weixin.mp.config.impl;
|
package com.ossez.wechat.common.config;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.bean.WxAccessToken;
|
import com.ossez.wechat.common.model.WeChatAccessToken;
|
||||||
import me.chanjar.weixin.common.enums.TicketType;
|
import com.ossez.wechat.common.enums.TicketType;
|
||||||
import me.chanjar.weixin.common.util.http.apache.ApacheHttpClientBuilder;
|
import com.ossez.wechat.common.util.http.apache.ApacheHttpClientBuilder;
|
||||||
import me.chanjar.weixin.mp.config.WxMpConfigStorage;
|
|
||||||
import me.chanjar.weixin.mp.config.WxMpHostConfig;
|
|
||||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -19,9 +16,11 @@ import java.util.concurrent.locks.ReentrantLock;
|
|||||||
* @author chanjarster
|
* @author chanjarster
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class WxMpDefaultConfigImpl implements WxMpConfigStorage, Serializable {
|
public class DefaultConfigStorage implements ConfigStorage, Serializable {
|
||||||
private static final long serialVersionUID = -6646519023303395185L;
|
private static final long serialVersionUID = -6646519023303395185L;
|
||||||
|
|
||||||
|
protected volatile String openAppId;
|
||||||
|
protected volatile String openSecret;
|
||||||
protected volatile String appId;
|
protected volatile String appId;
|
||||||
protected volatile String secret;
|
protected volatile String secret;
|
||||||
protected volatile String token;
|
protected volatile String token;
|
||||||
@ -66,7 +65,7 @@ public class WxMpDefaultConfigImpl implements WxMpConfigStorage, Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void updateAccessToken(WxAccessToken accessToken) {
|
public synchronized void updateAccessToken(WeChatAccessToken accessToken) {
|
||||||
updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
|
updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,10 +175,6 @@ public class WxMpDefaultConfigImpl implements WxMpConfigStorage, Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return WxMpGsonBuilder.create().toJson(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean autoRefreshToken() {
|
public boolean autoRefreshToken() {
|
@ -1,17 +1,17 @@
|
|||||||
package me.chanjar.weixin.mp.config.impl;
|
package com.ossez.wechat.common.config;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.config.DefaultConfigStorage;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.bean.WxAccessToken;
|
import com.ossez.wechat.common.model.WeChatAccessToken;
|
||||||
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Brayden Wong
|
* @author Brayden Wong
|
||||||
* @date 2021/1/16
|
* created on 2021/1/16
|
||||||
* 提供accesstoken保存在concurrenthashmap中的实现,支持高并发。仅限于单机部署。
|
* 提供accesstoken保存在concurrenthashmap中的实现,支持高并发。仅限于单机部署。
|
||||||
*/
|
*/
|
||||||
@Data
|
public class MapConfigStorage extends DefaultConfigStorage {
|
||||||
public class WxMpMapConfigImpl extends WxMpDefaultConfigImpl {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 5311395137835650104L;
|
private static final long serialVersionUID = 5311395137835650104L;
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ public class WxMpMapConfigImpl extends WxMpDefaultConfigImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateAccessToken(WxAccessToken accessToken) {
|
public void updateAccessToken(WeChatAccessToken accessToken) {
|
||||||
updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
|
updateAccessToken(accessToken.getAccessToken(), accessToken.getExpiresIn());
|
||||||
}
|
}
|
||||||
|
|
@ -1,9 +1,10 @@
|
|||||||
package me.chanjar.weixin.mp.config.impl;
|
package com.ossez.wechat.common.config;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.config.DefaultConfigStorage;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import me.chanjar.weixin.common.enums.TicketType;
|
import com.ossez.wechat.common.enums.TicketType;
|
||||||
import me.chanjar.weixin.common.redis.WxRedisOps;
|
import com.ossez.wechat.common.redis.WxRedisOps;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@ -17,9 +18,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
*
|
*
|
||||||
* @author nickwong
|
* @author nickwong
|
||||||
*/
|
*/
|
||||||
@Data
|
public class RedisConfigStorage extends DefaultConfigStorage {
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
public class WxMpRedisConfigImpl extends WxMpDefaultConfigImpl {
|
|
||||||
private static final long serialVersionUID = -988502871997239733L;
|
private static final long serialVersionUID = -988502871997239733L;
|
||||||
|
|
||||||
private static final String ACCESS_TOKEN_KEY_TPL = "%s:access_token:%s";
|
private static final String ACCESS_TOKEN_KEY_TPL = "%s:access_token:%s";
|
||||||
@ -32,7 +31,7 @@ public class WxMpRedisConfigImpl extends WxMpDefaultConfigImpl {
|
|||||||
private String accessTokenKey;
|
private String accessTokenKey;
|
||||||
private String lockKey;
|
private String lockKey;
|
||||||
|
|
||||||
public WxMpRedisConfigImpl(WxRedisOps redisOps, String keyPrefix) {
|
public RedisConfigStorage(WxRedisOps redisOps, String keyPrefix) {
|
||||||
this.redisOps = redisOps;
|
this.redisOps = redisOps;
|
||||||
this.keyPrefix = keyPrefix;
|
this.keyPrefix = keyPrefix;
|
||||||
}
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package com.ossez.wechat.common.config;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.constant.WeChatConstant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信接口地址域名部分的自定义设置信息.
|
||||||
|
*/
|
||||||
|
public class WxMpHostConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应于:https://api.weixin.qq.com
|
||||||
|
*/
|
||||||
|
private String apiHost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应于:https://open.weixin.qq.com
|
||||||
|
*/
|
||||||
|
private String openHost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应于:https://mp.weixin.qq.com
|
||||||
|
*/
|
||||||
|
private String mpHost;
|
||||||
|
|
||||||
|
public static String buildUrl(WxMpHostConfig hostConfig, String prefix, String path) {
|
||||||
|
if (hostConfig == null) {
|
||||||
|
return prefix + path;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hostConfig.getApiHost() != null && prefix.equals(WeChatConstant.ENDPOINT_WECHAT)) {
|
||||||
|
return hostConfig.getApiHost() + path;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hostConfig.getMpHost() != null && prefix.equals(WeChatConstant.ENDPOINT_MP)) {
|
||||||
|
return hostConfig.getMpHost() + path;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hostConfig.getOpenHost() != null && prefix.equals(WeChatConstant.ENDPOINT_OPEN)) {
|
||||||
|
return hostConfig.getOpenHost() + path;
|
||||||
|
}
|
||||||
|
|
||||||
|
return prefix + path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getApiHost() {
|
||||||
|
return apiHost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApiHost(String apiHost) {
|
||||||
|
this.apiHost = apiHost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenHost() {
|
||||||
|
return openHost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenHost(String openHost) {
|
||||||
|
this.openHost = openHost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMpHost() {
|
||||||
|
return mpHost;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMpHost(String mpHost) {
|
||||||
|
this.mpHost = mpHost;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.ossez.wechat.common.constant;
|
||||||
|
|
||||||
|
import com.google.common.net.MediaType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* HttpClient send request the type constant.
|
||||||
|
* Because okHttp need to use MediaType to construct object, but if we use guava MediaType, the two package will get conflict
|
||||||
|
* at the same class.
|
||||||
|
* <p>
|
||||||
|
* So, we get MediaType String first before we convert to okHttp MediaType.
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public final class HttpClientMediaType {
|
||||||
|
public static final String APPLICATION_JSON = MediaType.JSON_UTF_8.toString();
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.mp.constant;
|
package com.ossez.wechat.common.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -8,7 +8,7 @@ package me.chanjar.weixin.mp.constant;
|
|||||||
*
|
*
|
||||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||||
*/
|
*/
|
||||||
public class WxMpEventConstants {
|
public class OfficialAccountEventConstants {
|
||||||
/**
|
/**
|
||||||
* 门店审核事件.
|
* 门店审核事件.
|
||||||
*/
|
*/
|
@ -0,0 +1,5 @@
|
|||||||
|
package com.ossez.wechat.common.constant;
|
||||||
|
|
||||||
|
public class WeChatApiParameter {
|
||||||
|
public static final String ACCESS_TOKEN_GRANT_TYPE_CLIENT_CREDENTIAL = "client_credential";
|
||||||
|
}
|
@ -0,0 +1,556 @@
|
|||||||
|
package com.ossez.wechat.common.constant;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.enums.WeChatErrorCode;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The constant of WeChat
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public class WeChatConstant {
|
||||||
|
|
||||||
|
public static final String ENDPOINT_WECHAT = "https://api.weixin.qq.com";
|
||||||
|
public static final String ENDPOINT_MP = "https://mp.weixin.qq.com";
|
||||||
|
public static final String ENDPOINT_OPEN = "https://open.weixin.qq.com";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* access_token 相关错误代码
|
||||||
|
* <pre>
|
||||||
|
* 发生以下情况时尝试刷新access_token
|
||||||
|
* 40001 获取access_token时AppSecret错误,或者access_token无效
|
||||||
|
* 42001 access_token超时
|
||||||
|
* 40014 不合法的access_token,请开发者认真比对access_token的有效性(如是否过期),或查看是否正在为恰当的公众号调用接口
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static final EnumSet<WeChatErrorCode> ACCESS_TOKEN_ERROR_CODES_SET = EnumSet.of(WeChatErrorCode.CODE_40001, WeChatErrorCode.CODE_40014, WeChatErrorCode.CODE_42001);
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public static final List<Integer> ACCESS_TOKEN_ERROR_CODES = Arrays.asList(WeChatErrorCode.CODE_40001.getCode(),
|
||||||
|
WeChatErrorCode.CODE_40014.getCode(), WeChatErrorCode.CODE_42001.getCode());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信推送过来的消息的类型,和发送给微信xml格式消息的消息类型.
|
||||||
|
*/
|
||||||
|
public static class XmlMsgType {
|
||||||
|
public static final String TEXT = "text";
|
||||||
|
public static final String IMAGE = "image";
|
||||||
|
public static final String VOICE = "voice";
|
||||||
|
public static final String SHORTVIDEO = "shortvideo";
|
||||||
|
public static final String VIDEO = "video";
|
||||||
|
public static final String NEWS = "news";
|
||||||
|
public static final String MUSIC = "music";
|
||||||
|
public static final String LOCATION = "location";
|
||||||
|
public static final String LINK = "link";
|
||||||
|
public static final String EVENT = "event";
|
||||||
|
public static final String DEVICE_TEXT = "device_text";
|
||||||
|
public static final String DEVICE_EVENT = "device_event";
|
||||||
|
public static final String DEVICE_STATUS = "device_status";
|
||||||
|
public static final String HARDWARE = "hardware";
|
||||||
|
public static final String TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service";
|
||||||
|
public static final String UPDATE_TASKCARD = "update_taskcard";
|
||||||
|
public static final String UPDATE_BUTTON = "update_button";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主动发送消息(即客服消息)的消息类型.
|
||||||
|
*/
|
||||||
|
public static class MsgType {
|
||||||
|
/**
|
||||||
|
* 消息类型:
|
||||||
|
* text(文本)
|
||||||
|
* image(图片)
|
||||||
|
* voice(语音)
|
||||||
|
* video(视频)
|
||||||
|
* music(音乐)
|
||||||
|
* news(图文消息 - 点击跳转到外链)
|
||||||
|
* mpnews(图文消息 - 点击跳转到图文消息页面)
|
||||||
|
* wxcard(卡券)
|
||||||
|
* miniprogrampage(小程序)
|
||||||
|
* markdown(目前仅支持markdown语法的子集,微工作台(原企业号)不支持展示markdown消息)
|
||||||
|
* file(发送文件 - CP专用)
|
||||||
|
* textcard(文本卡片消息 - CP专用)
|
||||||
|
* wxcard(卡券消息)
|
||||||
|
*/
|
||||||
|
public static final String TEXT = "text";
|
||||||
|
public static final String IMAGE = "image";
|
||||||
|
public static final String VOICE = "voice";
|
||||||
|
public static final String VIDEO = "video";
|
||||||
|
public static final String MUSIC = "music";
|
||||||
|
public static final String NEWS = "news";
|
||||||
|
public static final String MPNEWS = "mpnews";
|
||||||
|
public static final String MARKDOWN = "markdown";
|
||||||
|
public static final String FILE = "file";
|
||||||
|
public static final String TEXTCARD = "textcard";
|
||||||
|
public static final String WXCARD = "wxcard";
|
||||||
|
/**
|
||||||
|
* 转发到客服的消息.
|
||||||
|
*/
|
||||||
|
public static final String TRANSFER_CUSTOMER_SERVICE = "transfer_customer_service";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序卡片(要求小程序与公众号已关联).
|
||||||
|
*/
|
||||||
|
public static final String MINIPROGRAMPAGE = "miniprogrampage";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务卡片消息.
|
||||||
|
*/
|
||||||
|
public static final String TASKCARD = "taskcard";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 菜单消息.
|
||||||
|
*/
|
||||||
|
public static final String MSGMENU = "msgmenu";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序通知消息.
|
||||||
|
*/
|
||||||
|
public static final String MINIPROGRAM_NOTICE = "miniprogram_notice";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模板卡片消息.
|
||||||
|
*/
|
||||||
|
public static final String TEMPLATE_CARD = "template_card";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送图文消息(点击跳转到图文消息页面)使用通过 “发布” 系列接口得到的 article_id(草稿箱功能上线后不再支持客服接口中带 media_id 的 mpnews 类型的图文消息)
|
||||||
|
*/
|
||||||
|
public static final String MP_NEWS_ARTICLE = "mpnewsarticle";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送「学校通知」类型
|
||||||
|
* https://developer.work.weixin.qq.com/document/path/92321
|
||||||
|
*/
|
||||||
|
public static class SchoolContactMsgType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文本消息.
|
||||||
|
*/
|
||||||
|
public static final String TEXT = "text";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片消息.
|
||||||
|
*/
|
||||||
|
public static final String IMAGE = "image";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 语音消息.
|
||||||
|
*/
|
||||||
|
public static final String VOICE = "voice";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 视频消息.
|
||||||
|
*/
|
||||||
|
public static final String VIDEO = "video";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件消息
|
||||||
|
*/
|
||||||
|
public static final String FILE = "file";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图文消息
|
||||||
|
*/
|
||||||
|
public static final String NEWS = "news";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图文消息(mpnews)
|
||||||
|
*/
|
||||||
|
public static final String MPNEWS = "mpnews";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序消息
|
||||||
|
*/
|
||||||
|
public static final String MINIPROGRAM = "miniprogram";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业微信模板卡片消息的卡片类型
|
||||||
|
*/
|
||||||
|
public static class TemplateCardType {
|
||||||
|
/**
|
||||||
|
* 文本通知型卡片
|
||||||
|
*/
|
||||||
|
public static final String TEXT_NOTICE = "text_notice";
|
||||||
|
/**
|
||||||
|
* 图文展示型卡片
|
||||||
|
*/
|
||||||
|
public static final String NEWS_NOTICE = "news_notice";
|
||||||
|
/**
|
||||||
|
* 按钮交互型卡片
|
||||||
|
*/
|
||||||
|
public static final String BUTTON_INTERACTION = "button_interaction";
|
||||||
|
/**
|
||||||
|
* 投票选择型卡片
|
||||||
|
*/
|
||||||
|
public static final String VOTE_INTERACTION = "vote_interaction";
|
||||||
|
/**
|
||||||
|
* 多项选择型卡片
|
||||||
|
*/
|
||||||
|
public static final String MULTIPLE_INTERACTION = "multiple_interaction";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表示是否是保密消息,0表示否,1表示是,默认0.
|
||||||
|
*/
|
||||||
|
public static class KefuMsgSafe {
|
||||||
|
public static final String NO = "0";
|
||||||
|
public static final String YES = "1";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 群发消息的消息类型.
|
||||||
|
*/
|
||||||
|
public static class MassMsgType {
|
||||||
|
public static final String MPNEWS = "mpnews";
|
||||||
|
public static final String TEXT = "text";
|
||||||
|
public static final String VOICE = "voice";
|
||||||
|
public static final String IMAGE = "image";
|
||||||
|
public static final String IMAGES = "images";
|
||||||
|
public static final String MPVIDEO = "mpvideo";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 群发消息后微信端推送给服务器的反馈消息.
|
||||||
|
*/
|
||||||
|
public static class MassMsgStatus {
|
||||||
|
public static final String SEND_SUCCESS = "send success";
|
||||||
|
public static final String SEND_FAIL = "send fail";
|
||||||
|
public static final String ERR_10001 = "err(10001)";
|
||||||
|
public static final String ERR_20001 = "err(20001)";
|
||||||
|
public static final String ERR_20004 = "err(20004)";
|
||||||
|
public static final String ERR_20002 = "err(20002)";
|
||||||
|
public static final String ERR_20006 = "err(20006)";
|
||||||
|
public static final String ERR_20008 = "err(20008)";
|
||||||
|
public static final String ERR_20013 = "err(20013)";
|
||||||
|
public static final String ERR_22000 = "err(22000)";
|
||||||
|
public static final String ERR_21000 = "err(21000)";
|
||||||
|
public static final String ERR_30001 = "err(30001)";
|
||||||
|
public static final String ERR_30002 = "err(30002)";
|
||||||
|
public static final String ERR_30003 = "err(30003)";
|
||||||
|
public static final String ERR_40001 = "err(40001)";
|
||||||
|
public static final String ERR_40002 = "err(40002)";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 群发反馈消息代码所对应的文字描述.
|
||||||
|
*/
|
||||||
|
public static final Map<String, String> STATUS_DESC = new HashMap<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
STATUS_DESC.put(SEND_SUCCESS, "发送成功");
|
||||||
|
STATUS_DESC.put(SEND_FAIL, "发送失败");
|
||||||
|
STATUS_DESC.put(ERR_10001, "涉嫌广告");
|
||||||
|
STATUS_DESC.put(ERR_20001, "涉嫌政治");
|
||||||
|
STATUS_DESC.put(ERR_20004, "涉嫌社会");
|
||||||
|
STATUS_DESC.put(ERR_20002, "涉嫌色情");
|
||||||
|
STATUS_DESC.put(ERR_20006, "涉嫌违法犯罪");
|
||||||
|
STATUS_DESC.put(ERR_20008, "涉嫌欺诈");
|
||||||
|
STATUS_DESC.put(ERR_20013, "涉嫌版权");
|
||||||
|
STATUS_DESC.put(ERR_22000, "涉嫌互推_互相宣传");
|
||||||
|
STATUS_DESC.put(ERR_21000, "涉嫌其他");
|
||||||
|
STATUS_DESC.put(ERR_30001, "原创校验出现系统错误且用户选择了被判为转载就不群发");
|
||||||
|
STATUS_DESC.put(ERR_30002, "原创校验被判定为不能群发");
|
||||||
|
STATUS_DESC.put(ERR_30003, "原创校验被判定为转载文且用户选择了被判为转载就不群发");
|
||||||
|
STATUS_DESC.put(ERR_40001, "管理员拒绝");
|
||||||
|
STATUS_DESC.put(ERR_40002, "管理员30分钟内无响应,超时");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信端推送过来的事件类型.
|
||||||
|
*/
|
||||||
|
public static class EventType {
|
||||||
|
public static final String SUBSCRIBE = "subscribe";
|
||||||
|
public static final String UNSUBSCRIBE = "unsubscribe";
|
||||||
|
public static final String SCAN = "SCAN";
|
||||||
|
public static final String LOCATION = "LOCATION";
|
||||||
|
public static final String CLICK = "CLICK";
|
||||||
|
public static final String VIEW = "VIEW";
|
||||||
|
public static final String MASS_SEND_JOB_FINISH = "MASSSENDJOBFINISH";
|
||||||
|
/**
|
||||||
|
* 扫码推事件的事件推送
|
||||||
|
*/
|
||||||
|
public static final String SCANCODE_PUSH = "scancode_push";
|
||||||
|
/**
|
||||||
|
* 扫码推事件且弹出“消息接收中”提示框的事件推送.
|
||||||
|
*/
|
||||||
|
public static final String SCANCODE_WAITMSG = "scancode_waitmsg";
|
||||||
|
/**
|
||||||
|
* 弹出系统拍照发图的事件推送.
|
||||||
|
*/
|
||||||
|
public static final String PIC_SYSPHOTO = "pic_sysphoto";
|
||||||
|
/**
|
||||||
|
* 弹出拍照或者相册发图的事件推送.
|
||||||
|
*/
|
||||||
|
public static final String PIC_PHOTO_OR_ALBUM = "pic_photo_or_album";
|
||||||
|
/**
|
||||||
|
* 弹出微信相册发图器的事件推送.
|
||||||
|
*/
|
||||||
|
public static final String PIC_WEIXIN = "pic_weixin";
|
||||||
|
/**
|
||||||
|
* 弹出地理位置选择器的事件推送.
|
||||||
|
*/
|
||||||
|
public static final String LOCATION_SELECT = "location_select";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 授权用户资料变更事件
|
||||||
|
* 1、 当部分用户的资料存在风险时,平台会对用户资料进行清理,并通过消息推送服务器通知最近30天授权过的公众号开发者,我们建议开发者留意响应该事件,及时主动更新或清理用户的头像及昵称,降低风险。
|
||||||
|
* 2、 当用户撤回授权信息时,平台会通过消息推送服务器通知给公众号开发者,请开发者注意及时删除用户信息。
|
||||||
|
*/
|
||||||
|
public static final String USER_INFO_MODIFIED = "user_info_modified";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户撤回授权事件
|
||||||
|
*/
|
||||||
|
public static final String USER_AUTHORIZATION_REVOKE = "user_authorization_revoke";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 群发模板回调事件
|
||||||
|
*/
|
||||||
|
public static final String TEMPLATE_SEND_JOB_FINISH = "TEMPLATESENDJOBFINISH";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信小店 订单付款通知.
|
||||||
|
*/
|
||||||
|
public static final String MERCHANT_ORDER = "merchant_order";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:卡券通过审核
|
||||||
|
*/
|
||||||
|
public static final String CARD_PASS_CHECK = "card_pass_check";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:卡券未通过审核
|
||||||
|
*/
|
||||||
|
public static final String CARD_NOT_PASS_CHECK = "card_not_pass_check";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:用户领取卡券
|
||||||
|
*/
|
||||||
|
public static final String CARD_USER_GET_CARD = "user_get_card";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:用户转赠卡券
|
||||||
|
*/
|
||||||
|
public static final String CARD_USER_GIFTING_CARD = "user_gifting_card";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 异步安全校验事件
|
||||||
|
*/
|
||||||
|
public static final String WXA_MEDIA_CHECK = "wxa_media_check";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:用户核销卡券
|
||||||
|
*/
|
||||||
|
public static final String CARD_USER_CONSUME_CARD = "user_consume_card";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:用户通过卡券的微信买单完成时推送
|
||||||
|
*/
|
||||||
|
public static final String CARD_USER_PAY_FROM_PAY_CELL = "user_pay_from_pay_cell";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:用户提交会员卡开卡信息
|
||||||
|
*/
|
||||||
|
public static final String CARD_SUBMIT_MEMBERCARD_USER_INFO = "submit_membercard_user_info";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:用户打开查看卡券
|
||||||
|
*/
|
||||||
|
public static final String CARD_USER_VIEW_CARD = "user_view_card";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:用户删除卡券
|
||||||
|
*/
|
||||||
|
public static final String CARD_USER_DEL_CARD = "user_del_card";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:用户在卡券里点击查看公众号进入会话时(需要用户已经关注公众号)
|
||||||
|
*/
|
||||||
|
public static final String CARD_USER_ENTER_SESSION_FROM_CARD = "user_enter_session_from_card";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:当用户的会员卡积分余额发生变动时
|
||||||
|
*/
|
||||||
|
public static final String CARD_UPDATE_MEMBER_CARD = "update_member_card";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:当某个card_id的初始库存数大于200且当前库存小于等于100时,用户尝试领券会触发发送事件给商户,事件每隔12h发送一次
|
||||||
|
*/
|
||||||
|
public static final String CARD_SKU_REMIND = "card_sku_remind";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卡券事件:当商户朋友的券券点发生变动时
|
||||||
|
*/
|
||||||
|
public static final String CARD_PAY_ORDER = "card_pay_order";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序审核事件:审核通过
|
||||||
|
*/
|
||||||
|
public static final String WEAPP_AUDIT_SUCCESS = "weapp_audit_success";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序审核事件:审核不通过
|
||||||
|
*/
|
||||||
|
public static final String WEAPP_AUDIT_FAIL = "weapp_audit_fail";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序自定义交易组件支付通知
|
||||||
|
*/
|
||||||
|
public static final String OPEN_PRODUCT_ORDER_PAY = "open_product_order_pay";
|
||||||
|
/**
|
||||||
|
* 点击菜单跳转小程序的事件推送
|
||||||
|
*/
|
||||||
|
public static final String VIEW_MINIPROGRAM = "view_miniprogram";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订阅通知事件:用户操作订阅通知弹窗
|
||||||
|
*/
|
||||||
|
public static final String SUBSCRIBE_MSG_POPUP_EVENT = "subscribe_msg_popup_event";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订阅通知事件:用户管理订阅通知
|
||||||
|
*/
|
||||||
|
public static final String SUBSCRIBE_MSG_CHANGE_EVENT = "subscribe_msg_change_event";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订阅通知事件:发送订阅通知回调
|
||||||
|
*/
|
||||||
|
public static final String SUBSCRIBE_MSG_SENT_EVENT = "subscribe_msg_sent_event";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传多媒体(临时素材)文件的类型.
|
||||||
|
*/
|
||||||
|
public static class MediaFileType {
|
||||||
|
public static final String IMAGE = "image";
|
||||||
|
public static final String VOICE = "voice";
|
||||||
|
public static final String VIDEO = "video";
|
||||||
|
public static final String THUMB = "thumb";
|
||||||
|
public static final String FILE = "file";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义菜单的按钮类型.
|
||||||
|
*/
|
||||||
|
public static class MenuButtonType {
|
||||||
|
/**
|
||||||
|
* 点击推事件.
|
||||||
|
*/
|
||||||
|
public static final String CLICK = "click";
|
||||||
|
/**
|
||||||
|
* 跳转URL.
|
||||||
|
*/
|
||||||
|
public static final String VIEW = "view";
|
||||||
|
/**
|
||||||
|
* 跳转到小程序.
|
||||||
|
*/
|
||||||
|
public static final String MINIPROGRAM = "miniprogram";
|
||||||
|
/**
|
||||||
|
* 扫码推事件.
|
||||||
|
*/
|
||||||
|
public static final String SCANCODE_PUSH = "scancode_push";
|
||||||
|
/**
|
||||||
|
* 扫码推事件且弹出“消息接收中”提示框.
|
||||||
|
*/
|
||||||
|
public static final String SCANCODE_WAITMSG = "scancode_waitmsg";
|
||||||
|
/**
|
||||||
|
* 弹出系统拍照发图.
|
||||||
|
*/
|
||||||
|
public static final String PIC_SYSPHOTO = "pic_sysphoto";
|
||||||
|
/**
|
||||||
|
* 弹出拍照或者相册发图.
|
||||||
|
*/
|
||||||
|
public static final String PIC_PHOTO_OR_ALBUM = "pic_photo_or_album";
|
||||||
|
/**
|
||||||
|
* 弹出微信相册发图器.
|
||||||
|
*/
|
||||||
|
public static final String PIC_WEIXIN = "pic_weixin";
|
||||||
|
/**
|
||||||
|
* 弹出地理位置选择器.
|
||||||
|
*/
|
||||||
|
public static final String LOCATION_SELECT = "location_select";
|
||||||
|
/**
|
||||||
|
* 下发消息(除文本消息).
|
||||||
|
*/
|
||||||
|
public static final String MEDIA_ID = "media_id";
|
||||||
|
/**
|
||||||
|
* 跳转图文消息URL.
|
||||||
|
*/
|
||||||
|
public static final String VIEW_LIMITED = "view_limited";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* oauth2网页授权的scope.
|
||||||
|
*/
|
||||||
|
public static class OAuth2Scope {
|
||||||
|
/**
|
||||||
|
* 不弹出授权页面,直接跳转,只能获取用户openid.
|
||||||
|
*/
|
||||||
|
public static final String SNSAPI_BASE = "snsapi_base";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 弹出授权页面,可通过openid拿到昵称、性别、所在地。并且,即使在未关注的情况下,只要用户授权,也能获取其信息.
|
||||||
|
*/
|
||||||
|
public static final String SNSAPI_USERINFO = "snsapi_userinfo";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手动授权,可获取成员的详细信息,包含手机、邮箱。只适用于企业微信或企业号.
|
||||||
|
*/
|
||||||
|
public static final String SNSAPI_PRIVATEINFO = "snsapi_privateinfo";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网页应用登录授权作用域.
|
||||||
|
*/
|
||||||
|
public static class QrConnectScope {
|
||||||
|
public static final String SNSAPI_LOGIN = "snsapi_login";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 永久素材类型.
|
||||||
|
*/
|
||||||
|
public static class MaterialType {
|
||||||
|
public static final String NEWS = "news";
|
||||||
|
public static final String VOICE = "voice";
|
||||||
|
public static final String IMAGE = "image";
|
||||||
|
public static final String VIDEO = "video";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网络检测入参.
|
||||||
|
*/
|
||||||
|
public static class NetCheckArgs {
|
||||||
|
public static final String ACTIONDNS = "dns";
|
||||||
|
public static final String ACTIONPING = "ping";
|
||||||
|
public static final String ACTIONALL = "all";
|
||||||
|
public static final String OPERATORUNICOM = "UNICOM";
|
||||||
|
public static final String OPERATORCHINANET = "CHINANET";
|
||||||
|
public static final String OPERATORCAP = "CAP";
|
||||||
|
public static final String OPERATORDEFAULT = "DEFAULT";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* appId 类型
|
||||||
|
*/
|
||||||
|
public static class AppIdType {
|
||||||
|
/**
|
||||||
|
* 公众号appId类型
|
||||||
|
*/
|
||||||
|
public static final String MP_TYPE = "mp";
|
||||||
|
/**
|
||||||
|
* 小程序appId类型
|
||||||
|
*/
|
||||||
|
public static final String MINI_TYPE = "mini";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.ossez.wechat.common.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The language for WeChat API can support
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public enum Language {
|
||||||
|
ZH_CN("zh_CN"), EN_US("en_US");
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
Language(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.enums;
|
package com.ossez.wechat.common.enums;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
@ -0,0 +1,207 @@
|
|||||||
|
package com.ossez.wechat.common.enums;
|
||||||
|
|
||||||
|
import com.google.common.collect.Maps;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WeChat Error Code
|
||||||
|
* <pre>
|
||||||
|
* 微信公众平台全局返回码.
|
||||||
|
* 参考文档:<a href="https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Global_Return_Code.html">公众平台全局返回码</a>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public enum WeChatErrorCode {
|
||||||
|
CODE_1(-1, "系统繁忙,此时请开发者稍候再试"),
|
||||||
|
CODE_0(0, "请求成功"),
|
||||||
|
CODE_40001(40001, "获取 access_token 时 AppSecret 错误,或者 access_token 无效。请开发者认真比对 AppSecret 的正确性,或查看是否正在为恰当的公众号调用接口"),
|
||||||
|
CODE_40002(40002, "不合法的凭证类型"),
|
||||||
|
CODE_40003(40003, "不合法的 OpenID ,请开发者确认 OpenID (该用户)是否已关注公众号,或是否是其他公众号的 OpenID"),
|
||||||
|
CODE_40004(40004, "不合法的媒体文件类型"),
|
||||||
|
CODE_40005(40005, "不合法的文件类型"),
|
||||||
|
CODE_40006(40006, "不合法的文件大小"),
|
||||||
|
CODE_40007(40007, "不合法的媒体文件 id"),
|
||||||
|
CODE_40008(40008, "不合法的消息类型"),
|
||||||
|
CODE_40009(40009, "不合法的图片文件大小"),
|
||||||
|
CODE_40010(40010, "不合法的语音文件大小"),
|
||||||
|
CODE_40011(40011, "不合法的视频文件大小"),
|
||||||
|
CODE_40012(40012, "不合法的缩略图文件大小"),
|
||||||
|
CODE_40013(40013, "不合法的 AppID ,请开发者检查 AppID 的正确性,避免异常字符,注意大小写"),
|
||||||
|
CODE_40014(40014, "不合法的 access_token ,请开发者认真比对 access_token 的有效性(如是否过期),或查看是否正在为恰当的公众号调用接口"),
|
||||||
|
CODE_40015(40015, "不合法的菜单类型"),
|
||||||
|
CODE_40016(40016, "不合法的按钮个数"),
|
||||||
|
CODE_40017(40017, "不合法的按钮类型"),
|
||||||
|
CODE_40018(40018, "不合法的按钮名字长度"),
|
||||||
|
CODE_40019(40019, "不合法的按钮 KEY 长度"),
|
||||||
|
CODE_40020(40020, "不合法的按钮 URL 长度"),
|
||||||
|
CODE_40021(40021, "不合法的菜单版本号"),
|
||||||
|
CODE_40022(40022, "不合法的子菜单级数"),
|
||||||
|
CODE_40023(40023, "不合法的子菜单按钮个数"),
|
||||||
|
CODE_40024(40024, "不合法的子菜单按钮类型"),
|
||||||
|
CODE_40025(40025, "不合法的子菜单按钮名字长度"),
|
||||||
|
CODE_40026(40026, "不合法的子菜单按钮 KEY 长度"),
|
||||||
|
CODE_40027(40027, "不合法的子菜单按钮 URL 长度"),
|
||||||
|
CODE_40028(40028, "不合法的自定义菜单使用用户"),
|
||||||
|
CODE_40029(40029, "不合法的 oauth_code"),
|
||||||
|
CODE_40030(40030, "不合法的 refresh_token"),
|
||||||
|
CODE_40031(40031, "不合法的 openid 列表"),
|
||||||
|
CODE_40032(40032, "不合法的 openid 列表长度"),
|
||||||
|
CODE_40033(40033, "不合法的请求字符,不能包含\\uxxxx 格式的字符"),
|
||||||
|
CODE_40035(40035, "不合法的参数"),
|
||||||
|
CODE_40038(40038, "不合法的请求格式"),
|
||||||
|
CODE_40039(40039, "不合法的 URL 长度"),
|
||||||
|
CODE_40050(40050, "不合法的分组 id"),
|
||||||
|
CODE_40051(40051, "分组名字不合法"),
|
||||||
|
CODE_40060(40060, "删除单篇图文时,指定的 article_idx 不合法"),
|
||||||
|
CODE_40117(40117, "分组名字不合法"),
|
||||||
|
CODE_40118(40118, "media_id 大小不合法"),
|
||||||
|
CODE_40119(40119, "button 类型错误"),
|
||||||
|
CODE_40120(40120, "button 类型错误"),
|
||||||
|
CODE_40121(40121, "不合法的 media_id 类型"),
|
||||||
|
CODE_40132(40132, "微信号不合法"),
|
||||||
|
CODE_40137(40137, "不支持的图片格式"),
|
||||||
|
CODE_40155(40155, "请勿添加其他公众号的主页链接"),
|
||||||
|
CODE_40163(40163, "oauth_code已使用"),
|
||||||
|
CODE_41001(41001, "缺少 access_token 参数"),
|
||||||
|
CODE_41002(41002, "缺少 appid 参数"),
|
||||||
|
CODE_41003(41003, "缺少 refresh_token 参数"),
|
||||||
|
CODE_41004(41004, "缺少 secret 参数"),
|
||||||
|
CODE_41005(41005, "缺少多媒体文件数据"),
|
||||||
|
CODE_41006(41006, "缺少 media_id 参数"),
|
||||||
|
CODE_41007(41007, "缺少子菜单数据"),
|
||||||
|
CODE_41008(41008, "缺少 oauth code"),
|
||||||
|
CODE_41009(41009, "缺少 openid"),
|
||||||
|
CODE_42001(42001, "access_token 超时,请检查 access_token 的有效期,请参考基础支持 - 获取 access_token 中,对 access_token 的详细机制说明"),
|
||||||
|
CODE_42002(42002, "refresh_token 超时"),
|
||||||
|
CODE_42003(42003, "oauth_code 超时"),
|
||||||
|
CODE_42007(42007, "用户修改微信密码, accesstoken 和 refreshtoken 失效,需要重新授权"),
|
||||||
|
CODE_43001(43001, "需要 GET 请求"),
|
||||||
|
CODE_43002(43002, "需要 POST 请求"),
|
||||||
|
CODE_43003(43003, "需要 HTTPS 请求"),
|
||||||
|
CODE_43004(43004, "需要接收者关注"),
|
||||||
|
CODE_43005(43005, "需要好友关系"),
|
||||||
|
CODE_43019(43019, "需要将接收者从黑名单中移除"),
|
||||||
|
CODE_44001(44001, "多媒体文件为空"),
|
||||||
|
CODE_44002(44002, "POST 的数据包为空"),
|
||||||
|
CODE_44003(44003, "图文消息内容为空"),
|
||||||
|
CODE_44004(44004, "文本消息内容为空"),
|
||||||
|
CODE_45001(45001, "多媒体文件大小超过限制"),
|
||||||
|
CODE_45002(45002, "消息内容超过限制"),
|
||||||
|
CODE_45003(45003, "标题字段超过限制"),
|
||||||
|
CODE_45004(45004, "描述字段超过限制"),
|
||||||
|
CODE_45005(45005, "链接字段超过限制"),
|
||||||
|
CODE_45006(45006, "图片链接字段超过限制"),
|
||||||
|
CODE_45007(45007, "语音播放时间超过限制"),
|
||||||
|
CODE_45008(45008, "图文消息超过限制"),
|
||||||
|
CODE_45009(45009, "接口调用超过限制"),
|
||||||
|
CODE_45010(45010, "创建菜单个数超过限制"),
|
||||||
|
CODE_45011(45011, "API 调用太频繁,请稍候再试"),
|
||||||
|
CODE_45015(45015, "回复时间超过限制"),
|
||||||
|
CODE_45016(45016, "系统分组,不允许修改"),
|
||||||
|
CODE_45017(45017, "分组名字过长"),
|
||||||
|
CODE_45018(45018, "分组数量超过上限"),
|
||||||
|
CODE_45047(45047, "客服接口下行条数超过上限"),
|
||||||
|
CODE_45159(45159, "非法的tag_id"),
|
||||||
|
CODE_45065(45065, "相同 clientmsgid 已存在群发记录,返回数据中带有已存在的群发任务的 msgid"),
|
||||||
|
CODE_45066(45066, "相同 clientmsgid 重试速度过快,请间隔1分钟重试"),
|
||||||
|
CODE_45067(45067, "clientmsgid 长度超过限制"),
|
||||||
|
CODE_46001(46001, "不存在媒体数据"),
|
||||||
|
CODE_46002(46002, "不存在的菜单版本"),
|
||||||
|
CODE_46003(46003, "不存在的菜单数据"),
|
||||||
|
CODE_46004(46004, "不存在的用户"),
|
||||||
|
CODE_47001(47001, "解析 JSON/XML 内容错误"),
|
||||||
|
CODE_48001(48001, "api 功能未授权,请确认公众号已获得该接口,可以在公众平台官网 - 开发者中心页中查看接口权限"),
|
||||||
|
CODE_48002(48002, "粉丝拒收消息(粉丝在公众号选项中,关闭了 “ 接收消息 ” )"),
|
||||||
|
CODE_48004(48004, "api 接口被封禁,请登录 mp.weixin.qq.com 查看详情"),
|
||||||
|
CODE_48005(48005, "api 禁止删除被自动回复和自定义菜单引用的素材"),
|
||||||
|
CODE_48006(48006, "api 禁止清零调用次数,因为清零次数达到上限"),
|
||||||
|
CODE_48008(48008, "没有该类型消息的发送权限"),
|
||||||
|
CODE_50001(50001, "用户未授权该 api"),
|
||||||
|
CODE_50002(50002, "用户受限,可能是违规后接口被封禁"),
|
||||||
|
CODE_50005(50005, "用户未关注公众号"),
|
||||||
|
CODE_61451(61451, "参数错误 (invalid parameter)"),
|
||||||
|
CODE_61452(61452, "无效客服账号 (invalid kf_account)"),
|
||||||
|
CODE_61453(61453, "客服帐号已存在 (kf_account exsited)"),
|
||||||
|
CODE_61454(61454, "客服帐号名长度超过限制 ( 仅允许 10 个英文字符,不包括 @ 及 @ 后的公众号的微信号 )(invalid kf_acount length)"),
|
||||||
|
CODE_61455(61455, "客服帐号名包含非法字符 ( 仅允许英文 + 数字 )(illegal character in kf_account)"),
|
||||||
|
CODE_61456(61456, "客服帐号个数超过限制 (10 个客服账号 )(kf_account count exceeded)"),
|
||||||
|
CODE_61457(61457, "无效头像文件类型 (invalid file type)"),
|
||||||
|
CODE_61450(61450, "系统错误 (system error)"),
|
||||||
|
CODE_61500(61500, "日期格式错误"),
|
||||||
|
CODE_65301(65301, "不存在此 menuid 对应的个性化菜单"),
|
||||||
|
CODE_65302(65302, "没有相应的用户"),
|
||||||
|
CODE_65303(65303, "没有默认菜单,不能创建个性化菜单"),
|
||||||
|
CODE_65304(65304, "MatchRule 信息为空"),
|
||||||
|
CODE_65305(65305, "个性化菜单数量受限"),
|
||||||
|
CODE_65306(65306, "不支持个性化菜单的帐号"),
|
||||||
|
CODE_65307(65307, "个性化菜单信息为空"),
|
||||||
|
CODE_65308(65308, "包含没有响应类型的 button"),
|
||||||
|
CODE_65309(65309, "个性化菜单开关处于关闭状态"),
|
||||||
|
CODE_65310(65310, "填写了省份或城市信息,国家信息不能为空"),
|
||||||
|
CODE_65311(65311, "填写了城市信息,省份信息不能为空"),
|
||||||
|
CODE_65312(65312, "不合法的国家信息"),
|
||||||
|
CODE_65313(65313, "不合法的省份信息"),
|
||||||
|
CODE_65314(65314, "不合法的城市信息"),
|
||||||
|
CODE_65316(65316, "该公众号的菜单设置了过多的域名外跳(最多跳转到 3 个域名的链接)"),
|
||||||
|
CODE_65317(65317, "不合法的 URL"),
|
||||||
|
CODE_9001001(9001001, "POST 数据参数不合法"),
|
||||||
|
CODE_9001002(9001002, "远端服务不可用"),
|
||||||
|
CODE_9001003(9001003, "Ticket 不合法"),
|
||||||
|
CODE_9001004(9001004, "获取摇周边用户信息失败"),
|
||||||
|
CODE_9001005(9001005, "获取商户信息失败"),
|
||||||
|
CODE_9001006(9001006, "获取 OpenID 失败"),
|
||||||
|
CODE_9001007(9001007, "上传文件缺失"),
|
||||||
|
CODE_9001008(9001008, "上传素材的文件类型不合法"),
|
||||||
|
CODE_9001009(9001009, "上传素材的文件尺寸不合法"),
|
||||||
|
CODE_9001010(9001010, "上传失败"),
|
||||||
|
CODE_9001020(9001020, "帐号不合法"),
|
||||||
|
CODE_9001021(9001021, "已有设备激活率低于 50% ,不能新增设备"),
|
||||||
|
CODE_9001022(9001022, "设备申请数不合法,必须为大于 0 的数字"),
|
||||||
|
CODE_9001023(9001023, "已存在审核中的设备 ID 申请"),
|
||||||
|
CODE_9001024(9001024, "一次查询设备 ID 数量不能超过 50"),
|
||||||
|
CODE_9001025(9001025, "设备 ID 不合法"),
|
||||||
|
CODE_9001026(9001026, "页面 ID 不合法"),
|
||||||
|
CODE_9001027(9001027, "页面参数不合法"),
|
||||||
|
CODE_9001028(9001028, "一次删除页面 ID 数量不能超过 10"),
|
||||||
|
CODE_9001029(9001029, "页面已应用在设备中,请先解除应用关系再删除"),
|
||||||
|
CODE_9001030(9001030, "一次查询页面 ID 数量不能超过 50"),
|
||||||
|
CODE_9001032(9001032, "保存设备与页面的绑定关系参数错误"),
|
||||||
|
CODE_9001033(9001033, "门店 ID 不合法"),
|
||||||
|
CODE_9001034(9001034, "设备备注信息过长"),
|
||||||
|
CODE_9001035(9001035, "设备申请参数不合法"),
|
||||||
|
CODE_9001036(9001036, "查询起始值 begin 不合法"),
|
||||||
|
CODE_45083(45083, "设置的 speed 参数不在0到4的范围内"),
|
||||||
|
CODE_45084(45084, "没有设置 speed 参数");
|
||||||
|
|
||||||
|
private final int code;
|
||||||
|
private final String msg;
|
||||||
|
|
||||||
|
WeChatErrorCode(int code, String msg) {
|
||||||
|
this.code = code;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
static final Map<Integer, String> valueMap = Maps.newHashMap();
|
||||||
|
|
||||||
|
static {
|
||||||
|
for (WeChatErrorCode value : WeChatErrorCode.values()) {
|
||||||
|
valueMap.put(value.code, value.msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过错误代码查找其中文含义..
|
||||||
|
*/
|
||||||
|
public static String findMsgByCode(int code) {
|
||||||
|
return valueMap.getOrDefault(code, null);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.ossez.wechat.common.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WeChat's Storage Category
|
||||||
|
*
|
||||||
|
* We provide implement for MEM(RAM) and REDIS
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public enum WeChatStorageCategory {
|
||||||
|
MEM, REDIS
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.ossez.wechat.common.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信卡券
|
||||||
|
*
|
||||||
|
* @author YuCheng
|
||||||
|
*/
|
||||||
|
public enum WxCardType {
|
||||||
|
MEMBER_CARD("MEMBER_CARD"),
|
||||||
|
GROUPON("GROUPON"),
|
||||||
|
CASH("CASH"),
|
||||||
|
DISCOUNT("DISCOUNT"),
|
||||||
|
GIFT("GIFT"),
|
||||||
|
GENERAL_COUPON("GENERAL_COUPON");
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
WxCardType(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
}
|
1464
common/src/main/java/com/ossez/wechat/common/enums/WxMpApiUrl.java
Normal file
1464
common/src/main/java/com/ossez/wechat/common/enums/WxMpApiUrl.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.enums;
|
package com.ossez.wechat.common.enums;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.ossez.wechat.common.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Daniel Qian
|
||||||
|
*/
|
||||||
|
public class DataStructureException extends WxErrorException {
|
||||||
|
private static final long serialVersionUID = -6357149550353160810L;
|
||||||
|
|
||||||
|
private final WxError error;
|
||||||
|
|
||||||
|
private static final int DEFAULT_ERROR_CODE = -99;
|
||||||
|
|
||||||
|
public DataStructureException(String message) {
|
||||||
|
this(WxError.builder().errorCode(DEFAULT_ERROR_CODE).errorMsg(message).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataStructureException(WxError error) {
|
||||||
|
super(error.toString());
|
||||||
|
this.error = error;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public WxError getError() {
|
||||||
|
return this.error;
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.error;
|
package com.ossez.wechat.common.exception;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
@ -1,11 +1,12 @@
|
|||||||
package me.chanjar.weixin.common.error;
|
package com.ossez.wechat.common.exception;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.enums.WeChatErrorCode;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import me.chanjar.weixin.common.enums.WxType;
|
import com.ossez.wechat.common.enums.WxType;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -23,7 +24,7 @@ import java.io.Serializable;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Builder
|
@Builder
|
||||||
public class WxError implements Serializable {
|
public class WxError implements Serializable {
|
||||||
private static final long serialVersionUID = 7869786563361406291L;
|
private static final long serialVersionUID = -2696724276555657960L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信错误代码.
|
* 微信错误代码.
|
||||||
@ -64,7 +65,7 @@ public class WxError implements Serializable {
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case MP: {
|
case MP: {
|
||||||
final String msg = WxMpErrorMsgEnum.findMsgByCode(wxError.getErrorCode());
|
final String msg = WeChatErrorCode.findMsgByCode(wxError.getErrorCode());
|
||||||
if (msg != null) {
|
if (msg != null) {
|
||||||
wxError.setErrorMsg(msg);
|
wxError.setErrorMsg(msg);
|
||||||
}
|
}
|
@ -1,4 +1,6 @@
|
|||||||
package me.chanjar.weixin.common.error;
|
package com.ossez.wechat.common.exception;
|
||||||
|
|
||||||
|
import static com.ossez.wechat.common.exception.WxError.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Daniel Qian
|
* @author Daniel Qian
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.error;
|
package com.ossez.wechat.common.exception;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.error;
|
package com.ossez.wechat.common.exception;
|
||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -1136,6 +1136,11 @@ public enum WxOpenErrorMsgEnum {
|
|||||||
*/
|
*/
|
||||||
CODE_40222(40222, "invalid request idc domain"),
|
CODE_40222(40222, "invalid request idc domain"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* empty media cover, please check the media
|
||||||
|
*/
|
||||||
|
CODE_40229(40229, "媒体封面为空,请添加媒体封面"),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缺少 access_token 参数 access_token missing
|
* 缺少 access_token 参数 access_token missing
|
||||||
*/
|
*/
|
@ -1,10 +1,10 @@
|
|||||||
package me.chanjar.weixin.common.error;
|
package com.ossez.wechat.common.exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WxJava专用的runtime exception.
|
* WxJava专用的runtime exception.
|
||||||
*
|
*
|
||||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||||
* @date 2020-09-26
|
* created on 2020-09-26
|
||||||
*/
|
*/
|
||||||
public class WxRuntimeException extends RuntimeException {
|
public class WxRuntimeException extends RuntimeException {
|
||||||
private static final long serialVersionUID = 4881698471192264412L;
|
private static final long serialVersionUID = 4881698471192264412L;
|
@ -0,0 +1,44 @@
|
|||||||
|
package com.ossez.wechat.common.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WeChatAccessToken Response Object
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class WeChatAccessToken {
|
||||||
|
|
||||||
|
|
||||||
|
@JsonProperty("access_token")
|
||||||
|
private String accessToken;
|
||||||
|
|
||||||
|
@JsonProperty("expires_in")
|
||||||
|
private int expiresIn = -1;
|
||||||
|
|
||||||
|
public static WeChatAccessToken fromJson(String json) {
|
||||||
|
return WxGsonBuilder.create().fromJson(json, WeChatAccessToken.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAccessToken() {
|
||||||
|
return accessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccessToken(String accessToken) {
|
||||||
|
this.accessToken = accessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getExpiresIn() {
|
||||||
|
return expiresIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpiresIn(int expiresIn) {
|
||||||
|
this.expiresIn = expiresIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.ossez.wechat.common.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WeChatAccessToken Response Object
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class WeChatApiDomainIp {
|
||||||
|
|
||||||
|
|
||||||
|
@JsonProperty("ip_list")
|
||||||
|
private List<String> ipList;
|
||||||
|
|
||||||
|
public List<String> getIpList() {
|
||||||
|
return ipList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIpList(List<String> ipList) {
|
||||||
|
this.ipList = ipList;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.ossez.wechat.common.model;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class WeChatHost implements Serializable {
|
||||||
|
private static final long serialVersionUID = -7648920647310280817L;
|
||||||
|
private String apiHost;
|
||||||
|
private String openHost;
|
||||||
|
private String mpHost;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,107 @@
|
|||||||
|
package com.ossez.wechat.common.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421140842
|
||||||
|
*
|
||||||
|
* @author Daniel Qian
|
||||||
|
*/
|
||||||
|
public class WeChatOAuth2AccessToken implements Serializable {
|
||||||
|
private static final long serialVersionUID = 5755678830089329526L;
|
||||||
|
|
||||||
|
@JsonProperty("access_token")
|
||||||
|
private String accessToken;
|
||||||
|
|
||||||
|
@JsonProperty("expires_in")
|
||||||
|
private int expiresIn = -1;
|
||||||
|
|
||||||
|
@JsonProperty("refresh_token")
|
||||||
|
private String refreshToken;
|
||||||
|
|
||||||
|
@JsonProperty("openid")
|
||||||
|
private String openId;
|
||||||
|
|
||||||
|
@JsonProperty("scope")
|
||||||
|
private String scope;
|
||||||
|
|
||||||
|
@JsonProperty("is_snapshotuser")
|
||||||
|
private Integer snapshotUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&announce_id=11513156443eZYea&version=&lang=zh_CN.
|
||||||
|
* 本接口在scope参数为snsapi_base时不再提供unionID字段。
|
||||||
|
*/
|
||||||
|
@SerializedName("unionid")
|
||||||
|
private String unionId;
|
||||||
|
|
||||||
|
public static WeChatOAuth2AccessToken fromJson(String json) {
|
||||||
|
return WxGsonBuilder.create().fromJson(json, WeChatOAuth2AccessToken.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return WxGsonBuilder.create().toJson(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAccessToken() {
|
||||||
|
return accessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccessToken(String accessToken) {
|
||||||
|
this.accessToken = accessToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getExpiresIn() {
|
||||||
|
return expiresIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpiresIn(int expiresIn) {
|
||||||
|
this.expiresIn = expiresIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRefreshToken() {
|
||||||
|
return refreshToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRefreshToken(String refreshToken) {
|
||||||
|
this.refreshToken = refreshToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOpenId() {
|
||||||
|
return openId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenId(String openId) {
|
||||||
|
this.openId = openId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getScope() {
|
||||||
|
return scope;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setScope(String scope) {
|
||||||
|
this.scope = scope;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSnapshotUser() {
|
||||||
|
return snapshotUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSnapshotUser(Integer snapshotUser) {
|
||||||
|
this.snapshotUser = snapshotUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUnionId() {
|
||||||
|
return unionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnionId(String unionId) {
|
||||||
|
this.unionId = unionId;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package com.ossez.wechat.common.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WeChatStatus Response Object
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class WeChatStatus {
|
||||||
|
|
||||||
|
@JsonProperty("errcode")
|
||||||
|
private int errCode = 0;
|
||||||
|
|
||||||
|
@JsonProperty("errmsg")
|
||||||
|
private String errMsg;
|
||||||
|
|
||||||
|
public int getErrCode() {
|
||||||
|
return errCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrCode(int errCode) {
|
||||||
|
this.errCode = errCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrMsg() {
|
||||||
|
return errMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrMsg(String errMsg) {
|
||||||
|
this.errMsg = errMsg;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,129 @@
|
|||||||
|
package com.ossez.wechat.common.model.entity;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* oauth2用户个人信息.
|
||||||
|
* <pre>
|
||||||
|
* {
|
||||||
|
* "openid":"OPENID",
|
||||||
|
* "nickname":"NICKNAME",
|
||||||
|
* "sex":1,
|
||||||
|
* "province":"PROVINCE",
|
||||||
|
* "city":"CITY",
|
||||||
|
* "country":"COUNTRY",
|
||||||
|
* "headimgurl": "https://thirdwx.qlogo.cn/mmopen/g3MonUZtNHkdmzicIlibx6iaFqAc56vxLSUfpb6n5WKSYVY0ChQKkiaJSgQ1dZuTOgvLLrhJbERQQ4eMsv84eavHiaiceqxibJxCfHe/0",
|
||||||
|
* "privilege":[
|
||||||
|
* "PRIVILEGE1",
|
||||||
|
* "PRIVILEGE2"
|
||||||
|
* ],
|
||||||
|
* "unionid": " o6_bmasdasdsad6_2sgVt7hMZOPfL"
|
||||||
|
*
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author YuCheng
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WeChatOAuth2UserInfo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 3181943506448954725L;
|
||||||
|
|
||||||
|
@JsonProperty("openid")
|
||||||
|
private String openid;
|
||||||
|
@JsonProperty("nickname")
|
||||||
|
private String nickname;
|
||||||
|
@JsonProperty("sex")
|
||||||
|
private Integer sex;
|
||||||
|
@JsonProperty("city")
|
||||||
|
private String city;
|
||||||
|
@JsonProperty("province")
|
||||||
|
private String province;
|
||||||
|
@JsonProperty("country")
|
||||||
|
private String country;
|
||||||
|
@JsonProperty("headimgurl")
|
||||||
|
private String headImgUrl;
|
||||||
|
|
||||||
|
@JsonProperty("unionid")
|
||||||
|
private String unionId;
|
||||||
|
|
||||||
|
@JsonProperty("privilege")
|
||||||
|
private String[] privileges;
|
||||||
|
|
||||||
|
public String getOpenid() {
|
||||||
|
return openid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenid(String openid) {
|
||||||
|
this.openid = openid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNickname() {
|
||||||
|
return nickname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNickname(String nickname) {
|
||||||
|
this.nickname = nickname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSex() {
|
||||||
|
return sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSex(Integer sex) {
|
||||||
|
this.sex = sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProvince() {
|
||||||
|
return province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvince(String province) {
|
||||||
|
this.province = province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCountry() {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCountry(String country) {
|
||||||
|
this.country = country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHeadImgUrl() {
|
||||||
|
return headImgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeadImgUrl(String headImgUrl) {
|
||||||
|
this.headImgUrl = headImgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUnionId() {
|
||||||
|
return unionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnionId(String unionId) {
|
||||||
|
this.unionId = unionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String[] getPrivileges() {
|
||||||
|
return privileges;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrivileges(String[] privileges) {
|
||||||
|
this.privileges = privileges;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.ossez.wechat.common.model.entity;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WeChatAccessToken Response Object
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public class WeChatResponseStatus {
|
||||||
|
@JsonProperty("errcode")
|
||||||
|
private Integer errorCode;
|
||||||
|
@JsonProperty("errmsg")
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
public Integer getErrorCode() {
|
||||||
|
return errorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrorCode(Integer errorCode) {
|
||||||
|
this.errorCode = errorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorMsg() {
|
||||||
|
return errorMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrorMsg(String errorMsg) {
|
||||||
|
this.errorMsg = errorMsg;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,104 @@
|
|||||||
|
package com.ossez.wechat.common.model.entity;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class WeChatUser {
|
||||||
|
|
||||||
|
@JsonProperty(value = "openid", required = true)
|
||||||
|
private String openId;
|
||||||
|
|
||||||
|
@JsonProperty(required = true)
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
private Integer sex;
|
||||||
|
|
||||||
|
private String language;
|
||||||
|
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
private String country;
|
||||||
|
|
||||||
|
@JsonProperty(value = "headimgurl")
|
||||||
|
private String headImgURL;
|
||||||
|
|
||||||
|
@JsonProperty(value = "unionid", required = true)
|
||||||
|
private String unionId;
|
||||||
|
|
||||||
|
public String getOpenId() {
|
||||||
|
return openId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenId(String openId) {
|
||||||
|
this.openId = openId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNickname() {
|
||||||
|
return nickname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNickname(String nickname) {
|
||||||
|
this.nickname = nickname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSex() {
|
||||||
|
return sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSex(Integer sex) {
|
||||||
|
this.sex = sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLanguage() {
|
||||||
|
return language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLanguage(String language) {
|
||||||
|
this.language = language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCity() {
|
||||||
|
return city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCity(String city) {
|
||||||
|
this.city = city;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProvince() {
|
||||||
|
return province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProvince(String province) {
|
||||||
|
this.province = province;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCountry() {
|
||||||
|
return country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCountry(String country) {
|
||||||
|
this.country = country;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHeadImgURL() {
|
||||||
|
return headImgURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeadImgURL(String headImgURL) {
|
||||||
|
this.headImgURL = headImgURL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUnionId() {
|
||||||
|
return unionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUnionId(String unionId) {
|
||||||
|
this.unionId = unionId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.ossez.wechat.common.model.entity.builder;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.model.entity.menu.MenuButton;
|
||||||
|
import com.ossez.wechat.common.model.req.MenuRequest;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MenuButtonBuilder {
|
||||||
|
private List<MenuButton> subButtonList;
|
||||||
|
private String type;
|
||||||
|
private String name;
|
||||||
|
private String key;
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
public MenuButtonBuilder setSubButtonList(List<MenuButton> subButtonList) {
|
||||||
|
this.subButtonList = subButtonList;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MenuButtonBuilder setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MenuButtonBuilder setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MenuButtonBuilder setKey(String key) {
|
||||||
|
this.key = key;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MenuButtonBuilder setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MenuButton createMenuButton() {
|
||||||
|
return new MenuButton(subButtonList, type, name, key, url);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.ossez.wechat.common.model.entity.menu;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.model.req.MenuRequest;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* menu button.
|
||||||
|
*
|
||||||
|
* @author Daniel Qian
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MenuButton implements Serializable {
|
||||||
|
private static final long serialVersionUID = -1070939403109776555L;
|
||||||
|
|
||||||
|
public MenuButton(List<MenuButton> subButtonList, String type, String name, String key, String url) {
|
||||||
|
this.subButtonList = subButtonList;
|
||||||
|
this.type = type;
|
||||||
|
this.name = name;
|
||||||
|
this.key = key;
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonProperty(value = "sub_button")
|
||||||
|
private List<MenuButton> subButtonList;
|
||||||
|
@JsonProperty("type")
|
||||||
|
private String type;
|
||||||
|
@JsonProperty("name")
|
||||||
|
private String name;
|
||||||
|
@JsonProperty("key")
|
||||||
|
private String key;
|
||||||
|
@JsonProperty("url")
|
||||||
|
private String url;
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.bean.menu;
|
package com.ossez.wechat.common.model.entity.menu;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
@ -7,8 +7,8 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单(公众号和企业号共用的).
|
* 菜单(公众号和企业号共用的).
|
||||||
@ -19,13 +19,16 @@ import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|||||||
public class WxMenu implements Serializable {
|
public class WxMenu implements Serializable {
|
||||||
private static final long serialVersionUID = -7083914585539687746L;
|
private static final long serialVersionUID = -7083914585539687746L;
|
||||||
|
|
||||||
private List<WxMenuButton> buttons = new ArrayList<>();
|
private List<MenuButton> buttons = new ArrayList<>();
|
||||||
|
|
||||||
private WxMenuRule matchRule;
|
private WxMenuRule matchRule;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 要用 http://mp.weixin.qq.com/wiki/16/ff9b7b85220e1396ffa16794a9d95adc.html 格式来反序列化
|
* 要用 http://mp.weixin.qq.com/wiki/16/ff9b7b85220e1396ffa16794a9d95adc.html 格式来反序列化
|
||||||
* 相比 http://mp.weixin.qq.com/wiki/13/43de8269be54a0a6f64413e4dfa94f39.html 的格式,外层多套了一个menu
|
* 相比 http://mp.weixin.qq.com/wiki/13/43de8269be54a0a6f64413e4dfa94f39.html 的格式,外层多套了一个menu
|
||||||
|
*
|
||||||
|
* @param json
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public static WxMenu fromJson(String json) {
|
public static WxMenu fromJson(String json) {
|
||||||
return WxGsonBuilder.create().fromJson(json, WxMenu.class);
|
return WxGsonBuilder.create().fromJson(json, WxMenu.class);
|
@ -1,10 +1,10 @@
|
|||||||
package me.chanjar.weixin.common.bean.menu;
|
package com.ossez.wechat.common.model.entity.menu;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* menu rule.
|
* menu rule.
|
@ -0,0 +1,128 @@
|
|||||||
|
package com.ossez.wechat.common.model.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CustomMessage
|
||||||
|
*
|
||||||
|
* @author YuCheng
|
||||||
|
*/
|
||||||
|
public class CustomMessage implements Serializable {
|
||||||
|
private static final long serialVersionUID = -9196732086954365246L;
|
||||||
|
|
||||||
|
@JsonProperty("touser")
|
||||||
|
private String toUser;
|
||||||
|
|
||||||
|
@JsonProperty("msgtype")
|
||||||
|
private String msgType;
|
||||||
|
|
||||||
|
@JsonProperty("text")
|
||||||
|
private KfText text;
|
||||||
|
|
||||||
|
@JsonProperty("image")
|
||||||
|
private KfImage image;
|
||||||
|
|
||||||
|
@JsonProperty("link")
|
||||||
|
private KfLink link;
|
||||||
|
|
||||||
|
@JsonProperty("miniprogrampage")
|
||||||
|
private KfMaPage maPage;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class KfText implements Serializable {
|
||||||
|
private static final long serialVersionUID = 151122958720941270L;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class KfImage implements Serializable {
|
||||||
|
private static final long serialVersionUID = -5409342945117300782L;
|
||||||
|
|
||||||
|
@SerializedName("media_id")
|
||||||
|
private String mediaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public static class KfLink implements Serializable {
|
||||||
|
private static final long serialVersionUID = -6728776817556127413L;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
private String description;
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@SerializedName("thumb_url")
|
||||||
|
private String thumbUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
public static class KfMaPage implements Serializable {
|
||||||
|
private static final long serialVersionUID = -5633492281871634466L;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@SerializedName("pagepath")
|
||||||
|
private String pagePath;
|
||||||
|
|
||||||
|
@SerializedName("thumb_media_id")
|
||||||
|
private String thumbMediaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToUser() {
|
||||||
|
return toUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToUser(String toUser) {
|
||||||
|
this.toUser = toUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsgType() {
|
||||||
|
return msgType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsgType(String msgType) {
|
||||||
|
this.msgType = msgType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public KfText getText() {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setText(KfText text) {
|
||||||
|
this.text = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
public KfImage getImage() {
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImage(KfImage image) {
|
||||||
|
this.image = image;
|
||||||
|
}
|
||||||
|
|
||||||
|
public KfLink getLink() {
|
||||||
|
return link;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLink(KfLink link) {
|
||||||
|
this.link = link;
|
||||||
|
}
|
||||||
|
|
||||||
|
public KfMaPage getMaPage() {
|
||||||
|
return maPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaPage(KfMaPage maPage) {
|
||||||
|
this.maPage = maPage;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.ossez.wechat.common.model.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CustomMessage
|
||||||
|
*
|
||||||
|
* @author YuCheng
|
||||||
|
*/
|
||||||
|
public class DataCubeRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = -9196732086954365246L;
|
||||||
|
|
||||||
|
@JsonProperty(value = "begin_date", required = true)
|
||||||
|
private String beginDate;
|
||||||
|
|
||||||
|
@JsonProperty(value = "end_date", required = true)
|
||||||
|
private String endDate;
|
||||||
|
|
||||||
|
public String getBeginDate() {
|
||||||
|
return beginDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBeginDate(String beginDate) {
|
||||||
|
this.beginDate = beginDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEndDate() {
|
||||||
|
return endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDate(String endDate) {
|
||||||
|
this.endDate = endDate;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.ossez.wechat.common.model.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.ossez.wechat.common.model.entity.menu.MenuButton;
|
||||||
|
import com.ossez.wechat.common.model.res.DataCubeArticle;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CustomMessage
|
||||||
|
*
|
||||||
|
* @author YuCheng
|
||||||
|
*/
|
||||||
|
public class MenuRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = -9196732086954365246L;
|
||||||
|
@JsonProperty(value = "button", required = true)
|
||||||
|
private List<MenuButton> buttonList;
|
||||||
|
|
||||||
|
|
||||||
|
public List<MenuButton> getButtonList() {
|
||||||
|
return buttonList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setButtonList(List<MenuButton> buttonList) {
|
||||||
|
this.buttonList = buttonList;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.ossez.wechat.common.model.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.ossez.wechat.common.util.json.WxGsonBuilder;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WeChatAccessToken Response Object
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public class NetworkCheck {
|
||||||
|
@JsonProperty("action")
|
||||||
|
private String action = "all";
|
||||||
|
@JsonProperty("check_operator")
|
||||||
|
private String checkOperator = StringUtils.upperCase("DEFAULT");
|
||||||
|
|
||||||
|
public String getAction() {
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAction(String action) {
|
||||||
|
this.action = action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCheckOperator() {
|
||||||
|
return checkOperator;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCheckOperator(String checkOperator) {
|
||||||
|
this.checkOperator = checkOperator;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.ossez.wechat.common.model.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WeChatAccessToken Response Object
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public class QueryQuota {
|
||||||
|
@JsonProperty("cgi_path")
|
||||||
|
private String cgiPath = "/cgi-bin/message/custom/send";
|
||||||
|
|
||||||
|
public String getCgiPath() {
|
||||||
|
return cgiPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCgiPath(String cgiPath) {
|
||||||
|
this.cgiPath = cgiPath;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,130 @@
|
|||||||
|
package com.ossez.wechat.common.model.res;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UserSummaryResponse Object
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public class DataCubeArticle {
|
||||||
|
@JsonProperty("list")
|
||||||
|
private List<ArticleData> articleDataList;
|
||||||
|
|
||||||
|
public static class ArticleData {
|
||||||
|
@JsonProperty("ref_date")
|
||||||
|
private String refDate;
|
||||||
|
|
||||||
|
@JsonProperty("msgid")
|
||||||
|
private String msgId;
|
||||||
|
@JsonProperty("title")
|
||||||
|
private String title;
|
||||||
|
@JsonProperty("int_page_read_user")
|
||||||
|
private Long intPageReadUser;
|
||||||
|
@JsonProperty("ori_page_read_user")
|
||||||
|
private Long oriPageReadUser;
|
||||||
|
@JsonProperty("ori_page_read_count")
|
||||||
|
private Long oriPageReadCount;
|
||||||
|
@JsonProperty("share_user")
|
||||||
|
private Long shareUser;
|
||||||
|
|
||||||
|
@JsonProperty("shareCount")
|
||||||
|
private Long shareCount;
|
||||||
|
|
||||||
|
@JsonProperty("add_to_fav_user")
|
||||||
|
private Long addToFavUser;
|
||||||
|
|
||||||
|
@JsonProperty("add_to_fav_count")
|
||||||
|
private Long addToFavCount;
|
||||||
|
|
||||||
|
public String getRefDate() {
|
||||||
|
return refDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRefDate(String refDate) {
|
||||||
|
this.refDate = refDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsgId() {
|
||||||
|
return msgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsgId(String msgId) {
|
||||||
|
this.msgId = msgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getIntPageReadUser() {
|
||||||
|
return intPageReadUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntPageReadUser(Long intPageReadUser) {
|
||||||
|
this.intPageReadUser = intPageReadUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOriPageReadUser() {
|
||||||
|
return oriPageReadUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriPageReadUser(Long oriPageReadUser) {
|
||||||
|
this.oriPageReadUser = oriPageReadUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOriPageReadCount() {
|
||||||
|
return oriPageReadCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOriPageReadCount(Long oriPageReadCount) {
|
||||||
|
this.oriPageReadCount = oriPageReadCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getShareUser() {
|
||||||
|
return shareUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShareUser(Long shareUser) {
|
||||||
|
this.shareUser = shareUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getShareCount() {
|
||||||
|
return shareCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShareCount(Long shareCount) {
|
||||||
|
this.shareCount = shareCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAddToFavUser() {
|
||||||
|
return addToFavUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddToFavUser(Long addToFavUser) {
|
||||||
|
this.addToFavUser = addToFavUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAddToFavCount() {
|
||||||
|
return addToFavCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddToFavCount(Long addToFavCount) {
|
||||||
|
this.addToFavCount = addToFavCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ArticleData> getArticleDataList() {
|
||||||
|
return articleDataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArticleDataList(List<ArticleData> articleDataList) {
|
||||||
|
this.articleDataList = articleDataList;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,78 @@
|
|||||||
|
package com.ossez.wechat.common.model.res;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* UserSummaryResponse Object
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public class DataCubeUser {
|
||||||
|
@JsonProperty("list")
|
||||||
|
private List<UserData> userDataList;
|
||||||
|
|
||||||
|
public static class UserData {
|
||||||
|
@JsonProperty("ref_date")
|
||||||
|
private String refDate;
|
||||||
|
@JsonProperty("user_source")
|
||||||
|
private Long userSource;
|
||||||
|
|
||||||
|
@JsonProperty("new_user")
|
||||||
|
private Long newUser;
|
||||||
|
@JsonProperty("cancel_user")
|
||||||
|
private Long cancelUser;
|
||||||
|
|
||||||
|
@JsonProperty("cumulate_user")
|
||||||
|
private Long cumulateUser;
|
||||||
|
|
||||||
|
public String getRefDate() {
|
||||||
|
return refDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRefDate(String refDate) {
|
||||||
|
this.refDate = refDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUserSource() {
|
||||||
|
return userSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserSource(Long userSource) {
|
||||||
|
this.userSource = userSource;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getNewUser() {
|
||||||
|
return newUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNewUser(Long newUser) {
|
||||||
|
this.newUser = newUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCancelUser() {
|
||||||
|
return cancelUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCancelUser(Long cancelUser) {
|
||||||
|
this.cancelUser = cancelUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCumulateUser() {
|
||||||
|
return cumulateUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCumulateUser(Long cumulateUser) {
|
||||||
|
this.cumulateUser = cumulateUser;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<UserData> getUserDataList() {
|
||||||
|
return userDataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserDataList(List<UserData> userDataList) {
|
||||||
|
this.userDataList = userDataList;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.ossez.wechat.common.model.res;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.ossez.wechat.common.api.WxMessageInMemoryDuplicateCheckerSingleton;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WeChatAccessToken Response Object
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public class NetworkCheckResponse {
|
||||||
|
@JsonProperty("dns")
|
||||||
|
private String dns;
|
||||||
|
@JsonProperty("ping")
|
||||||
|
private Ping ping;
|
||||||
|
|
||||||
|
private static class dns {
|
||||||
|
@JsonProperty("ip")
|
||||||
|
private String ip;
|
||||||
|
@JsonProperty("real_operator")
|
||||||
|
private String realOperator;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class Ping {
|
||||||
|
@JsonProperty("ip")
|
||||||
|
private String ip;
|
||||||
|
@JsonProperty("from_operator")
|
||||||
|
private String fromOperator;
|
||||||
|
@JsonProperty("package_loss")
|
||||||
|
private String packageLoss;
|
||||||
|
@JsonProperty("time")
|
||||||
|
private String time;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.ossez.wechat.common.model.res;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WeChatAccessToken Response Object
|
||||||
|
*
|
||||||
|
* @author YuCheng Hu
|
||||||
|
*/
|
||||||
|
public class QueryQuotaResponse {
|
||||||
|
@JsonProperty("errcode")
|
||||||
|
private Integer errorCode;
|
||||||
|
@JsonProperty("errmsg")
|
||||||
|
private String errorMsg;
|
||||||
|
@JsonProperty("quota")
|
||||||
|
private Quota quota;
|
||||||
|
|
||||||
|
private static class Quota {
|
||||||
|
@JsonProperty("daily_limit")
|
||||||
|
private String dailyLimit;
|
||||||
|
@JsonProperty("used")
|
||||||
|
private String used;
|
||||||
|
@JsonProperty("remain")
|
||||||
|
private String remain;
|
||||||
|
|
||||||
|
public String getDailyLimit() {
|
||||||
|
return dailyLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDailyLimit(String dailyLimit) {
|
||||||
|
this.dailyLimit = dailyLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsed() {
|
||||||
|
return used;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsed(String used) {
|
||||||
|
this.used = used;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemain() {
|
||||||
|
return remain;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemain(String remain) {
|
||||||
|
this.remain = remain;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getErrorCode() {
|
||||||
|
return errorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrorCode(Integer errorCode) {
|
||||||
|
this.errorCode = errorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorMsg() {
|
||||||
|
return errorMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setErrorMsg(String errorMsg) {
|
||||||
|
this.errorMsg = errorMsg;
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.redis;
|
package com.ossez.wechat.common.redis;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
@ -1,8 +1,8 @@
|
|||||||
package me.chanjar.weixin.common.redis;
|
package com.ossez.wechat.common.redis;
|
||||||
|
|
||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import me.chanjar.weixin.common.util.locks.RedisTemplateSimpleDistributedLock;
|
import com.ossez.wechat.common.util.locks.RedisTemplateSimpleDistributedLock;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.redis;
|
package com.ossez.wechat.common.redis;
|
||||||
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
@ -1,4 +1,4 @@
|
|||||||
package me.chanjar.weixin.common.redis;
|
package com.ossez.wechat.common.redis;
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.locks.Lock;
|
import java.util.concurrent.locks.Lock;
|
||||||
@ -8,6 +8,7 @@ import java.util.concurrent.locks.Lock;
|
|||||||
* <p>
|
* <p>
|
||||||
* 该接口不承诺稳定, 外部实现请继承{@link BaseWxRedisOps}
|
* 该接口不承诺稳定, 外部实现请继承{@link BaseWxRedisOps}
|
||||||
*
|
*
|
||||||
|
* @author Mario Luo
|
||||||
* @see BaseWxRedisOps 实现需要继承该类
|
* @see BaseWxRedisOps 实现需要继承该类
|
||||||
* @see JedisWxRedisOps jedis实现
|
* @see JedisWxRedisOps jedis实现
|
||||||
* @see RedissonWxRedisOps redisson实现
|
* @see RedissonWxRedisOps redisson实现
|
@ -1,10 +1,10 @@
|
|||||||
package me.chanjar.weixin.common.requestexecuter.ocr;
|
package com.ossez.wechat.common.requestexecuter.ocr;
|
||||||
|
|
||||||
import me.chanjar.weixin.common.enums.WxType;
|
import com.ossez.wechat.common.enums.WxType;
|
||||||
import me.chanjar.weixin.common.error.WxError;
|
import com.ossez.wechat.common.exception.WxError;
|
||||||
import me.chanjar.weixin.common.error.WxErrorException;
|
import com.ossez.wechat.common.exception.WxErrorException;
|
||||||
import me.chanjar.weixin.common.util.http.RequestHttp;
|
import com.ossez.wechat.common.util.http.RequestHttp;
|
||||||
import me.chanjar.weixin.common.util.http.apache.Utf8ResponseHandler;
|
import com.ossez.wechat.common.util.http.apache.Utf8ResponseHandler;
|
||||||
import org.apache.http.HttpEntity;
|
import org.apache.http.HttpEntity;
|
||||||
import org.apache.http.HttpHost;
|
import org.apache.http.HttpHost;
|
||||||
import org.apache.http.client.config.RequestConfig;
|
import org.apache.http.client.config.RequestConfig;
|
||||||
@ -21,7 +21,7 @@ import java.io.IOException;
|
|||||||
* .
|
* .
|
||||||
*
|
*
|
||||||
* @author : zhayueran
|
* @author : zhayueran
|
||||||
* @date 2019/6/27 14:06
|
* created on 2019/6/27 14:06
|
||||||
*/
|
*/
|
||||||
public class OcrDiscernApacheHttpRequestExecutor extends OcrDiscernRequestExecutor<CloseableHttpClient, HttpHost> {
|
public class OcrDiscernApacheHttpRequestExecutor extends OcrDiscernRequestExecutor<CloseableHttpClient, HttpHost> {
|
||||||
public OcrDiscernApacheHttpRequestExecutor(RequestHttp requestHttp) {
|
public OcrDiscernApacheHttpRequestExecutor(RequestHttp requestHttp) {
|
@ -1,10 +1,10 @@
|
|||||||
package me.chanjar.weixin.common.requestexecuter.ocr;
|
package com.ossez.wechat.common.requestexecuter.ocr;
|
||||||
|
|
||||||
import me.chanjar.weixin.common.enums.WxType;
|
import com.ossez.wechat.common.enums.WxType;
|
||||||
import me.chanjar.weixin.common.error.WxErrorException;
|
import com.ossez.wechat.common.exception.WxErrorException;
|
||||||
import me.chanjar.weixin.common.util.http.RequestExecutor;
|
import com.ossez.wechat.common.util.http.RequestExecutor;
|
||||||
import me.chanjar.weixin.common.util.http.RequestHttp;
|
import com.ossez.wechat.common.util.http.RequestHttp;
|
||||||
import me.chanjar.weixin.common.util.http.ResponseHandler;
|
import com.ossez.wechat.common.util.http.ResponseHandler;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -13,7 +13,7 @@ import java.io.IOException;
|
|||||||
* .
|
* .
|
||||||
*
|
*
|
||||||
* @author zhayueran
|
* @author zhayueran
|
||||||
* @date 2019/6/27 15:06
|
* created on 2019/6/27 15:06
|
||||||
*/
|
*/
|
||||||
public abstract class OcrDiscernRequestExecutor<H, P> implements RequestExecutor<String, File> {
|
public abstract class OcrDiscernRequestExecutor<H, P> implements RequestExecutor<String, File> {
|
||||||
protected RequestHttp<H, P> requestHttp;
|
protected RequestHttp<H, P> requestHttp;
|
@ -1,9 +1,9 @@
|
|||||||
package me.chanjar.weixin.common.service;
|
package com.ossez.wechat.common.service;
|
||||||
|
|
||||||
import me.chanjar.weixin.common.error.WxErrorException;
|
import com.ossez.wechat.common.exception.WxErrorException;
|
||||||
import me.chanjar.weixin.common.bean.imgproc.WxImgProcAiCropResult;
|
import com.ossez.wechat.common.bean.imgproc.WxImgProcAiCropResult;
|
||||||
import me.chanjar.weixin.common.bean.imgproc.WxImgProcQrCodeResult;
|
import com.ossez.wechat.common.bean.imgproc.WxImgProcQrCodeResult;
|
||||||
import me.chanjar.weixin.common.bean.imgproc.WxImgProcSuperResolutionResult;
|
import com.ossez.wechat.common.bean.imgproc.WxImgProcSuperResolutionResult;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
@ -1,14 +1,14 @@
|
|||||||
package me.chanjar.weixin.common.service;
|
package com.ossez.wechat.common.service;
|
||||||
|
|
||||||
import me.chanjar.weixin.common.bean.WxOAuth2UserInfo;
|
import com.ossez.wechat.common.model.entity.WeChatOAuth2UserInfo;
|
||||||
import me.chanjar.weixin.common.bean.oauth2.WxOAuth2AccessToken;
|
import com.ossez.wechat.common.model.WeChatOAuth2AccessToken;
|
||||||
import me.chanjar.weixin.common.error.WxErrorException;
|
import com.ossez.wechat.common.exception.WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* oauth2 相关接口.
|
* oauth2 相关接口.
|
||||||
*
|
*
|
||||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||||
* @date 2020-08-08
|
* created on 2020-08-08
|
||||||
*/
|
*/
|
||||||
public interface WxOAuth2Service {
|
public interface WxOAuth2Service {
|
||||||
/**
|
/**
|
||||||
@ -34,7 +34,7 @@ public interface WxOAuth2Service {
|
|||||||
* @return token对象
|
* @return token对象
|
||||||
* @throws WxErrorException .
|
* @throws WxErrorException .
|
||||||
*/
|
*/
|
||||||
WxOAuth2AccessToken getAccessToken(String code) throws WxErrorException;
|
WeChatOAuth2AccessToken getAccessToken(String code) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用code换取oauth2的access token.
|
* 用code换取oauth2的access token.
|
||||||
@ -45,7 +45,7 @@ public interface WxOAuth2Service {
|
|||||||
* @return token对象
|
* @return token对象
|
||||||
* @throws WxErrorException .
|
* @throws WxErrorException .
|
||||||
*/
|
*/
|
||||||
WxOAuth2AccessToken getAccessToken(String appId, String appSecret, String code) throws WxErrorException;
|
WeChatOAuth2AccessToken getAccessToken(String appId, String appSecret, String code) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -56,7 +56,7 @@ public interface WxOAuth2Service {
|
|||||||
* @return 新的token对象
|
* @return 新的token对象
|
||||||
* @throws WxErrorException .
|
* @throws WxErrorException .
|
||||||
*/
|
*/
|
||||||
WxOAuth2AccessToken refreshAccessToken(String refreshToken) throws WxErrorException;
|
WeChatOAuth2AccessToken refreshAccessToken(String refreshToken) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -68,7 +68,7 @@ public interface WxOAuth2Service {
|
|||||||
* @return 用户对象
|
* @return 用户对象
|
||||||
* @throws WxErrorException .
|
* @throws WxErrorException .
|
||||||
*/
|
*/
|
||||||
WxOAuth2UserInfo getUserInfo(WxOAuth2AccessToken oAuth2AccessToken, String lang) throws WxErrorException;
|
WeChatOAuth2UserInfo getUserInfo(WeChatOAuth2AccessToken oAuth2AccessToken, String lang) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -78,6 +78,6 @@ public interface WxOAuth2Service {
|
|||||||
* @param oAuth2AccessToken token对象
|
* @param oAuth2AccessToken token对象
|
||||||
* @return 是否有效
|
* @return 是否有效
|
||||||
*/
|
*/
|
||||||
boolean validateAccessToken(WxOAuth2AccessToken oAuth2AccessToken);
|
boolean validateAccessToken(WeChatOAuth2AccessToken oAuth2AccessToken);
|
||||||
|
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user