NutzCN Logo
精华 nutzwk的idea代码生成插件
发布于 3072天前 作者 enilu 9606 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

分享一个nutzwk的idea代码生成插件。
折腾了一个周末,今天先发一版出来: https://nutz.cn/yvr/t/ol200cshjuhl4r8vij1mi3fpgp
目前还不能单独使用,需要依赖 nutzwk-code-generator
具体用法参考https://github.com/enilu/nutzwk-plugin 文档说明了。

45 回复

勘误:
折腾了一个周末,今天先发一版出来: https://nutz.cn/yvr/t/ol200cshjuhl4r8vij1mi3fpgp
更改为:
折腾了一个周末,今天先发一版出来: https://github.com/enilu/nutzwk-plugin

期待idea官方插件库的审核通过,哈哈

有时候只想生成列表页,有的时候想生成增删改页面(没查看),有时候想全部生成……对应的按钮和js按需出现……

也希望早日通过;话说,鲨鱼,你活的好纠结,^_^。我继续弄。

idea 审核通过了,可以通过关键子:nutzwk-plugin 搜索安装该插件。

@Wizzercn 已更新,可以控制页面的生成
插件地址

需要下载nutzwk-code-generator 最新代码

untitled1_png

可以搜索到了

接下来,看看使用把插件做成使用maven管理的,这样就可以自动依赖nutzwk-code-generator;否则,使用个插件还需要下载另外一个项目,太麻烦了。

可以做成全自动的么……

有时间就弄

该插件依赖的nutzwk-code-generator,可以不用下载编译。
直接在pom.xml文件中加入依赖即可

        <dependency>
            <groupId>cn.enilu.tools</groupId>
            <artifactId>nutzwk-code-generator</artifactId>
            <version>1.0</version>
        </dependency>

插件1.2版本发布,更新了生成页面时候的bug,并对没有加入nutzwk-code-generator时进行提醒
https://plugins.jetbrains.com/plugin/8506?pr=

原来这样用, nutzwk-code-generator不能做在插件里面吗?

nutzwk-code-generator通过读取model类的注解获取model信息。但是IDEA插件api里貌似没有读取项目注解的API。
我再查一下,如果实在找不到这种方法。就得读取model源文件,做字符串解析获取注解信息了。

@enilu 哦用eclipse 执行Generator 类的时候 把我整个数据库都生成了一遍,我加了 表名称
-i user -p cn.wizzer.modules.back.sys.user -u /private/sys/user

升级版本到1.4.
主要针对要自定义service和controller包名称提供了配置功能。
不过话说既然都使用nutzwk开发项目了,基本必要再改这玩意儿的包名称了吧。

代码生成器 有问题。。。。下载nutzwk 自动生成代码 不能用

升级版本到1.6
针对nutzwk bootstrap-3.3.x版本的目录结构调整做适配
nutzwk-plugin更新到1.6版本: https://plugins.jetbrains.com/plugin/8506?pr=idea
依赖的nutzwk-code-generator需要更新到1.2版本:

<dependency>
    <groupId>cn.enilu.tools</groupId>
    <artifactId>nutzwk-code-generator</artifactId>
    <version>1.2</version>
</dependency>

@enilu 无法用啊,插件升级到了新 依赖的nutzwk-code-generator升级到了1.2版本。但是生成代码只有框架,没有生成字段比如index.html只生成了操作功能,并没有生成任意字段,这是怎么回事呢?。

@x55admin model类没有加@Comment注解?

@enilu 嗯 是的 我加上试试

来自炫酷的 NutzCN

加上也不行,不知道问题出在哪也不报错~

最新代码生成器报错:

pom.xml

<dependency>
            <groupId>cn.enilu.tools</groupId>
            <artifactId>nutzwk-code-generator</artifactId>
            <version>1.2</version>
        </dependency>

然后eclips --- debug as 选择 application
main class :cn.enilu.common.code.Generator

-i  C_product   -p cn.wizzer.modules.models.cdai  -u /platform/cdai

模板是用的nutzwk-code-gen 1.2 中json包下的代码,在原来nutzwk未升级之前,1.1 是没有问题

Exception in thread "main" java.lang.NullPointerException
	at cn.enilu.common.code.EntityDescLoader.loadTables(EntityDescLoader.java:28)
	at cn.enilu.common.code.Generator.main(Generator.java:154)

我debug后看到了 是我包路径搞错了 源码中加了 modPackageName

        String packageName = basePackageName+"."+modPackageName;

@enilu 新插件怎么用$table.LableColumns 但是我换成$table.IndexColumns 能循环一些字段呢?

@enilu IDEA插件无法生成字段:
例如:index.html中只生成了:

<div class=panel-body style="padding-top: 50px;">
        <div class="table-responsive no-border">
            <table class="table table-bordered table-striped mg-t datatable">
                <thead>
                    <tr>
                            <th>操作</th>
                    </tr>
                </thead>
            </table>
        </div>
    </div>

控制台输出如下:

"D:\Program Files\Java\jdk1.8.0_101\bin\java" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:28130,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath "D:\Program Files\Java\jdk1.8.0_101\jre\lib\charsets.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\deploy.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\access-bridge-64.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\cldrdata.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\dnsns.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jaccess.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jfxrt.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\localedata.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\nashorn.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunec.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunjce_provider.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunmscapi.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunpkcs11.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\zipfs.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\javaws.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\jce.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfr.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfxswt.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\jsse.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\management-agent.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\plugin.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\resources.jar;D:\Program Files\Java\jdk1.8.0_101\jre\lib\rt.jar;D:\Program Files\Project\findme\findme\target\classes;D:\Program Files\Java\maven-3.1.1\warehouse\org\atteo\evo-inflector\1.0.1\evo-inflector-1.0.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\commons-cli\commons-cli\1.2\commons-cli-1.2.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\velocity\velocity\1.7\velocity-1.7.jar;D:\Program Files\Java\maven-3.1.1\warehouse\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\microsoft\sqljdbc4\3.0\sqljdbc4-3.0.jar;D:\Program Files\Java\maven-3.1.1\warehouse\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz\1.r.58\nutz-1.r.58.jar;D:\Program Files\Java\maven-3.1.1\warehouse\log4j\log4j\1.2.17\log4j-1.2.17.jar;D:\Program Files\Java\maven-3.1.1\warehouse\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz-plugins-daocache\1.r.58\nutz-plugins-daocache-1.r.58.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\alibaba\druid\1.0.26\druid-1.0.26.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz-integration-quartz\1.r.58\nutz-integration-quartz-1.r.58.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\quartz-scheduler\quartz\2.2.3\quartz-2.2.3.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz-integration-shiro\1.r.58\nutz-integration-shiro-1.r.58.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\shiro\shiro-web\1.2.5\shiro-web-1.2.5.jar;D:\Program Files\Java\maven-3.1.1\warehouse\commons-logging\commons-logging\1.1\commons-logging-1.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\slf4j\slf4j-log4j12\1.7.21\slf4j-log4j12-1.7.21.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutzwx\1.r.58\nutzwx-1.r.58.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz-plugins-views\1.r.58\nutz-plugins-views-1.r.58.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz-plugins-sfntly\1.r.58\nutz-plugins-sfntly-1.r.58.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\ibm\icu\icu4j\4.8.1.1\icu4j-4.8.1.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\cn\enilu\tools\nutzwk-code-generator\1.2\nutzwk-code-generator-1.2.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\vdurmont\emoji-java\3.1.3\emoji-java-3.1.3.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\json\json\20160212\json-20160212.jar;D:\Program Files\Java\maven-3.1.1\warehouse\c3p0\c3p0\0.9.1.1\c3p0-0.9.1.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\slf4j\slf4j-api\1.7.21\slf4j-api-1.7.21.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\shiro\shiro-core\1.2.5\shiro-core-1.2.5.jar;D:\Program Files\Java\maven-3.1.1\warehouse\commons-beanutils\commons-beanutils\1.8.3\commons-beanutils-1.8.3.jar;D:\Program Files\Java\maven-3.1.1\warehouse\cn\apiclub\tool\simplecaptcha\1.2.2\simplecaptcha-1.2.2.jar;D:\Program Files\Java\maven-3.1.1\warehouse\mysql\mysql-connector-java\5.1.39\mysql-connector-java-5.1.39.jar;D:\Program Files\Java\maven-3.1.1\warehouse\net\sourceforge\jtds\jtds\1.3.1\jtds-1.3.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\google\zxing\javase\3.2.1\javase-3.2.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\google\zxing\core\3.2.1\core-3.2.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\beust\jcommander\1.48\jcommander-1.48.jar;D:\Program Files\Java\maven-3.1.1\warehouse\net\sf\ehcache\ehcache\2.10.2.2.21\ehcache-2.10.2.2.21.jar;D:\Program Files\Java\maven-3.1.1\warehouse\redis\clients\jedis\2.8.1\jedis-2.8.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\commons\commons-pool2\2.4.2\commons-pool2-2.4.2.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\commons\commons-email\1.4\commons-email-1.4.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\sun\mail\javax.mail\1.5.5\javax.mail-1.5.5.jar;D:\Program Files\Java\maven-3.1.1\warehouse\javax\activation\activation\1.1.1\activation-1.1.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\shiro\shiro-all\1.3.2\shiro-all-1.3.2.jar;D:\Program Files\Java\maven-3.1.1\warehouse\commons-beanutils\commons-beanutils-core\1.8.3\commons-beanutils-core-1.8.3.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\ibeetl\beetl\2.5.2\beetl-2.5.2.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\antlr\antlr4-runtime\4.2\antlr4-runtime-4.2.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\abego\treelayout\org.abego.treelayout.core\1.0.1\org.abego.treelayout.core-1.0.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\antlr\antlr4-annotations\4.2\antlr4-annotations-4.2.jar;D:\Program Files\Java\maven-3.1.1\warehouse\org\brickred\socialauth\4.12\socialauth-4.12.jar;D:\Program Files\Java\maven-3.1.1\warehouse\io\jsonwebtoken\jjwt\0.6.0\jjwt-0.6.0.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\fasterxml\jackson\core\jackson-databind\2.8.1\jackson-databind-2.8.1.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\fasterxml\jackson\core\jackson-annotations\2.8.0\jackson-annotations-2.8.0.jar;D:\Program Files\Java\maven-3.1.1\warehouse\com\fasterxml\jackson\core\jackson-core\2.8.1\jackson-core-2.8.1.jar;D:\Program Files (x86)\IntelliJ IDEA\lib\idea_rt.jar" cn.enilu.common.code.Generator -i CarBrand -u /platform/app -p cn.wizzer.modules -v index_add_detail_edit_ -mod models.app -ctr controllers.platform.app -sev services.app controller service view
Connected to the target VM, address: '127.0.0.1:28130', transport: 'socket'
2016-10-28 20:43:35,388 org.nutz.resource.impl.ErrorResourceLocation.<init>(ErrorResourceLocation.java:28) INFO  - [loc=D:\Program%20Files\Project\findme\findme\target\classes]not exist
2016-10-28 20:43:37,098 org.nutz.resource.Scans.<init>(Scans.java:497) DEBUG - Locations for Scans:
[Dir[path=D:\Program Files\Project\findme\findme], Jar[path=D:\Program%20Files\Java\maven-3.1.1\warehouse\org\nutz\nutz\1.r.58\nutz-1.r.58.jar], ErrorResourceLocation [loc=D:\Program%20Files\Project\findme\findme\target\classes], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\charsets.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\deploy.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\access-bridge-64.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\cldrdata.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\dnsns.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jaccess.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\jfxrt.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\localedata.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\nashorn.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunec.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunjce_provider.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunmscapi.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\sunpkcs11.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\ext\zipfs.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\javaws.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jce.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfr.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jfxswt.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\jsse.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\management-agent.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\plugin.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\resources.jar], Jar[path=D:\Program Files\Java\jdk1.8.0_101\jre\lib\rt.jar], Dir[path=D:\Program Files\Project\findme\findme\target\classes], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\atteo\evo-inflector\1.0.1\evo-inflector-1.0.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\commons-cli\commons-cli\1.2\commons-cli-1.2.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\velocity\velocity\1.7\velocity-1.7.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\commons-lang\commons-lang\2.6\commons-lang-2.6.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\microsoft\sqljdbc4\3.0\sqljdbc4-3.0.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz\1.r.58\nutz-1.r.58.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\log4j\log4j\1.2.17\log4j-1.2.17.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz-plugins-daocache\1.r.58\nutz-plugins-daocache-1.r.58.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\alibaba\druid\1.0.26\druid-1.0.26.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz-integration-quartz\1.r.58\nutz-integration-quartz-1.r.58.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\quartz-scheduler\quartz\2.2.3\quartz-2.2.3.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz-integration-shiro\1.r.58\nutz-integration-shiro-1.r.58.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\shiro\shiro-web\1.2.5\shiro-web-1.2.5.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\commons-logging\commons-logging\1.1\commons-logging-1.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\slf4j\slf4j-log4j12\1.7.21\slf4j-log4j12-1.7.21.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutzwx\1.r.58\nutzwx-1.r.58.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz-plugins-views\1.r.58\nutz-plugins-views-1.r.58.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\nutz\nutz-plugins-sfntly\1.r.58\nutz-plugins-sfntly-1.r.58.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\ibm\icu\icu4j\4.8.1.1\icu4j-4.8.1.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\cn\enilu\tools\nutzwk-code-generator\1.2\nutzwk-code-generator-1.2.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\vdurmont\emoji-java\3.1.3\emoji-java-3.1.3.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\json\json\20160212\json-20160212.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\c3p0\c3p0\0.9.1.1\c3p0-0.9.1.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\slf4j\slf4j-api\1.7.21\slf4j-api-1.7.21.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\shiro\shiro-core\1.2.5\shiro-core-1.2.5.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\commons-beanutils\commons-beanutils\1.8.3\commons-beanutils-1.8.3.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\cn\apiclub\tool\simplecaptcha\1.2.2\simplecaptcha-1.2.2.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\mysql\mysql-connector-java\5.1.39\mysql-connector-java-5.1.39.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\net\sourceforge\jtds\jtds\1.3.1\jtds-1.3.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\google\zxing\javase\3.2.1\javase-3.2.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\google\zxing\core\3.2.1\core-3.2.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\beust\jcommander\1.48\jcommander-1.48.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\net\sf\ehcache\ehcache\2.10.2.2.21\ehcache-2.10.2.2.21.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\redis\clients\jedis\2.8.1\jedis-2.8.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\commons\commons-pool2\2.4.2\commons-pool2-2.4.2.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\commons\commons-email\1.4\commons-email-1.4.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\sun\mail\javax.mail\1.5.5\javax.mail-1.5.5.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\javax\activation\activation\1.1.1\activation-1.1.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\commons\commons-lang3\3.4\commons-lang3-3.4.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\apache\shiro\shiro-all\1.3.2\shiro-all-1.3.2.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\commons-beanutils\commons-beanutils-core\1.8.3\commons-beanutils-core-1.8.3.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\ibeetl\beetl\2.5.2\beetl-2.5.2.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\antlr\antlr4-runtime\4.2\antlr4-runtime-4.2.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\abego\treelayout\org.abego.treelayout.core\1.0.1\org.abego.treelayout.core-1.0.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\antlr\antlr4-annotations\4.2\antlr4-annotations-4.2.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\org\brickred\socialauth\4.12\socialauth-4.12.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\io\jsonwebtoken\jjwt\0.6.0\jjwt-0.6.0.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\fasterxml\jackson\core\jackson-databind\2.8.1\jackson-databind-2.8.1.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\fasterxml\jackson\core\jackson-annotations\2.8.0\jackson-annotations-2.8.0.jar], Jar[path=D:\Program Files\Java\maven-3.1.1\warehouse\com\fasterxml\jackson\core\jackson-core\2.8.1\jackson-core-2.8.1.jar], Jar[path=D:\Program Files (x86)\IntelliJ IDEA\lib\idea_rt.jar]]
2016-10-28 20:43:37,130 org.nutz.resource.Scans.scan(Scans.java:262) DEBUG - Found 1 resource by src( /code/code.json ) , regex( ^(.+[.])(js|json)$ )
2016-10-28 20:43:37,132 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:48) DEBUG - loading ioc js config from [code.json]
2016-10-28 20:43:37,191 org.nutz.castor.Castors.reload(Castors.java:115) DEBUG - Using 94 castor for Castors
2016-10-28 20:43:37,196 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:56) DEBUG - Loaded 2 bean define from path=[/code/code.json] --> [dataSource, loader]
2016-10-28 20:43:37,199 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:98) INFO  - NutIoc init begin ...
2016-10-28 20:43:37,203 org.nutz.ioc.impl.NutIoc.<init>(NutIoc.java:115) INFO  - ... NutIoc init complete
2016-10-28 20:43:37,204 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'loader'<class cn.enilu.common.code.Loader>
2016-10-28 20:43:37,209 org.nutz.ioc.aop.SimpleAopMaker.<init>(SimpleAopMaker.java:79) DEBUG - Load AopConfigure for anno=org.nutz.ioc.aop.Aop by type=org.nutz.ioc.aop.config.impl.AnnotationAopConfigration
2016-10-28 20:43:37,210 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=loader
2016-10-28 20:43:37,211 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=loader
2016-10-28 20:43:37,215 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:169) DEBUG - Found IocObject(loader) in JsonLoader(paths=[/code/code.json])
2016-10-28 20:43:37,215 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - 	 >> Make...'loader'<class cn.enilu.common.code.Loader>
2016-10-28 20:43:37,216 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class cn.enilu.common.code.EntityDescLoader without AOP
2016-10-28 20:43:37,216 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'loader' to [app] 
generate carbrand ...
generate CarbrandService.java
generate CarbrandController.java
generate html:index.html
generate html:add.html
generate html:detail.html
generate html:edit.html
skip FM_carSeries
generate CarBrand ...
generate CarbrandService.java
file src\main\java\cn\wizzer\modules\services\app\CarbrandService.java exists, skipped
generate CarbrandController.java
file src\main\java\cn\wizzer\modules\controllers\platform\app\CarbrandController.java exists, skipped
generate html:index.html
file src\main\webapp\WEB-INF\views\platform\app\carbrand\index.html exists, skipped
generate html:add.html
file src\main\webapp\WEB-INF\views\platform\app\carbrand\add.html exists, skipped
generate html:detail.html
file src\main\webapp\WEB-INF\views\platform\app\carbrand\detail.html exists, skipped
generate html:edit.html
file src\main\webapp\WEB-INF\views\platform\app\carbrand\edit.html exists, skipped
skip fm_carseries
done!
Disconnected from the target VM, address: '127.0.0.1:28130', transport: 'socket'

Process finished with exit code 0

@x55admin 贴nutzwk版本,nutzwk-plugin版本,nutzwk-code-generator版本

@enilu nutzwk V3.3.1, nutzwk-plugin V1.6, nutzwk-code-generator V1.2

loader:{
    //根据实体生成代码
    //type:'cn.enilu.common.code.EntityDescLoader'
    //根据表结构生成代码
    type:'cn.enilu.common.code.TableDescLoader'
    }

根据表结构可以生成,根据实体类生成代码报以上异常

@x55admin 贴下报错的实体类代码

@enilu

package cn.qingyun.modules.models.app.pricelist;

import org.nutz.dao.entity.annotation.*;

import java.io.Serializable;
import java.util.List;


@Comment("品牌")
@Table("fm_carbrand")
public class FM_carBrand implements Serializable {

	@Id
	private Integer id;

	@Name
	@Column
	@Comment("名称")
	@ColDefine(type = ColType.VARCHAR, width = 50)
	private String name;

	@Column
	@Comment("图片地址")
	@ColDefine(type = ColType.VARCHAR, width = 150)
	private String image;

	@Column
	@Comment("开头字母")
	@ColDefine(type = ColType.VARCHAR, width = 2)
	private String alpha;

	@Column
	@Comment("显示宽度")
	@ColDefine(type = ColType.INT)
	private Integer weight;



	@Many(target = FM_carSeries.class,field = "carBrandId")
	private List<FM_carSeries> carseries;


	public List<FM_carSeries> getCarseries() {
		return carseries;
	}

	public void setCarseries(List<FM_carSeries> carseries) {
		this.carseries = carseries;
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getImage() {
		return this.image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public String getAlpha() {
		return this.alpha;
	}

	public void setAlpha(String alpha) {
		this.alpha = alpha;
	}

	public Integer getWeight() {
		return this.weight;
	}

	public void setWeight(Integer weight) {
		this.weight = weight;
	}

}

表单验证 有公用的js吗? 比如 手机号 数字 email

http://parsleyjs.org/ 用的这个 。不错 。。。

@mr-gaosai

来自炫酷的 NutzCN

使用了idea的代码生成插件,nutz版本为4,generator的依赖为1.3.2,结果运行代码生成只生成了空的文件夹,没有生成相关的代码。

@gshliang NutzWk 4.0 开发指南里已经写的非常、非常、非常、非常清楚了,这里不再赘述。

实在不好意思,没有仔细看4.0的说明。今天按照4.0的说明进行了操作,但是很不幸的没有成功。报了如下的错误:
Connected to the target VM, address: '127.0.0.1:60755', transport: 'socket'
错误: 找不到或无法加载主类 cn.wizzer.commons.code.Generator
Disconnected from the target VM, address: '127.0.0.1:60755', transport: 'socket'

@gshliang
@winstars @menglinxi
临时解决办法:

        <dependency>
            <groupId>cn.wizzer</groupId>
            <artifactId>wk-code-generator</artifactId>
            <version>4.0.1-SNAPSHOT</version>
        </dependency>

这段加到 wk-parent/pom.xml 里,这样可以使用代码生成器,但mvn install 编译的时候会提示pom.xml错误,编译项目的时候再删掉..

主要是IDEA插件的运行环境里没有找到代码生成器的jar包,如果不用上面的方法,可以手动配置系统环境变量,把jar包加进去,

我再折腾折腾看怎么解决这个矛盾……

mac 版本的idea如何添加啊
添加的时候老报
Plugin 'wk-code-ideaplugin'is incompatible with this installation

idea版本低?

不低啊!14的

升级一下吧...

正在尝试,谢谢

添加回复
请先登陆
回到顶部