您现在的位置是:主页 > news > wordpress 不用ftp/seo搜索引擎优化期末考试
wordpress 不用ftp/seo搜索引擎优化期末考试
admin2025/5/8 15:27:51【news】
简介wordpress 不用ftp,seo搜索引擎优化期末考试,环保局网站建设申请,网站设计制作音乐排行榜实体类首字母必须小写,否则swagger-ui界面显示对象的参数说明不显示、是否必输属性即使指定必输也是显示false;比如数据库中字段为B_WORKDAYFLAG,使用mybatis-plus代码生成器工具生成后是bWorkDayFlag,此时可以在mybatis-plus代码…
wordpress 不用ftp,seo搜索引擎优化期末考试,环保局网站建设申请,网站设计制作音乐排行榜实体类首字母必须小写,否则swagger-ui界面显示对象的参数说明不显示、是否必输属性即使指定必输也是显示false;比如数据库中字段为B_WORKDAYFLAG,使用mybatis-plus代码生成器工具生成后是bWorkDayFlag,此时可以在mybatis-plus代码…
实体类首字母必须小写,否则swagger-ui界面显示对象的参数说明不显示、是否必输属性即使指定必输也是显示false;比如数据库中字段为B_WORKDAYFLAG,使用mybatis-plus代码生成器工具生成后是bWorkDayFlag,此时可以在mybatis-plus代码生成器中设置生成实体类时去掉字段前缀,如:
strategy.setFieldPrefix("B_", "C_", "D_", "VC_"); //生成实体时去掉字段前缀
public static void main(String[] args) {// 1、创建代码生成器AutoGenerator mpg = new AutoGenerator();// 设置模板引擎(如果使用默认引擎velocity则不需要下main这行代码)mpg.setTemplateEngine(new FreemarkerTemplateEngine());// 2、全局配置GlobalConfig gc = new GlobalConfig();String projectPath = System.getProperty("user.dir");gc.setOutputDir(projectPath + "/src/main/java");gc.setAuthor("zwc");gc.setOpen(false); //生成后是否打开资源管理器gc.setFileOverride(false); //重新生成时文件是否覆盖gc.setServiceName("%sService"); //去掉Service接口的首字母Igc.setIdType(IdType.ID_WORKER_STR); //主键策略gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型gc.setSwagger2(false);//开启Swagger2模式mpg.setGlobalConfig(gc);// 3、数据源配置DataSourceConfig dsc = new DataSourceConfig();// MYSQL:// dsc.setUrl("jdbc:mysql://127.0.0.1:3306/mysql?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false");// dsc.setDriverName("com.mysql.cj.jdbc.Driver");// dsc.setUsername("root");// dsc.setPassword("root");// dsc.setDbType(DbType.MYSQL);// mpg.setDataSource(dsc);// ORACLE:dsc.setUrl("jdbc:oracle:thin:@127.0.0.1:1521/orcl");dsc.setDriverName("oracle.jdbc.driver.OracleDriver");dsc.setUsername("ds_adp");dsc.setPassword("ds_adp");dsc.setDbType(DbType.ORACLE);mpg.setDataSource(dsc);// 4、包配置PackageConfig pc = new PackageConfig();pc.setModuleName(null); //模块名pc.setParent("cn.aresoft.modules.system");pc.setController("controller");pc.setEntity("entity");pc.setService("service");pc.setMapper("mapper");mpg.setPackageInfo(pc);// 5、策略配置StrategyConfig strategy = new StrategyConfig();strategy.setInclude("BASE_G_SYS_CALENDAR");//对那一张表生成代码strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略strategy.setTablePrefix(pc.getModuleName() + "_"); //生成实体时去掉表前缀strategy.setFieldPrefix("B_", "C_", "D_", "VC_"); //生成实体时去掉字段前缀strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作strategy.setRestControllerStyle(true); //restful api风格控制器strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符mpg.setStrategy(strategy);// 6、执行mpg.execute();
}