我最近开始在 Spring Boot 上花费更多的时间,并且开始感觉没有像应用程序这样的 shell(类似于 Grails 控制台),我可以使用存储库、服务等......在 spring boot 中是否存在这样的东西?
最佳答案
我最近推出了Spring Context from Groovy项目,它使您可以访问 Remote Shell 中的所有 bean 对象插件使用 repl groovy
交互式控制台。
看起来像这样:
$ ssh -p 2000 user@localhost
user@localhost's password:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.4.6.RELEASE) on myhost
> repl groovy
Using repl groovy
> ctx.App.myUserService.findUserByEmail("mrsarm@gmail.com")[0].id
100123
> ctx.App.myUserService.getById(100123).name
Mariano Ruiz
> ctx.App.contactDao.logger.effectiveLevel
INFO
> ctx.App.contactDao.logger.setLevel(ch.qos.logback.classic.Level.DEBUG)
关于spring - Spring Boot 的 Grails 控制台是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41606489/