25 lines
442 B
Go
25 lines
442 B
Go
package jobs
|
|
|
|
import (
|
|
"energy-management-system/utils/exception"
|
|
"energy-management-system/utils/recovery"
|
|
"fmt"
|
|
"reflect"
|
|
"runtime"
|
|
)
|
|
|
|
type Test struct {
|
|
Name string
|
|
}
|
|
|
|
func (t *Test) Run() {
|
|
defer recovery.CronRecovery(runtime.FuncForPC(reflect.ValueOf(t.Run).Pointer()).Name())
|
|
exception.PM("定时任务错误")
|
|
//t.GetJobName()
|
|
fmt.Println(t.GetJobName() + "Test Run")
|
|
}
|
|
|
|
func (t *Test) GetJobName() string {
|
|
return t.Name
|
|
}
|