$ show yangzongzhuan/RuoYi
RuoYi is a production‑ready Java rapid‑development framework for building enterprise back‑office management systems (CMS, CRM, OA, etc.). It is a monolithic Spring Boot application using Apache Shiro for authentication/authorization, MyBatis for persistence, Thymeleaf for server‑side rendering, and a jQuery/Bootstrap frontend with numerous third‑party plugins. The system provides a complete RBAC module (user, role, department, menu management), dictionary and configuration management, operation and login auditing, online user monitoring, Quartz‑based scheduled tasks, and a Velocity‑powered code generator that produces full CRUD modules from database tables. Additional features include dynamic data source switching, XSS/CSRF protection, captcha, file upload/download, Excel import/export with annotation‑driven mapping, and a demo suite for UI components. The architecture follows a modular Maven structure (admin, common, framework, system, generator, quartz) with a shared common module providing utilities, annotations, and exception hierarchy. While the framework is mature and widely adopted, its frontend stack (jQuery, Bootstrap 3‑era plugins) and use of Shiro represent technical drift compared to modern SPA or Spring Security approaches. The codebase is well‑organized and contains several reusable components, but is tightly coupled to its own conventions and lacks microservice readiness.
The LLM identified 5 files worth highlighting for reuse:
A generic, annotation‑driven Excel import/export utility that uses the @Excel and @Excels annotations on domain fields. Supports multi‑sheet export, dictionary translation, data validation dropdowns, image embedding, CSV injection prevention, and custom handlers. It is fully self‑contained (depends only on Apache POI and common utilities) and can be extracted into any Java project requiring Excel operations with minimal adaptation.
Implements a dynamic data source using Spring's AbstractRoutingDataSource, backed by a ThreadLocal context holder (DynamicDataSourceContextHolder). Combined with the @DataSource annotation and DataSourceAspect, it enables declarative master/slave or multi‑tenant routing at the method level. The pattern is cleanly separated and reusable for any Spring application needing runtime data source switching.
An AOP aspect that intercepts methods annotated with @Log to record operation logs (controller, method, parameters, execution time, result). It handles both synchronous and asynchronous logging via AsyncFactory, and supports filtering of sensitive fields. The aspect is generic and can be reused in any Spring Boot project for audit logging with minimal configuration.
A utility class that analyzes database table metadata (columns, keys, comments) and initializes GenTable/GenTableColumn domain objects for code generation. It applies naming conventions (camelCase, prefix stripping), maps SQL types to Java types, and determines template selection (single table, tree, sub‑table). The logic is self‑contained and could be adapted for other code generation pipelines.
A comprehensive type conversion utility providing null‑safe methods to convert objects to String, Integer, Long, Double, Boolean, BigDecimal, Enum, and more. Includes full‑width/half‑width conversion and digit‑to‑uppercase for monetary amounts. It is a standalone, reusable utility class that can be dropped into any Java project.