新增测点配置
This commit is contained in:
5
jobs/job.go
Normal file
5
jobs/job.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package jobs
|
||||
|
||||
type Job interface {
|
||||
GetJobName() string
|
||||
}
|
||||
24
jobs/test.go
Normal file
24
jobs/test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user