我原以为在Grails环境中,Spring注解应该可以直接使用,但实际上我无法让它正常工作。我还尝试了afterProperties方法,但也没有成功。
有人能发现错误吗?是否需要进行某些配置?
有人能发现错误吗?是否需要进行某些配置?
package dashboard
import javax.annotation.PostConstruct
class EmailJobSchedulerService
{
def grailsApplication
@PostConstruct
def init() {
def cronExpression = grailsApplication.config.emailAt8AmTrigger
println(cronExpression)
EmailSubscribersJob.schedule(cronExpression, new HashMap())
}
}