gpt4 book ai didi

groovy - Grails 中测试/开发模式的自定义 init

转载 作者:行者123 更新时间:2023-12-02 02:09:26 26 4
gpt4 key购买 nike

我想根据当前使用的开发或测试模式在 BootStrap 类中运行特定登录。

我该怎么做?

最佳答案

来自the documentation :

class Bootstrap {
def init = { ServletContext ctx ->
environments {
production {
// prod initialization
}
test {
// test initialization
}
development {
// dev initialization
}
}
}
...
}

关于groovy - Grails 中测试/开发模式的自定义 init,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4452593/

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