如何解决使用Micronaut CLI创建应用程序,控制器
Micronaut CLI在创建应用程序时非常有用,但是CLI中没有用于创建控制器的命令。
Micronaut Version: 2.0.3
在micronaut文档中,我们有一个用于配置文件https://docs.micronaut.io/2.0.0.M3/guide/index.html#cli的命令
$ mn profile-info service
Profile: service
------------------
The service profile
Provided Commands:
--------------------
create-bean Creates a singleton bean
create-client Creates a client interface
create-controller Creates a controller and associated test
create-job Creates a job with scheduled method
create-test Creates a simple test for the project's testing framework
create-websocket-client Creates a Websocket client
create-websocket-server Creates a Websocket server
help Prints help information for a specific command
Provided Features:
------------------
...
运行命令mn profile-info service
时出现错误消息
我只有以下选项
我正在尝试从cli创建一个控制器
解决方法
配置文件仅在Micronaut 1.x版中。因此,与mn profile-info service
之类的与配置文件相关的命令在Micronaut 2.x版中不可用。
在创建项目末尾时,请输入项目目录,您可以使用以下其他mn
命令:
-
feature-diff
-生成原始项目与具有其他功能的原始项目的差异。 -
create-job
-使用计划的方法创建工作 -
create-client
-创建一个客户端界面 -
create-controller
-创建控制器和关联的测试 -
create-test
-为项目的测试框架创建一个简单的测试 -
create-bean
-创建一个单例bean -
create-websocket-client
-创建一个Websocket客户端 -
create-websocket-server
-创建一个Websocket服务器
使用-h
选项调用该命令时,您还可以查看该命令的更多说明。例如:
$ mn create-controller -h
Usage: mn create-controller [-fhvVx] CONTROLLER-NAME
Creates a controller and associated test
CONTROLLER-NAME The name of the controller to create
-f,--force Whether to overwrite existing files
-h,--help Show this help message and exit.
-v,--verbose Create verbose output.
-V,--version Print version information and exit.
-x,--stacktrace Show full stack trace when exceptions occur.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。