public class GeneratorController extends MarkController
| 限定符和类型 | 字段和说明 |
|---|---|
private org.springframework.boot.autoconfigure.jdbc.DataSourceProperties |
dataSourceProperties
数据源配置
|
private org.springframework.core.env.Environment |
environment
环境配置
|
private GeneratorProperties |
generatorProperties
生成器配置
|
| 构造器和说明 |
|---|
GeneratorController() |
| 限定符和类型 | 方法和说明 |
|---|---|
Map<String,Object> |
codeGenerate(String tableName,
GeneratorProperties generatorProperties)
执行代码生成指令
|
Map<String,Object> |
generateConf()
获取代码生成配置信息
|
private com.baomidou.mybatisplus.generator.AutoGenerator |
getAutoGenerator(GeneratorProperties generatorProperties,
String[] tableName)
获取AutoGenerator
|
private com.baomidou.mybatisplus.generator.config.DataSourceConfig |
getDataSourceConfig(GeneratorProperties.DataSource datasource)
获取DataSourceConfig
|
private com.baomidou.mybatisplus.generator.config.GlobalConfig |
getGlobalConfig(GeneratorProperties.GlobalConfig globalConfig)
获取GlobalConfig
|
private com.baomidou.mybatisplus.generator.InjectionConfig |
getInjectionConfig(GeneratorProperties genProperties)
获取InjectionConfig
|
private com.baomidou.mybatisplus.generator.config.PackageConfig |
getPackageConfig(GeneratorProperties.PackageConfig packageConfig)
获取PackageConfig
|
private com.baomidou.mybatisplus.generator.config.StrategyConfig |
getStrategyConfig(GeneratorProperties.StrategyConfig strategyConfig,
String... tableName)
获取StrategyConfig
|
private List<com.baomidou.mybatisplus.generator.config.po.TableFill> |
getTableFills()
获取TableFill策略
|
private com.baomidou.mybatisplus.generator.config.TemplateConfig |
getTemplateConfig()
获取TemplateConfig
|
private boolean |
isBlank(CharSequence cs)
判断字符串是否为空白字符串
|
private GeneratorProperties.DataSource |
readDataSource()
读取数据源配置
|
private GeneratorProperties.GlobalConfig |
readGlobalConfig()
读取全局配置信息
|
private final GeneratorProperties generatorProperties
private final org.springframework.core.env.Environment environment
private final org.springframework.boot.autoconfigure.jdbc.DataSourceProperties dataSourceProperties
private boolean isBlank(CharSequence cs)
private com.baomidou.mybatisplus.generator.config.TemplateConfig getTemplateConfig()
private com.baomidou.mybatisplus.generator.InjectionConfig getInjectionConfig(GeneratorProperties genProperties)
private com.baomidou.mybatisplus.generator.config.GlobalConfig getGlobalConfig(GeneratorProperties.GlobalConfig globalConfig)
private com.baomidou.mybatisplus.generator.config.DataSourceConfig getDataSourceConfig(GeneratorProperties.DataSource datasource)
private List<com.baomidou.mybatisplus.generator.config.po.TableFill> getTableFills()
private com.baomidou.mybatisplus.generator.config.StrategyConfig getStrategyConfig(GeneratorProperties.StrategyConfig strategyConfig, String... tableName)
private com.baomidou.mybatisplus.generator.config.PackageConfig getPackageConfig(GeneratorProperties.PackageConfig packageConfig)
private com.baomidou.mybatisplus.generator.AutoGenerator getAutoGenerator(GeneratorProperties generatorProperties, String[] tableName)
private GeneratorProperties.GlobalConfig readGlobalConfig()
private GeneratorProperties.DataSource readDataSource()
@GetMapping(value="/gen/generate-conf") public Map<String,Object> generateConf()
@PostMapping(value="/gen/code-generate") public Map<String,Object> codeGenerate(@RequestParam String tableName, @RequestBody GeneratorProperties generatorProperties)
tableName - 待生成的表名generatorProperties - 生成配置信息Copyright © 2021. All rights reserved.