build.gradle
依赖:
//定时器
compile 'org.grails.plugins:quartz:2.0.0.M4'
创建一个job,执行命令:
create-job com.test.Test
修改TestJob:
package com.test
class TestJob {
static triggers = {
}
def execute(context) {
// execute job
println "执行..."
// 获取传递过来的参数
def msg = context.mergedJobDataMap.get("tip")
println msg
}
}
控制器中动态调用:
def personPush() {
println "xxxxx"