How zjutjh/wejh-go works
Project Type Analysis
This is a backend service application written in Go, specifically for the "WeJH" (微精弘) system. It follows a typical MVC-like architecture with additional service layers.
Main Components
A. Core Layers (Vertical Layers):
• Controllers Layer (app/controllers/*)
• Services Layer (app/services/*)
• Models Layer (app/models/*)
• Middleware Layer (app/midwares/*)
B. Infrastructure Components (Horizontal Layers):
• Configuration Management (config/*)
• Database Layer
• Redis Cache
• Session Management
• WeChat Integration
• API Interfaces
┌─ External Clients ─────────────────────────────┐
• (WeChat, API Consumers) │
• ┬───────────────────────┘
• ↓
┌─ Router Layer ────────────────────────────────┐
• (config/router/*) │
• ┬───────────────────────┘
• ↓
┌─ Middleware Layer ────────────────────────────┐
• Authentication - Error Handling │
• Admin Checks - Init Checks │
• ┬───────────────────────┘
• ↓
┌─ Controllers Layer ───────────────────────────┐
• Admin Controllers - User Controllers │
• System Controllers - Function Controllers │
• ┬───────────────────────┘
• ↓
┌─ Services Layer ──────────────────────────────┐
• User Services - Admin Services │
• Theme Services - School Bus Services │
• YXY Services - Funnel Services │
• ┬───────────────────────┘
• ↓
┌─ Models Layer ────────────────────────────────┐
• (Database Entities and Business Objects) │
• ┬───────────────────────┘
• ↓
┌─ Infrastructure Layer ────────────────────────┐
• ┌─────────┐ ┌──────┐ ┌───────┐ ┌──────────┐ │
• Database │ │Redis │ │Session│ │WeChat API│ │
• ┘ └──────┘ └───────┘ └──────────┘ │
• ┘
Important Details
a. Controller Groups:
• Admin Controllers
• User Controllers
• System Controllers
• Functional Controllers (canteen, library, etc.)
b. Service Categories:
• User Services
• Admin Services
• Functional Services (school bus, supplies, etc.)
• Integration Services (YXY, funnel)
c. Infrastructure Components:
• Configuration Management
• Database Connections
• Redis Cache
• Session Management
• WeChat Integration