Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

#自动代码生成框架

  • 自动生成框架
  • 自动生成service接口doc文档
  • 自动生成表对应的实体类,包含增删改查

##使用方式

  <build>
    <plugins>
      <plugin>
        <groupId>com.glsx</groupId>
        <artifactId>auto-maven-plugin</artifactId>
        <version>1.0-SNAPSHOT</version>
        <configuration>
          <!--生成实体类时需要删除表前缀,可以不配置-->
          <eraseTablePrefix>platform_</eraseTablePrefix>
          <!--数据库密码-->
          <password>df234fl</password>
          <!--数据库用户名-->
          <userName>dev_user</userName>
          <!--配置要生成表对应的实体类--> 
          <tables>
            <table>platform_service_tag</table>
            <table>platform_service_package</table>
            <table>platform_service_definition</table>
            <table>platform_protocol</table>
          </tables>
          <!--<servicedir>要生成接口文档的接口目录,默认为框架生成对应的service目录</servicedir>-->
          <!--<topPackageName>顶级包名,如com.github</topPackageName>-->
          <!--<hibernateVersion>hibernate版本,默认4.1.7.Final</hibernateVersion>-->
          <!--<springframeworkVersion>springframeworkVersion,默认3.0.0.RELEASE</springframeworkVersion>-->
          <databaseUrl>192.168.3.227:3306/cyb_os</databaseUrl>
        </configuration>
      </plugin>
    </plugins>
  </build>

##生成框架目录树,如工程名auto-plugin-sample,对应生成框架如下

.
|____.DS_Store
|____auto-plugin-sample-common // 接口模块,提供给外部调用
| |____pom.xml
| |____src
| | |____main
| | | |____java
| | | | |____com
| | | | | |____glsx
| | | | | | |____base
| | | | | | | |____IService.java
| | | | | | | |____ServiceException.java
| | | | | | |____entity // 根据表名生成的实体类
| | | | | | | |____Protocol.java
| | | | | | | |____ServiceDefinition.java
| | | | | | | |____ServicePackage.java
| | | | | | | |____ServiceTag.java
| | | | | | |____service // 实体类对应的服务接口
| | | | | | | |____ProtocolService.java
| | | | | | | |____ServiceDefinitionService.java
| | | | | | | |____ServicePackageService.java
| | | | | | | |____ServiceTagService.java
|____auto-plugin-sample-container
| |____pom.xml
| |____src
| | |____main
| | | |____java
| | | | |____com
| | | | | |____glsx
| | | | | | |____base
| | | | | | |____dao // dao层,实现基本的增删改查
| | | | | | | |____BaseDao.java
| | | | | | | |____ProtocolDao.java
| | | | | | | |____ServiceDefinitionDao.java
| | | | | | | |____ServicePackageDao.java
| | | | | | | |____ServiceTagDao.java
| | | | | | |____service
| | | | | | | |____impl // 接口实现层
| | | | | | | | |____IServiceImpl.java
| | | | | | | | |____ProtocolServiceImpl.java
| | | | | | | | |____ServiceDefinitionServiceImpl.java
| | | | | | | | |____ServicePackageServiceImpl.java
| | | | | | | | |____ServiceTagServiceImpl.java
| | | |____resource
| | | | |____config
| | | | | |____platform-context.xml
| | | | | |____platform-dubbo.xml // dubbo配置
| | | | |____entity // hibernate映射
| | | | | |____Protocol.hbm.xml
| | | | | |____ServiceDefinition.hbm.xml
| | | | | |____ServicePackage.hbm.xml
| | | | | |____ServiceTag.hbm.xml
| | | | |____log4j.properties
| | | | |____system.properties
| | | |____webapp
| | | | |____WEB-INF
| | | | | |____bin
| | | | | | |____dump.sh
| | | | | | |____restart.sh
| | | | | | |____server.sh
| | | | | | |____start.sh
| | | | | | |____stop.sh
|____auto-plugin-sample.iml
|____pom.xml

Comments ( 0 )

Sign in for post a comment

About

Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more