# binarywang/wxjava architecture

> Architecture diagram of the GitHub repository binarywang/wxjava, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/binarywang/wxjava
- Repository: https://github.com/binarywang/wxjava

## Overview

WxJava is a server-side Java SDK for integrating with WeChat APIs, organized into domain modules and framework-specific integration plugins. The typical workflow is an application choosing a domain service, invoking its API with request data or an authorization code, and receiving a typed result or exception; API calls communicate with WeChat. The graph preserves the README’s major capabilities and the sampled OAuth, card, payment, mini-program, and message-routing surfaces. Some module capabilities are documented but their implementations were not sampled, so those links remain high-level.

Main entry points: [`weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java`](https://github.com/binarywang/wxjava/blob/develop/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java) (Mini Program), [`weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxOAuth2Service.java`](https://github.com/binarywang/wxjava/blob/develop/weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxOAuth2Service.java) (Common OAuth), [`weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpCardService.java`](https://github.com/binarywang/wxjava/blob/develop/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpCardService.java) (Official Account), [`weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOAuth2Service.java`](https://github.com/binarywang/wxjava/blob/develop/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOAuth2Service.java) (WeCom)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core SDK APIs"]
  node_commonoauth["Common OAuth"]
  node_cloudresult["Cloud Query Result"]
end

subgraph group_domains["WeChat Domains"]
  node_mp["Official Account"]
  node_miniapp["Mini Program<br/>[WxMaService.java]"]
  node_cp["WeCom"]
  node_open["Open Platform"]
  node_pay["WeChat Pay<br/>[WxPayService.java]"]
  node_channel["Video Channel"]
  node_store["WeChat Store"]
  node_tp_oauth["Provider OAuth"]
  node_auth_icp["Auth And Filing"]
end

subgraph group_integration["Framework Integration"]
  node_solon["Solon Plugins"]
  node_spring["Spring Starters"]
end

subgraph group_external["External Services"]
  node_wechat{{"WeChat APIs"}}
end

node_application(("Application"))

node_application -->|"calls"| node_commonoauth
node_application -->|"calls"| node_mp
node_application -->|"calls"| node_miniapp
node_application -->|"calls"| node_cp
node_application -->|"calls"| node_open
node_application -->|"calls"| node_pay
node_application -->|"calls"| node_channel
node_application -->|"calls"| node_store
node_application -->|"calls"| node_tp_oauth
node_application -->|"calls"| node_auth_icp
node_commonoauth -->|"requests OAuth"| node_wechat
node_mp -->|"manages cards"| node_wechat
node_miniapp -->|"calls APIs"| node_wechat
node_miniapp -->|"returns data"| node_cloudresult
node_cp -->|"requests identity"| node_wechat
node_tp_oauth -->|"builds authorization"| node_wechat
node_open -->|"submits certification"| node_wechat
node_auth_icp -->|"submits filing"| node_wechat
node_pay -->|"manages payments"| node_wechat
node_channel -->|"routes callbacks"| node_wechat
node_store -->|"routes callbacks"| node_wechat
node_solon -.->|"provides integration"| node_application
node_spring -.->|"provides integration"| node_application

click node_commonoauth "https://github.com/binarywang/wxjava/blob/develop/weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxOAuth2Service.java"
click node_mp "https://github.com/binarywang/wxjava/blob/develop/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpCardService.java"
click node_miniapp "https://github.com/binarywang/wxjava/blob/develop/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java"
click node_cp "https://github.com/binarywang/wxjava/blob/develop/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOAuth2Service.java"
click node_open "https://github.com/binarywang/wxjava/blob/develop/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaAuthService.java"
click node_pay "https://github.com/binarywang/wxjava/blob/develop/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java"
click node_channel "https://github.com/binarywang/wxjava/blob/develop/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java"
click node_store "https://github.com/binarywang/wxjava/blob/develop/weixin-java-store/src/main/java/com/binarywang/wxjava/store/api/BaseWxStoreMessageService.java"
click node_cloudresult "https://github.com/binarywang/wxjava/blob/develop/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/cloud/WxCloudDatabaseQueryResult.java"
click node_tp_oauth "https://github.com/binarywang/wxjava/blob/develop/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpOAuth2Service.java"
click node_auth_icp "https://github.com/binarywang/wxjava/blob/develop/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaAuthAndIcpService.java"
click node_solon "https://github.com/binarywang/wxjava/blob/develop/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/config/WxMaServiceAutoConfiguration.java"
click node_spring "https://github.com/binarywang/wxjava/blob/develop/spring-boot-starters/wx-java-channel-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/config/WxChannelAutoConfiguration.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_commonoauth,node_cloudresult toneBlue
class node_mp,node_miniapp,node_cp,node_open,node_pay,node_channel,node_store,node_tp_oauth,node_auth_icp toneAmber
class node_solon,node_spring toneMint
class node_wechat toneRose
class node_application toneIndigo
```

## Components

### Core SDK APIs

- [Common OAuth](https://github.com/binarywang/wxjava/blob/develop/weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxOAuth2Service.java): `weixin-java-common/src/main/java/me/chanjar/weixin/common/service/WxOAuth2Service.java`
- [Cloud Query Result](https://github.com/binarywang/wxjava/blob/develop/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/cloud/WxCloudDatabaseQueryResult.java): `weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/cloud/WxCloudDatabaseQueryResult.java`

### WeChat Domains

- [Official Account](https://github.com/binarywang/wxjava/blob/develop/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpCardService.java): `weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpCardService.java`
- [Mini Program](https://github.com/binarywang/wxjava/blob/develop/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java): `weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/WxMaService.java`
- [WeCom](https://github.com/binarywang/wxjava/blob/develop/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOAuth2Service.java): `weixin-java-cp/src/main/java/me/chanjar/weixin/cp/api/WxCpOAuth2Service.java`
- [Open Platform](https://github.com/binarywang/wxjava/blob/develop/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaAuthService.java): `weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaAuthService.java`
- [WeChat Pay](https://github.com/binarywang/wxjava/blob/develop/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java): `weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/WxPayService.java`
- [Video Channel](https://github.com/binarywang/wxjava/blob/develop/weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java): `weixin-java-channel/src/main/java/me/chanjar/weixin/channel/api/BaseWxChannelMessageService.java`
- [WeChat Store](https://github.com/binarywang/wxjava/blob/develop/weixin-java-store/src/main/java/com/binarywang/wxjava/store/api/BaseWxStoreMessageService.java): `weixin-java-store/src/main/java/com/binarywang/wxjava/store/api/BaseWxStoreMessageService.java`
- [Provider OAuth](https://github.com/binarywang/wxjava/blob/develop/weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpOAuth2Service.java): `weixin-java-cp/src/main/java/me/chanjar/weixin/cp/tp/service/WxCpTpOAuth2Service.java`
- [Auth And Filing](https://github.com/binarywang/wxjava/blob/develop/weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaAuthAndIcpService.java): `weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenMaAuthAndIcpService.java`

### Framework Integration

- [Solon Plugins](https://github.com/binarywang/wxjava/blob/develop/solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/config/WxMaServiceAutoConfiguration.java): `solon-plugins/wx-java-miniapp-solon-plugin/src/main/java/com/binarywang/solon/wxjava/miniapp/config/WxMaServiceAutoConfiguration.java`
- [Spring Starters](https://github.com/binarywang/wxjava/blob/develop/spring-boot-starters/wx-java-channel-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/config/WxChannelAutoConfiguration.java): `spring-boot-starters/wx-java-channel-spring-boot-starter/src/main/java/com/binarywang/spring/starter/wxjava/channel/config/WxChannelAutoConfiguration.java`

### External Services

- **WeChat APIs**

### Other components

- **Application**

## Connections

- Application → Common OAuth: calls
- Application → Official Account: calls
- Application → Mini Program: calls
- Application → WeCom: calls
- Application → Open Platform: calls
- Application → WeChat Pay: calls
- Application → Video Channel: calls
- Application → WeChat Store: calls
- Application → Provider OAuth: calls
- Application → Auth And Filing: calls
- Common OAuth → WeChat APIs: requests OAuth
- Official Account → WeChat APIs: manages cards
- Mini Program → WeChat APIs: calls APIs
- Mini Program → Cloud Query Result: returns data
- WeCom → WeChat APIs: requests identity
- Provider OAuth → WeChat APIs: builds authorization
- Open Platform → WeChat APIs: submits certification
- Auth And Filing → WeChat APIs: submits filing
- WeChat Pay → WeChat APIs: manages payments
- Video Channel → WeChat APIs: routes callbacks
- WeChat Store → WeChat APIs: routes callbacks
- Solon Plugins → Application: provides integration
- Spring Starters → Application: provides integration
