diff --git a/const.go b/const.go index eb834b5..2063c4e 100644 --- a/const.go +++ b/const.go @@ -1,6 +1,6 @@ package gojobs const ( - Version = "1.0.90" + Version = "1.0.91" SpecifyIpNull = "0.0.0.0" ) diff --git a/create_in.go b/create_in.go index 446e1cd..17abcc3 100644 --- a/create_in.go +++ b/create_in.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "go.dtapp.net/dorm" "go.dtapp.net/gojobs/jobs_gorm_model" "go.dtapp.net/gojobs/jobs_mongo_model" "go.dtapp.net/gostring" @@ -71,7 +72,7 @@ func (c *Client) CreateInCustomId(ctx context.Context, config *ConfigCreateInCus SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().Format(), + RunTime: dorm.NewBsonTimeCurrent(), RunIp: config.CurrentIp, }, CurrentRunInfo: jobs_mongo_model.TaskRunInfo{ @@ -82,7 +83,7 @@ func (c *Client) CreateInCustomId(ctx context.Context, config *ConfigCreateInCus SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().Format(), + RunTime: dorm.NewBsonTimeCurrent(), RunIp: config.CurrentIp, }, NextRunInfo: jobs_mongo_model.TaskRunInfo{ @@ -93,7 +94,7 @@ func (c *Client) CreateInCustomId(ctx context.Context, config *ConfigCreateInCus SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().AfterSeconds(config.Frequency).Format(), + RunTime: dorm.NewBsonTimeFromTime(gotime.Current().AfterSeconds(config.Frequency).Time), RunIp: config.CurrentIp, }, CreateTime: primitive.NewDateTimeFromTime(gotime.Current().Time), @@ -169,7 +170,7 @@ func (c *Client) CreateInCustomIdOnly(ctx context.Context, config *ConfigCreateI SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().Format(), + RunTime: dorm.NewBsonTimeCurrent(), RunIp: config.CurrentIp, }, CurrentRunInfo: jobs_mongo_model.TaskRunInfo{ @@ -180,7 +181,7 @@ func (c *Client) CreateInCustomIdOnly(ctx context.Context, config *ConfigCreateI SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().Format(), + RunTime: dorm.NewBsonTimeCurrent(), RunIp: config.CurrentIp, }, NextRunInfo: jobs_mongo_model.TaskRunInfo{ @@ -191,7 +192,7 @@ func (c *Client) CreateInCustomIdOnly(ctx context.Context, config *ConfigCreateI SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().AfterSeconds(config.Frequency).Format(), + RunTime: dorm.NewBsonTimeFromTime(gotime.Current().AfterSeconds(config.Frequency).Time), RunIp: config.CurrentIp, }, CreateTime: primitive.NewDateTimeFromTime(gotime.Current().Time), @@ -266,7 +267,7 @@ func (c *Client) CreateInCustomIdMaxNumber(ctx context.Context, config *ConfigCr SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().Format(), + RunTime: dorm.NewBsonTimeCurrent(), RunIp: config.CurrentIp, }, CurrentRunInfo: jobs_mongo_model.TaskRunInfo{ @@ -277,7 +278,7 @@ func (c *Client) CreateInCustomIdMaxNumber(ctx context.Context, config *ConfigCr SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().Format(), + RunTime: dorm.NewBsonTimeCurrent(), RunIp: config.CurrentIp, }, NextRunInfo: jobs_mongo_model.TaskRunInfo{ @@ -288,7 +289,7 @@ func (c *Client) CreateInCustomIdMaxNumber(ctx context.Context, config *ConfigCr SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().AfterSeconds(config.Frequency).Format(), + RunTime: dorm.NewBsonTimeFromTime(gotime.Current().AfterSeconds(config.Frequency).Time), RunIp: config.CurrentIp, }, CreateTime: primitive.NewDateTimeFromTime(gotime.Current().Time), @@ -367,7 +368,7 @@ func (c *Client) CreateInCustomIdMaxNumberOnly(ctx context.Context, config *Conf SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().Format(), + RunTime: dorm.NewBsonTimeCurrent(), RunIp: config.CurrentIp, }, CurrentRunInfo: jobs_mongo_model.TaskRunInfo{ @@ -378,7 +379,7 @@ func (c *Client) CreateInCustomIdMaxNumberOnly(ctx context.Context, config *Conf SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().Format(), + RunTime: dorm.NewBsonTimeCurrent(), RunIp: config.CurrentIp, }, NextRunInfo: jobs_mongo_model.TaskRunInfo{ @@ -389,7 +390,7 @@ func (c *Client) CreateInCustomIdMaxNumberOnly(ctx context.Context, config *Conf SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().AfterSeconds(config.Frequency).Format(), + RunTime: dorm.NewBsonTimeFromTime(gotime.Current().AfterSeconds(config.Frequency).Time), RunIp: config.CurrentIp, }, CreateTime: primitive.NewDateTimeFromTime(gotime.Current().Time), diff --git a/create_wait.go b/create_wait.go index 45897a4..b6cb7ca 100644 --- a/create_wait.go +++ b/create_wait.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "go.dtapp.net/dorm" "go.dtapp.net/gojobs/jobs_gorm_model" "go.dtapp.net/gojobs/jobs_mongo_model" "go.dtapp.net/gostring" @@ -71,7 +72,7 @@ func (c *Client) CreateWaitCustomId(ctx context.Context, config *ConfigCreateWai SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().Format(), + RunTime: dorm.NewBsonTimeCurrent(), RunIp: config.CurrentIp, }, CurrentRunInfo: jobs_mongo_model.TaskRunInfo{ @@ -82,7 +83,7 @@ func (c *Client) CreateWaitCustomId(ctx context.Context, config *ConfigCreateWai SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().Format(), + RunTime: dorm.NewBsonTimeCurrent(), RunIp: config.CurrentIp, }, NextRunInfo: jobs_mongo_model.TaskRunInfo{ @@ -93,7 +94,7 @@ func (c *Client) CreateWaitCustomId(ctx context.Context, config *ConfigCreateWai SystemCpuQuantity: c.config.systemCpuQuantity, GoVersion: c.config.goVersion, SdkVersion: c.config.sdkVersion, - RunTime: gotime.Current().AfterSeconds(config.Frequency).Format(), + RunTime: dorm.NewBsonTimeFromTime(gotime.Current().AfterSeconds(config.Frequency).Time), RunIp: config.CurrentIp, }, CreateTime: primitive.NewDateTimeFromTime(gotime.Current().Time), diff --git a/jobs_mongo_model/task.go b/jobs_mongo_model/task.go index 58e9838..34aee3a 100644 --- a/jobs_mongo_model/task.go +++ b/jobs_mongo_model/task.go @@ -1,20 +1,21 @@ package jobs_mongo_model import ( + "go.dtapp.net/dorm" "go.mongodb.org/mongo-driver/bson/primitive" ) type TaskRunInfo struct { - SystemHostName string `json:"system_host_name,omitempty" bson:"system_host_name,omitempty"` //【系统】主机名 - SystemInsideIp string `json:"system_inside_ip,omitempty" bson:"system_inside_ip,omitempty"` //【系统】内网ip - SystemOs string `json:"system_os,omitempty" bson:"system_os,omitempty"` //【系统】系统类型 - SystemArch string `json:"system_arch,omitempty" bson:"system_arch,omitempty"` //【系统】系统架构 - SystemCpuQuantity int `json:"system_cpu_quantity,omitempty" bson:"system_cpu_quantity,omitempty"` //【系统】CPU核数 - GoVersion string `json:"go_version,omitempty" bson:"go_version,omitempty"` //【程序】Go版本 - SdkVersion string `json:"sdk_version,omitempty" bson:"sdk_version,omitempty"` //【程序】Sdk版本 - RunTime string `json:"run_time,omitempty" bson:"run_time,omitempty"` //【系统】运行时间 - RunIp string `json:"run_ip,omitempty" bson:"run_ip,omitempty"` //【系统】外网ip - RunResult string `json:"run_result,omitempty" bson:"run_result,omitempty"` //【系统】结果 + SystemHostName string `json:"system_host_name,omitempty" bson:"system_host_name,omitempty"` //【系统】主机名 + SystemInsideIp string `json:"system_inside_ip,omitempty" bson:"system_inside_ip,omitempty"` //【系统】内网ip + SystemOs string `json:"system_os,omitempty" bson:"system_os,omitempty"` //【系统】系统类型 + SystemArch string `json:"system_arch,omitempty" bson:"system_arch,omitempty"` //【系统】系统架构 + SystemCpuQuantity int `json:"system_cpu_quantity,omitempty" bson:"system_cpu_quantity,omitempty"` //【系统】CPU核数 + GoVersion string `json:"go_version,omitempty" bson:"go_version,omitempty"` //【程序】Go版本 + SdkVersion string `json:"sdk_version,omitempty" bson:"sdk_version,omitempty"` //【程序】Sdk版本 + RunTime dorm.BsonTime `json:"run_time,omitempty" bson:"run_time,omitempty"` //【系统】运行时间 + RunIp string `json:"run_ip,omitempty" bson:"run_ip,omitempty"` //【系统】外网ip + RunResult string `json:"run_result,omitempty" bson:"run_result,omitempty"` //【系统】结果 } // Task 任务