# CloudSecurity **Repository Path**: society-eto/cloud-security ## Basic Information - **Project Name**: CloudSecurity - **Description**: CloudSecurity - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2025-01-01 - **Last Updated**: 2026-11-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CloudSecurity #### Introduction Security service web backend service. The project is a **monolithic Spring Boot web application**, currently at the scaffolding/example stage: it contains a configuration-table query API based on MyBatis-Plus, an Excel import/export utility built on annotations + Apache POI, and a Tomcat configuration that forces HTTP to redirect to HTTPS. #### Software Architecture - Java 21 (as specified by `java.version` in `pom.xml`) - Spring Boot 3.2.3 - MySQL 8 - MyBatis-Plus 3.5.5 - Apache POI 3.13 (Excel import/export) - Maven (Maven Wrapper 3.8.7 bundled with the repository) > This document merges all architecture notes from the former `ARCHITECTURE.md` (starting from Chapter 1) and also covers installation, build & run, contributing, and related topics. --- ## 1. Project Overview | Item | Content | | --- | --- | | Project name | `cloud-security` (Maven `artifactId`: `security`) | | GroupId | `com.paifori.cloud` | | Version | `0.0.1-SNAPSHOT` | | Purpose | Security service web backend service | | Build tool | Maven (Maven Wrapper 3.8.7 bundled) | | Code size | 16 main Java files + 1 test file, about 1.1k lines of Java | | Repository | `git@gitee.com:society-eto/cloud-security.git` | | Current branch | `master` (remote also has `develop`, `develop-redis`, `develop-spring-data`) | The project is a **monolithic Spring Boot web application**, currently at the scaffolding/example stage: it contains a configuration-table query API based on MyBatis-Plus, an Excel import/export utility built on annotations + Apache POI, and a Tomcat configuration that forces HTTP to redirect to HTTPS. --- ## 2. Technology Stack ### 2.1 Runtime and Frameworks | Category | Technology | Version | Notes | | --- | --- | --- | --- | | Language | Java | 21 (`java.version` in `pom.xml`) | The earlier README's "Java 17 +" has been corrected to 21 to match the pom | | Base framework | Spring Boot | 3.2.3 | `spring-boot-starter-parent` | | Web | Spring MVC (`spring-boot-starter-web`) | Managed by Boot | Embedded Tomcat | | Persistence | MyBatis-Plus | 3.5.5 | `mybatis-plus-boot-starter` | | Persistence (native) | MyBatis Spring Boot Starter | 3.0.3 | Coexists with MyBatis-Plus | | Database | MySQL 8 (`mysql-connector-j`) | Managed by Boot | Runtime dependency | | Excel | Apache POI / POI-OOXML | 3.13 | Fairly old version; still uses the deprecated `CELL_TYPE_*` constants | | Excel helper | POI-OOXML-Schemas | 4.1.2 | Mismatched with POI 3.13, a potential compatibility risk | | Utilities | Apache Commons Lang3 | Managed by Boot | `StringUtils`, `NumberUtils`, etc. | | Boilerplate reduction | Lombok | Managed by Boot | `@Data`, `@Slf4j` | | Logging | Logback | Managed by Boot | Custom `logback.xml` (console output only) | | Testing | JUnit 5 + Spring Boot Test | Managed by Boot | Only a single `contextLoads` smoke test | ### 2.2 Declared but Not Enabled - **Jasypt** (configuration encryption): the dependency in `pom.xml` is commented out, and the entire `utils/jasypt/JasyptUtil.java` file is commented out. - **application.properties**: the file exists but is empty (0 bytes); all configuration lives in `application.yml`. --- ## 3. Directory Structure ``` cloud-security/ ├── .gitee/ # Issue / PR templates for the Gitee platform ├── .mvn/wrapper/ # Maven Wrapper (maven 3.8.7 / wrapper 3.1.1) ├── src/ │ ├── main/ │ │ ├── java/com/paifori/cloud/security/ │ │ │ ├── CloudSecurityApplication.java # Entry point (@SpringBootApplication) │ │ │ ├── annotation/ │ │ │ │ └── ExcelColumn.java # Excel column annotation (CN/EN headers + converter) │ │ │ ├── bean/ # Data models (no service layer; beans serve as DTO/PO) │ │ │ │ ├── BaseResult.java # Unified response body (static factories success/fail) │ │ │ │ ├── Config.java # config table entity │ │ │ │ └── User.java # Excel sample entity │ │ │ ├── common/ │ │ │ │ └── Result.java # Another unified response body (chained setters) │ │ │ ├── config/ │ │ │ │ ├── Http2Https.java # Forced HTTP(80) → HTTPS(443) redirect │ │ │ │ └── MybatisPlusConfig.java # @MapperScan for mappers │ │ │ ├── controller/ │ │ │ │ ├── CommandController.java # Command execution placeholder (currently does not compile) │ │ │ │ ├── IndexController.java # Health check + config table query │ │ │ │ └── UserController.java # Excel template download / export / import │ │ │ ├── mapper/ │ │ │ │ └── ConfigMapper.java # Extends BaseMapper │ │ │ └── utils/ │ │ │ ├── excel/ │ │ │ │ ├── Converter.java # Value converter interface │ │ │ │ ├── StringConverter.java # Default implementation: null → "" │ │ │ │ └── ExcelUtils.java # Core Excel read/write utility (~380 lines) │ │ │ └── jasypt/ │ │ │ └── JasyptUtil.java # Fully commented out, not enabled │ │ └── resources/ │ │ ├── application.properties # Empty file (legacy) │ │ ├── application.yml # Port/SSL/datasource/MyBatis-Plus configuration │ │ ├── init.sql # Database/table creation script (cloud_security.config) │ │ ├── logback.xml # Logging configuration (console only) │ │ ├── tomcat_https.keystore # Self-signed HTTPS certificate (JKS) │ │ └── mapper/ConfigMapper.xml # MyBatis XML (resultMap/column list only) │ └── test/java/com/paifori/cloud/security/ │ └── CloudSecurityApplicationTests.java # Spring context load test ├── .gitignore ├── HELP.md # Notes generated by Spring Initializr ├── LICENSE # Apache License 2.0 ├── README.md # Project documentation (merged with the architecture doc) ├── README.en.md # English project introduction ├── mvnw / mvnw.cmd # Maven Wrapper scripts └── pom.xml ``` --- ## 4. Layering and Dependencies The project follows the classic Spring MVC layering, but **lacks a Service layer**: controllers call mappers directly. ``` ┌──────────────────────────────────────────────────────────────┐ │ Client (browser / caller) │ │ HTTP :80 ──(forced redirect)──▶ HTTPS :443 │ └───────────────────────────┬──────────────────────────────────┘ │ ┌───────────────────────────▼──────────────────────────────────┐ │ Access layer config.Http2Https (Tomcat Connector + │ │ security constraints) │ └───────────────────────────┬──────────────────────────────────┘ │ ┌───────────────────────────▼──────────────────────────────────┐ │ Controller layer controller │ │ IndexController / UserController / CommandController │ └───────────┬───────────────────────────────┬──────────────────┘ │ │ ┌───────────▼─────────────┐ ┌─────────────▼──────────────────┐ │ Mapper layer │ │ Utility layer utils.excel │ │ ConfigMapper │ │ ExcelUtils / Converter │ │ (MyBatis-Plus BaseMapper)│ │ (annotation/reflection/POI) │ └───────────┬─────────────┘ └─────────────┬──────────────────┘ │ │ ┌───────────▼─────────────┐ ┌─────────────▼──────────────────┐ │ Data model bean │ │ Annotation ExcelColumn │ │ Config / User │ └────────────────────────────────┘ └───────────┬─────────────┘ │ ┌───────────▼──────────────────────────────────────────────────┐ │ MySQL 8 cloud_security DB (table: config) │ └──────────────────────────────────────────────────────────────┘ ``` **Key dependency rules** - `controller` → `mapper` / `utils` / `bean` / `common` - `mapper` → `bean` - `utils.excel` → `annotation` (reads `@ExcelColumn` through reflection) - `bean` depends on nothing above it; `User` is annotated directly with `@ExcelColumn` - No reverse dependencies and no circular dependencies --- ## 5. Module Responsibilities ### 5.1 Entry Point | File | Description | | --- | --- | | `CloudSecurityApplication` | Standard `@SpringBootApplication` entry point; the package root is `com.paifori.cloud.security`, so all components under that package are scanned automatically | ### 5.2 `annotation` — Excel Column Annotation `ExcelColumn` is declared on fields and retained at runtime (`@Retention(RUNTIME)`). It contains: | Attribute | Type | Purpose | | --- | --- | --- | | `value` | `String` | Chinese header | | `valueEn` | `String` | English header | | `getConverter` | `Class` | Value converter used on export; defaults to `StringConverter` | Constants: `ExcelColumn.CH = "ch"` and `ExcelColumn.EN = "en"` are used by the `lang` parameter of the API to switch between Chinese and English headers. ### 5.3 `bean` — Data Models | Class | Table / Purpose | Fields | | --- | --- | --- | | `Config` | `config` table | `id`, `name`, `value`, `remark` | | `User` | Excel sample entity (not a database mapping) | `userCode`, `userName`, `password`, `dept`, `userStatus`, `createDate`; all except `password` carry `@ExcelColumn` | | `BaseResult` | Unified response body (used by `CommandController`) | `code`, `status`, `data`, `message`; static factories `success` (200) / `fail` (400) | > `User.toString()` still prints the old class name `BusClick{...}`, a leftover from copied code. ### 5.4 `common` — The Other Response Body `Result` overlaps with `BaseResult` and provides: - `success(data, message)` → `code = 200` - `fail(data, message, code)` / `fail(data, message)` (defaults to 504) / `fail(message)` - Chained setters (`setXxx` returns `this`) **In the current project `IndexController` uses `Result` while `CommandController` uses `BaseResult`, so the response format is not consistent.** ### 5.5 `config` — Infrastructure Configuration **`Http2Https`** (`@AutoConfiguration`) - Registers an additional HTTP Connector through `TomcatServletWebServerFactory` (port 80 by default) - `connector.setSecure(false)` + `setRedirectPort(sslPort)`: redirects HTTP requests to 443 - Applies a confidentiality constraint to all paths via `SecurityConstraint` (`CONFIDENTIAL`) + `SecurityCollection("/*")` - Note: `httpPort` is hardcoded to 80 and `sslPort` is taken from `server.port`; startup fails when running as a non-root user or when port 80 is already in use **`MybatisPlusConfig`** - `@MapperScan({"com.baomidou.mybatisplus.samples.quickstart.mapper", "com.paifori.cloud.security.mapper"})` - The first package name comes from an official MyBatis-Plus sample and does not exist in this project; it is leftover configuration that should be cleaned up ### 5.6 `mapper` — Persistence Layer - `ConfigMapper extends BaseMapper`, relying solely on the generic CRUD provided by MyBatis-Plus, with no custom methods - `resources/mapper/ConfigMapper.xml` only declares a `resultMap` and `Base_Column_List`, **without any actual SQL statements**, so it currently serves as a placeholder only - In the XML, `` uses a `jdbcType` that does not match the entity's `int` type; `INTEGER` is recommended instead ### 5.7 `controller` — API Layer **`IndexController`** - `GET /index`: returns the current millisecond timestamp as a string, usable as a health check - `GET /config`: `configMapper.selectList(new QueryWrapper<>())` queries the whole table and returns `Result` **`UserController`** (`@RequestMapping("/user")`) - `GET /user/template?lang=ch|en`: dynamically builds headers from `@ExcelColumn` annotations and outputs an empty `template.xlsx` - `GET /user/export?lang=ch|en`: builds two sample `User` records and exports `abbot.xlsx` - `POST /user/import` (`multipart/form-data`, field name `upload_file`): parses the uploaded Excel file and deserializes each row into a `User`, then prints the JSON **`CommandController`** (`@RequestMapping("/cloud-security/command")`) - `POST /cloud-security/command/execute`: placeholder implementation of a command execution API; the method body references an undefined `STR` (the Java string template API), so **the current code does not compile** ### 5.8 `utils.excel` — Excel Engine `ExcelUtils` is the most important shared utility in the project (about 380 lines), implementing bidirectional POJO ↔ Excel row mapping entirely through **reflection + annotations**: | Method | Visibility | Purpose | | --- | --- | --- | | `readExcel(path, cls, file, lang)` | public static | Reads the first sheet of the uploaded file; builds a "column index → field" mapping by matching the header row against annotation headers according to `lang`; then assigns subsequent rows via reflection, skipping fully empty rows | | `writeExcel(response, dataList, cls, lang)` | public static | Writes headers + data into an `XSSFWorkbook`, freezes the first row, and downloads it as the attachment `abbot.xlsx` | | `writeExcelTemplate(response, headers, template)` | public static | Writes headers only and downloads them as an import template | | `handleField(t, value, field)` | private static | Converts String → Number/Boolean/BigDecimal etc. based on the field type; for unknown types it tries the `String` constructor | | `getCellValue(cell)` | private static | Handles numeric, string, formula, boolean and date (`HSSFDateUtil`) cell types | | `buildExcelDocument` / `buildExcelFile` | private static | Writes to `HttpServletResponse` or to a local file | Design highlights: - Headers are the contract: only fields annotated with `@ExcelColumn` are exported/imported; `lang` decides whether Chinese or English headers are used - Value formatting is implemented by instantiating a `Converter` from `@ExcelColumn.getConverter()`; the default `StringConverter` turns `null` into an empty string - Supports both `.xls` (HSSF) and `.xlsx` (XSSF) formats (on import, the format is determined from the file name suffix) ### 5.9 `utils.jasypt` The whole `JasyptUtil` file is commented out (including its `main` method), matching the commented-out `jasypt-spring-boot-starter` in `pom.xml`; it is a "reserved but not enabled" configuration-encryption approach. --- ## 6. API Reference | Method | Path | Parameters | Returns | Controller | | --- | --- | --- | --- | --- | | GET | `/index` | none | `String` (current timestamp) | `IndexController` | | GET | `/config` | none | `Result` (`data` is the full `config` table) | `IndexController` | | GET | `/user/template` | `lang` (default `ch`) | `template.xlsx` attachment | `UserController` | | GET | `/user/export` | `lang` (default `ch`) | `abbot.xlsx` attachment | `UserController` | | POST | `/user/import` | `lang`, `upload_file` (MultipartFile) | none (result printed to the console) | `UserController` | | POST | `/cloud-security/command/execute` | none | `BaseResult` (currently does not compile) | `CommandController` | --- ## 7. Configuration ### 7.1 `application.yml` | Property | Value | Description | | --- | --- | --- | | `server.port` | `443` | HTTPS listening port | | `server.servlet.session.timeout` | `24h` | Session timeout | | `server.ssl.enabled` | `true` | Enables HTTPS | | `server.ssl.key-store` | `classpath:tomcat_https.keystore` | JKS certificate (committed with the source) | | `server.ssl.key-store-type` | `JKS` | Certificate type | | `server.ssl.key-alias` | `tomcat_https` | Certificate alias | | `server.ssl.key-password` / `key-store-password` | `123456` | **Plaintext weak password** | | `logging.config` | `classpath:logback.xml` | Custom logging configuration | | `spring.datasource.url` | `jdbc:mysql://192.168.8.109:3306/cloud_security?...` | Points to a fixed intranet IP | | `spring.datasource.username` / `password` | `root` / plaintext password | **Hardcoded credentials** | | `spring.main.allow-bean-definition-overriding` | `true` | Allows bean overriding, hiding potential conflicts | | `mybatis-plus.mapper-locations` | `classpath:mapper/*.xml` | XML mapper location | | `mybatis-plus.type-enums-package` | `com.paifori.cloud.security.bean` | Enum scan package (no enums currently) | | `mybatis-plus.configuration.map-underscore-to-camel-case` | `true` | Underscore-to-camel-case mapping | | `mybatis-plus.global-config.banner` | `false` | Disables the startup banner | ### 7.2 `logback.xml` - `contextName`: `rest-logback`; the `PROJECT` property is `rest` - Only a `ConsoleAppender` is defined, **there is no file output**; the `LOG_HOME=/var/jiexun/project/logs` property is defined but never used - Root level is `INFO`; `com.paifori.cloud.security` is `INFO`; Spring / Apache / Druid are lowered to `WARN` - Output pattern: `time [level]-[thread] logger : message` ### 7.3 Datasource Initialization `init.sql` creates the initial database schema: ```sql CREATE DATABASE IF NOT EXISTS cloud_security DEFAULT CHARACTER SET utf8mb4; DROP TABLE IF EXISTS config; CREATE TABLE config ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(20) NOT NULL COMMENT 'name', value VARCHAR(50) NOT NULL COMMENT 'password', remark VARCHAR(1024) COMMENT 'remark', PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ``` > Note: the script contains `DROP TABLE`, so running it again wipes the data in the `config` table; the script also has no `USE cloud_security;` statement, so the database must be selected manually or specified in the connection. --- ## 8. Data Model ### 8.1 `config` Table ↔ `Config` Entity | Column | Type | Java Field | Java Type | Description | | --- | --- | --- | --- | --- | | `id` | `INT` PK AI | `id` | `int` | Primary key | | `name` | `VARCHAR(20)` | `name` | `String` | Name | | `value` | `VARCHAR(50)` | `value` | `String` | Password | | `remark` | `VARCHAR(1024)` | `remark` | `String` | Remark | - The entity does not use `@TableName`; it relies on the MyBatis-Plus default rule (`Config` → table `config`) - The entity does not use `@TableId`; it relies on the default primary-key name `id` ### 8.2 `User` (Excel sample model, not persisted) | Field | Type | `@ExcelColumn` Chinese / English | | --- | --- | --- | | `userCode` | `String` | 用户编码 / user code | | `userName` | `String` | 用户名称 / user name | | `password` | `String` | No annotation (not imported/exported) | | `dept` | `String` | 所属部门 / department | | `userStatus` | `Integer` | 用户状态 / user status | | `createDate` | `Long` | 创建时间 / create date | > The Chinese strings above are the literal `@ExcelColumn.value` annotation values used in the code, kept verbatim for reference. --- ## 9. Typical Flows ### 9.1 Startup Flow 1. The JVM starts `CloudSecurityApplication.main` 2. Spring Boot auto-configuration: Web (embedded Tomcat), datasource, MyBatis-Plus 3. `MybatisPlusConfig` scans `com.paifori.cloud.security.mapper` and registers `ConfigMapper` 4. `Http2Https` registers an additional HTTP Connector (80) and sets up the redirect to 443 5. Embedded Tomcat starts with HTTPS on port 443 (certificate from `classpath:tomcat_https.keystore`) ### 9.2 `GET /config` Query Flow ``` GET /config → IndexController.config() → configMapper.selectList(new QueryWrapper()) → MyBatis-Plus generates SELECT id,name,value,remark FROM config → MySQL cloud_security → Result.success(list, "success!") → JSON: {"status":true,"data":[...],"message":"success!","code":200} ``` ### 9.3 Excel Export Flow (`GET /user/export`) ``` GET /user/export?lang=ch → UserController.exportExcel() → build a List of sample data → ExcelUtils.writeExcel(response, list, User.class, lang) ① reflectively collect fields in User annotated with @ExcelColumn → LinkedHashMap ② use lang to choose value / valueEn for the headers ③ write rows one by one; each value is transformed by Converter.convert() ④ createFreezePane to freeze the first row ⑤ buildExcelDocument outputs abbot.xlsx as an attachment ``` ### 9.4 Excel Import Flow (`POST /user/import`) ``` POST /user/import (multipart, upload_file=xxx.xlsx, lang=ch) → UserController.readExcel() → ExcelUtils.readExcel("", User.class, file, lang) ① validate the suffix (xls / xlsx); otherwise only log an error (no exception is thrown) ② map annotation headers to classMap> according to lang ③ read the header row → reflectionMap>; if empty, treat the template as invalid and return null ④ for each row, reflectively newInstance + assign with handleField, skipping fully empty rows → ObjectMapper prints the JSON of each row to the console ``` > The method returns `void` and has no unified response body, so the import result is invisible to the caller. --- ## 10. Installation, Build and Run ### 10.1 Requirements and Installation - JDK 21 (`java.version=21` in `pom.xml`; the string template syntax `STR."..."` additionally requires preview features, see Section 11) - MySQL 8, with access to `192.168.8.109:3306` (or modify `application.yml`) - Ports 80 and 443 available (`Http2Https` occupies port 80) - Maven (the bundled Wrapper can be used directly; no local installation required) Installation steps: 1. Install JDK 21 and configure `JAVA_HOME` 2. Install MySQL 8 and create the `cloud_security` database (see 10.2) 3. Adjust the datasource and certificate settings in `src/main/resources/application.yml` to match your environment ### 10.2 Common Commands ```bash # Initialize the database (run in a MySQL client) mysql -u root -p < src/main/resources/init.sql # Compile and package (use mvnw.cmd on Windows) ./mvnw clean package -DskipTests .\mvnw.cmd clean package -DskipTests # Run ./mvnw spring-boot:run java -jar target/security-0.0.1-SNAPSHOT.jar # Run tests ./mvnw test ``` ### 10.3 Usage and Access Examples By default the project serves clients over HTTPS (443), and HTTP (80) is automatically redirected to HTTPS. | Scenario | Request | | --- | --- | | Health check | `https://localhost/index` | | Query configuration | `https://localhost/config` | | Download the Chinese template | `https://localhost/user/template?lang=ch` | | Export Chinese Excel | `https://localhost/user/export?lang=ch` | | Import Excel | `curl -k -F "upload_file=@data.xlsx" "https://localhost/user/import?lang=ch"` | > Because the certificate is self-signed, browsers show a security warning; `curl` requires `-k`. --- ## 11. Known Issues and Technical Debt Sorted by impact; these should be addressed first in future iterations: | # | Issue | Location | Impact | | --- | --- | --- | --- | | 1 | `STR` is undefined in `BaseResult.success(STR, null)` | `CommandController#execute` | **Compilation failure**; the whole module cannot be built | | 2 | `var str = STR."My name is \{user.getUserName()}"` uses a string template | `UserController#exportExcel` | Requires JDK 21+ with `--enable-preview` to compile; the variable is never used after assignment | | 3 | Database credentials and keystore password are committed in plaintext | `application.yml` | Credential leakage risk; Jasypt is declared but commented out and not enabled | | 4 | Two response bodies coexist (`Result` / `BaseResult`) with inconsistent status-code semantics (400 vs 504) | `common` / `bean` | Higher front-end integration cost, inconsistent format | | 5 | Missing Service layer; controllers operate on mappers directly | `controller` | Business logic has nowhere to live and is hard to reuse and test | | 6 | `@MapperScan` includes the non-existent sample package `com.baomidou.mybatisplus.samples.quickstart.mapper` | `MybatisPlusConfig` | Invalid configuration that misleads maintainers | | 7 | POI 3.13 + poi-ooxml-schemas 4.1.2 version mismatch, and deprecated `Cell.CELL_TYPE_*`, `CellStyle.ALIGN_CENTER`, `Font.BOLDWEIGHT_NORMAL` are used | `pom.xml` / `ExcelUtils` | Requires a full rewrite when upgrading to POI 5.x; runtime compatibility risk | | 8 | `readExcel` only logs an error for invalid suffixes instead of aborting; returns `null` for an invalid template | `ExcelUtils` | Callers may receive `null` (`UserController` calls `forEach` without a null check, so there is an NPE risk) | | 9 | Download file name hardcoded to `abbot.xlsx`; `log.info("", resultList)` placeholder/argument mismatch | `ExcelUtils#writeExcel` / `UserController` | Poor user experience and log readability | | 10 | HTTP port hardcoded to 80; SSL port taken from `server.port` | `Http2Https` | Startup fails in non-root environments or when the port is occupied; no feature toggle | | 11 | `jdbcType="VARCHAR"` for `id` in `ConfigMapper.xml` | `resources/mapper/ConfigMapper.xml` | Semantically incorrect type | | 12 | `init.sql` contains `DROP TABLE` and has no `USE` statement | `resources/init.sql` | Accidental execution loses data | | 13 | `application.properties` is an empty file; `JasyptUtil` is entirely commented out | resources / utils | Redundant and misleading | | 14 | `User.toString()` prints `BusClick{...}` | `bean/User` | Copy leftover that misleads logs | | 15 | Only a single empty `contextLoads` test, which requires a real MySQL instance to pass | `src/test` | Lack of effective test coverage | > Note: the inconsistency between the original README and the pom regarding "Java 17+ / 21" was corrected in this merge (unified to Java 21). --- ## 12. Suggested Evolution (for Reference) 1. **Fix the compilation problems first**: clean up the string template usage in `CommandController` and `UserController` (or explicitly `import static java.lang.StringTemplate.STR` and enable preview in the build) so that `mvnw package` succeeds. 2. **Unify the response body**: keep one (recommended: `common.Result`) and pair it with global exception handling (`@RestControllerAdvice`). 3. **Complete the layering**: add a `service` layer (interface + implementation); controllers should only perform parameter validation and response wrapping. 4. **Externalize sensitive configuration**: inject database/certificate passwords through environment variables or Jasypt encryption (`ENC(...)`); keep the keystore out of the repository. 5. **Datasource governance**: introduce multi-environment profiles (`application-dev.yml` / `application-prod.yml`) and remove `allow-bean-definition-overriding: true`. 6. **Upgrade the Excel module**: upgrade POI to 5.x and rewrite `ExcelUtils` against the new API; add an import-result response body and null checks; make the download file name configurable or business-driven. 7. **Add tests**: write unit tests for `ExcelUtils` import/export (using in-memory streams, with no database dependency). 8. **Standardize branches**: `develop`, `develop-redis` and `develop-spring-data` currently run in parallel with `master`; define the mainline and the release process clearly. --- ## 13. Documentation Maintenance - This document is `README.md` in the repository root; all content of the former `ARCHITECTURE.md` has been merged into it - If the directory structure, dependency versions or APIs change, update Sections 3, 2 and 6 accordingly - Once an item in the known-issues list (Section 11) is fixed, move it to a "Resolved" section or delete it --- ## 14. Contributing 1. Fork this repository 2. Create a new branch 3. Commit your code 4. Open a Pull Request