$ account binarywang
WxJava is a comprehensive Java SDK for the WeChat ecosystem, providing client libraries for Official Accounts (MP), Mini Programs (MiniApp), Enterprise WeChat (CP), WeChat Pay, Open Platform, Video Channels, and more. It is designed as a multi-module library to be embedded in Java applications, with first-class support for Spring Boot and Solon frameworks via auto-configuration starters. The SDK abstracts HTTP client backends (Apache, OkHttp, Jodd, HttpComponents), provides Redis-based config storage for distributed token management, and implements multi-tenant patterns for managing multiple WeChat accounts. It handles the full lifecycle of WeChat API integration: request signing, serialization (Gson/Jackson/XStream), message routing, and callback verification. The codebase is large and well-structured, though it shows signs of duplication across modules and mixed serialization frameworks, reflecting organic growth over time.
This repository is a Spring Boot-based demo application for integrating with WeChat Pay APIs. It provides REST endpoints demonstrating various WeChat Pay functionalities including payment processing, refunds, enterprise payments, red packet distribution, and coupon handling for both V2 and V3 versions of the WeChat Pay API. The application uses the WxJava library to handle the actual communication with WeChat's servers. The architecture follows standard Spring Boot MVC patterns with controllers handling HTTP requests, delegating to the WxPayService from WxJava for business logic, and returning formatted responses. Configuration is managed through application.yml using Spring Boot's @ConfigurationProperties, with a dedicated configuration class setting up the WxJava service as a Spring bean. The project includes Swagger for API documentation and basic error handling via custom error pages. While the code demonstrates solid enterprise Java practices with proper dependency injection, configuration separation, and API documentation, it is primarily intended as a learning tool rather than a production-ready library. The controllers contain TODO comments indicating areas where users need to implement their own business logic, and some dependencies (particularly Springfox for Swagger) are outdated relative to current Spring Boot versions.
This repository demonstrates a WeChat public account (official account) backend implementation using Spring MVC and the WeChat Java SDK. It handles incoming messages from WeChat servers, verifies request authenticity, routes messages to appropriate handlers based on type, and generates responses. The application follows a layered architecture with controllers for HTTP endpoints, a service layer that encapsulates WeChat SDK interactions, and specialized handlers for different message types (text, location, menu events, subscribe/unsubscribe, etc.). The message handling mechanism uses a router pattern where different message types are directed to specific handler implementations. Each handler extends an abstract base class that provides common utilities like JSON parsing and logging. The builder pattern is employed for constructing response messages, with separate builders for different message types (text, image, etc.). The application also includes endpoints for managing custom menus via the WeChat API. While the codebase shows good separation of concerns and proper use of design patterns, some handlers contain TODO comments indicating areas for further implementation. The demo nature of the project means it focuses on illustrating core concepts rather than providing a fully-featured production application. Configuration is externalized via Spring XML and Java config, with WeChat credentials stored in properties files.