gpt4 book ai didi

grails - 如何创建用于代码生成的 CLI 脚本,例如 "grails create-controller"所做的

转载 作者:行者123 更新时间:2023-12-01 14:38:06 25 4
gpt4 key购买 nike

我想创建一个命令行工具来生成一些 java 源代码...例如, Controller 类、服务类和 DTO 类。我一直试图找到 CreateController.groovy 的脚本(来自 grails),但我没有找到那个脚本。任何帮助将非常感激。我认为这可能是用 Gant 完成的?

最佳答案

I've been trying to find the scripts for CreateController.groovy (from grails), but I've had no luck finding that script.

您还没有指明要使用哪个版本的 Grails,这可能是相关的。对于最新版本的 Grails,没有 CreateController.groovycreate-controller 命令定义在 https://github.com/grails/grails-profile-repository/blob/master/profiles/web/commands/create-controller.yml .

I think it might be done with Gant?

从 Grails 2 开始就没有了。如果您使用的是 Grails 1 或 2,那么 Gant 脚本可能就是您要找的东西。对于 Grails 2.5.6,命令定义在 https://github.com/grails/grails-core/blob/bd7cc10e17d34f20cedce979724f0e3bacd4cdb4/grails-scripts/src/main/scripts/CreateController.groovy .

关于grails - 如何创建用于代码生成的 CLI 脚本,例如 "grails create-controller"所做的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58418142/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com