The system provides comprehensive WeChat Official Account integration and management capabilities, supporting multi-account binding, message receiving/replying, material management, menu management, template messages, WeChat Pay, and more.
- User Guide17
- Directions for use14
- Sea-ORM14
- Digging Deeper11
- Basics8
- Architecture Concepts4
- API2
- Security2
- Help1
- News1
- Sponsor1
- tutorial1
Cache
The caching system provides a unified interface supporting both Redis and in-memory backends.
Quick Start
1) Initialize at Startup
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Load APPCOFIG first
// Initialize global cache
CacheManager::init().await?;
Ok(())
}
Real-time push for scenarios like notifications, data updates, and monitoring dashboards.
Tech Comparison
| Feature | SSE | WebSocket |
|---|---|---|
| Direction | Server → Client only | Bidirectional |
| Protocol | HTTP (simple) | WS (upgrade) |
| Auto-reconnect | Built-in (EventSource) | Manual |
| Binary | Text only | Text + Binary |
Current implementation only supports local file storage: Base64 image saving and Multipart file upload, with delete functionality. Does not cover S3/OSS or Nginx configuration.
- Directory partitioned by month: YYYY-MM
- File naming: day-dd + Global ID (GID) + extension
- Path configuration:
- Static image directory:
APPCOFIG.server.static_dir - General upload directory:
APPCOFIG.server.upload_dir(default: data/upload) - Return URL prefix:
APPCOFIG.server.domainname
- Static image directory:
Provides an "online configuration + distributed safe execution" scheduled task system. Supports:
- Cron expressions, start/stop, immediate execution
- Distributed locks for single execution in multi-node deployment
- Execution logs, retries, timeout, misfire strategies, timezone
- Two handler types: HTTP requests, Rust functions (registry)
The system provides comprehensive email sending and management capabilities, supporting real SMTP delivery and Stub test mode, with integrated async queues, database template management, and delivery logging.
Provides a complete "forgot password → email link → set new password" flow, balancing security and usability.
Goals:
- Don't reveal account existence (uniform response)
- Single-use, short expiration (default: 30 minutes)
- Rate limiting and audit logging
- Invalidate historical sessions/tokens after successful reset
This section focuses on "time handling in practice" for the Rust backend in enterprise systems, based on chrono/chrono-tz:
- Type selection: UTC/Local/Naive (timezone-naive)
- Parsing & formatting: RFC3339/ISO8601, timestamps (seconds/milliseconds)
- Timezone conversion & DST (Daylight Saving Time) considerations
- Sea-ORM / database field mapping
- Task scheduling, timeouts, TTL expiration
- Best practices for JSON serialization
Queues decouple time-consuming tasks from the request pipeline, processing them asynchronously and reliably. Use cases include: sending emails/notifications, generating reports, exporting files, third-party callbacks. The same interface can dispatch "messages" to the queue, where multiple background workers consume concurrently. Failed tasks are automatically retried; those exceeding the threshold enter the failure queue.
Architecture & Workflow
flowchart LR
A[DB: SysJobModel] -->|update_job| B[Register periodic_worker]
B -->|cron trigger| C[Worker.perform execution]
C --> D[SysJobLogModel log]
E[Manual execute_job] --> C
F[enqueue_async] --> G[Processor concurrent consumption]
G --> C