Code Generator
About 1 min
Code Generator
Page Guide
ScenarioGenerate backend CRUD, frontend pages, and basic APIs from database tables.
PrerequisiteDatabase tables, comments, primary keys, dictionaries, permission identifiers, and menu paths have been designed.
PathSystem Tools -> Code Generation -> Import Table -> Configure Fields -> Preview -> Generate.
1. Workflow
2. Table Design Suggestions
| Item | Recommendation |
|---|---|
| Table name | Use a business prefix and avoid conflicts with system tables. |
| Primary key | Keep consistent with existing project style. |
| Column comments | Required for page labels and export headers. |
| Status fields | Reuse dictionaries when possible. |
| Tenant field | Add it early when data isolation is required. |
| Logical delete | Follow the project-wide strategy. |
3. Field Configuration
| Config | Description |
|---|---|
| Java type | Backend entity field type. |
| Query mode | Equals, like, range, and other query modes. |
| List display | Whether the column is displayed in the list. |
| Form display | Whether the column is displayed in add/edit forms. |
| Required | Whether frontend required validation is generated. |
| Control type | Input, select, date, radio, checkbox, and other controls. |
| Dictionary type | Dictionary used for status or enum labels. |
4. Post-generation Checks
- Package and module names are correct.
- Controller path follows API conventions.
- Permission identifiers match menu buttons.
- Mapper XML is scanned.
- Frontend API path is correct.
- Route and menu are configured.
- Import/export display follows column comments.
- List, add, edit, delete, and pagination pass smoke tests.
5. Development Entry
| Type | Path Or API | Description |
|---|---|---|
| Frontend page | vue3/src/views/tool/gen | Code generation page. |
| Backend module | springboot/fastbee-plugs/fastbee-generator | Generator core. |
| Backend API | /tool/gen | Generator APIs. |
| Tables | gen_table, gen_table_column | Table and column generation configuration. |
| Dictionary API | /system/dict/type, /system/dict/data | Dictionary configuration. |
