From 505412e7778e87a6068c9afbb9f3d80dda54b7ae Mon Sep 17 00:00:00 2001 From: bx1834938347-prog Date: Thu, 18 Dec 2025 11:25:00 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=96=B0=E5=A2=9E=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E8=B0=83=E5=BA=A6=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/cron/cron.pb.go | 1802 +++++++++++++++++++++++++++++++++ api/cron/cron.validator.pb.go | 129 +++ api/cron/cron_triple.pb.go | 417 ++++++++ conf/dubbogo.yaml | 83 +- docs/dev/dubbogo.yaml | 3 + docs/prod/dubbogo.yaml | 3 + docs/test/dubbogo.yaml | 3 + pkg/router/cron.go | 23 + pkg/router/router.go | 1 + pkg/service/cron/cron.go | 135 +++ pkg/service/init.go | 3 + 11 files changed, 2592 insertions(+), 10 deletions(-) create mode 100644 api/cron/cron.pb.go create mode 100644 api/cron/cron.validator.pb.go create mode 100644 api/cron/cron_triple.pb.go create mode 100644 pkg/router/cron.go create mode 100644 pkg/service/cron/cron.go diff --git a/api/cron/cron.pb.go b/api/cron/cron.pb.go new file mode 100644 index 0000000..b92be90 --- /dev/null +++ b/api/cron/cron.pb.go @@ -0,0 +1,1802 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.10 +// protoc v6.32.0 +// source: pb/cron.proto + +package cron + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CommonIDRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommonIDRequest) Reset() { + *x = CommonIDRequest{} + mi := &file_pb_cron_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommonIDRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonIDRequest) ProtoMessage() {} + +func (x *CommonIDRequest) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommonIDRequest.ProtoReflect.Descriptor instead. +func (*CommonIDRequest) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{0} +} + +func (x *CommonIDRequest) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +type CommonResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommonResponse) Reset() { + *x = CommonResponse{} + mi := &file_pb_cron_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommonResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonResponse) ProtoMessage() {} + +func (x *CommonResponse) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommonResponse.ProtoReflect.Descriptor instead. +func (*CommonResponse) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{1} +} + +func (x *CommonResponse) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *CommonResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +// 定时任务 +type ScheduleTask struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` + TaskTitle string `protobuf:"bytes,2,opt,name=task_title,json=taskTitle,proto3" json:"task_title"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description"` + PeriodType int32 `protobuf:"varint,4,opt,name=period_type,json=periodType,proto3" json:"period_type"` + CronExpression string `protobuf:"bytes,5,opt,name=cron_expression,json=cronExpression,proto3" json:"cron_expression"` + Weekdays []int32 `protobuf:"varint,6,rep,packed,name=weekdays,proto3" json:"weekdays"` + CustomDays []string `protobuf:"bytes,7,rep,name=custom_days,json=customDays,proto3" json:"custom_days"` + StartDate string `protobuf:"bytes,8,opt,name=start_date,json=startDate,proto3" json:"start_date"` + ExecuteStartTime string `protobuf:"bytes,9,opt,name=execute_start_time,json=executeStartTime,proto3" json:"execute_start_time"` + ExecuteEndTime string `protobuf:"bytes,10,opt,name=execute_end_time,json=executeEndTime,proto3" json:"execute_end_time"` + LastRunTime string `protobuf:"bytes,11,opt,name=last_run_time,json=lastRunTime,proto3" json:"last_run_time"` + NextRunTime string `protobuf:"bytes,12,opt,name=next_run_time,json=nextRunTime,proto3" json:"next_run_time"` + Status int32 `protobuf:"varint,13,opt,name=status,proto3" json:"status"` + Remark string `protobuf:"bytes,15,opt,name=remark,proto3" json:"remark"` + CreatedAt string `protobuf:"bytes,16,opt,name=created_at,json=createdAt,proto3" json:"created_at"` + UpdatedAt string `protobuf:"bytes,17,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at"` + TaskDetail *TaskDetail `protobuf:"bytes,18,opt,name=task_detail,json=taskDetail,proto3" json:"task_detail"` + ExecutionRecords []*ExecutionRecord `protobuf:"bytes,19,rep,name=execution_records,json=executionRecords,proto3" json:"execution_records"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ScheduleTask) Reset() { + *x = ScheduleTask{} + mi := &file_pb_cron_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ScheduleTask) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ScheduleTask) ProtoMessage() {} + +func (x *ScheduleTask) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ScheduleTask.ProtoReflect.Descriptor instead. +func (*ScheduleTask) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{2} +} + +func (x *ScheduleTask) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ScheduleTask) GetTaskTitle() string { + if x != nil { + return x.TaskTitle + } + return "" +} + +func (x *ScheduleTask) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *ScheduleTask) GetPeriodType() int32 { + if x != nil { + return x.PeriodType + } + return 0 +} + +func (x *ScheduleTask) GetCronExpression() string { + if x != nil { + return x.CronExpression + } + return "" +} + +func (x *ScheduleTask) GetWeekdays() []int32 { + if x != nil { + return x.Weekdays + } + return nil +} + +func (x *ScheduleTask) GetCustomDays() []string { + if x != nil { + return x.CustomDays + } + return nil +} + +func (x *ScheduleTask) GetStartDate() string { + if x != nil { + return x.StartDate + } + return "" +} + +func (x *ScheduleTask) GetExecuteStartTime() string { + if x != nil { + return x.ExecuteStartTime + } + return "" +} + +func (x *ScheduleTask) GetExecuteEndTime() string { + if x != nil { + return x.ExecuteEndTime + } + return "" +} + +func (x *ScheduleTask) GetLastRunTime() string { + if x != nil { + return x.LastRunTime + } + return "" +} + +func (x *ScheduleTask) GetNextRunTime() string { + if x != nil { + return x.NextRunTime + } + return "" +} + +func (x *ScheduleTask) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ScheduleTask) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *ScheduleTask) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +func (x *ScheduleTask) GetUpdatedAt() string { + if x != nil { + return x.UpdatedAt + } + return "" +} + +func (x *ScheduleTask) GetTaskDetail() *TaskDetail { + if x != nil { + return x.TaskDetail + } + return nil +} + +func (x *ScheduleTask) GetExecutionRecords() []*ExecutionRecord { + if x != nil { + return x.ExecutionRecords + } + return nil +} + +// 执行记录 +type ExecutionRecord struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskId int32 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id"` // 任务ID + ExecutionDate string `protobuf:"bytes,2,opt,name=execution_date,json=executionDate,proto3" json:"execution_date"` // 执行日期 + StartTime string `protobuf:"bytes,3,opt,name=start_time,json=startTime,proto3" json:"start_time"` // 开始时间 + EndTime string `protobuf:"bytes,4,opt,name=end_time,json=endTime,proto3" json:"end_time"` // 结束时间 + Duration int32 `protobuf:"varint,5,opt,name=duration,proto3" json:"duration"` // 执行时长(秒) + Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status"` // 执行状态:1(进行中),2(已完成) + Result int32 `protobuf:"varint,7,opt,name=result,proto3" json:"result"` // 执行结果:1(成功),2(失败),3(部分成功) + TotalArtists int32 `protobuf:"varint,8,opt,name=total_artists,json=totalArtists,proto3" json:"total_artists"` // 艺人总数 + SuccessCount int32 `protobuf:"varint,9,opt,name=success_count,json=successCount,proto3" json:"success_count"` // 成功数量 + FailedCount int32 `protobuf:"varint,10,opt,name=failed_count,json=failedCount,proto3" json:"failed_count"` // 失败数量 + SkippedCount int32 `protobuf:"varint,11,opt,name=skipped_count,json=skippedCount,proto3" json:"skipped_count"` // 跳过数量 + Artists string `protobuf:"bytes,12,opt,name=artists,proto3" json:"artists"` // 艺人列表(JSON 格式) + ExecutionResults []*ExecutionResult `protobuf:"bytes,13,rep,name=execution_results,json=executionResults,proto3" json:"execution_results"` + TaskTitle string `protobuf:"bytes,14,opt,name=task_title,json=taskTitle,proto3" json:"task_title"` //任务标题 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExecutionRecord) Reset() { + *x = ExecutionRecord{} + mi := &file_pb_cron_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExecutionRecord) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecutionRecord) ProtoMessage() {} + +func (x *ExecutionRecord) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecutionRecord.ProtoReflect.Descriptor instead. +func (*ExecutionRecord) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{3} +} + +func (x *ExecutionRecord) GetTaskId() int32 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *ExecutionRecord) GetExecutionDate() string { + if x != nil { + return x.ExecutionDate + } + return "" +} + +func (x *ExecutionRecord) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *ExecutionRecord) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +func (x *ExecutionRecord) GetDuration() int32 { + if x != nil { + return x.Duration + } + return 0 +} + +func (x *ExecutionRecord) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ExecutionRecord) GetResult() int32 { + if x != nil { + return x.Result + } + return 0 +} + +func (x *ExecutionRecord) GetTotalArtists() int32 { + if x != nil { + return x.TotalArtists + } + return 0 +} + +func (x *ExecutionRecord) GetSuccessCount() int32 { + if x != nil { + return x.SuccessCount + } + return 0 +} + +func (x *ExecutionRecord) GetFailedCount() int32 { + if x != nil { + return x.FailedCount + } + return 0 +} + +func (x *ExecutionRecord) GetSkippedCount() int32 { + if x != nil { + return x.SkippedCount + } + return 0 +} + +func (x *ExecutionRecord) GetArtists() string { + if x != nil { + return x.Artists + } + return "" +} + +func (x *ExecutionRecord) GetExecutionResults() []*ExecutionResult { + if x != nil { + return x.ExecutionResults + } + return nil +} + +func (x *ExecutionRecord) GetTaskTitle() string { + if x != nil { + return x.TaskTitle + } + return "" +} + +// 执行结果 +type ExecutionResult struct { + state protoimpl.MessageState `protogen:"open.v1"` + ExecutionId int32 `protobuf:"varint,1,opt,name=execution_id,json=executionId,proto3" json:"execution_id"` // 执行记录ID + TaskId int32 `protobuf:"varint,2,opt,name=task_id,json=taskId,proto3" json:"task_id"` // 任务ID + WorkUuid string `protobuf:"bytes,3,opt,name=work_uuid,json=workUuid,proto3" json:"work_uuid"` // 任务UUID + ArtistId int32 `protobuf:"varint,4,opt,name=artist_id,json=artistId,proto3" json:"artist_id"` // 艺人ID + ArtistName string `protobuf:"bytes,5,opt,name=artist_name,json=artistName,proto3" json:"artist_name"` // 艺人名称 + TaskTitle string `protobuf:"bytes,6,opt,name=task_title,json=taskTitle,proto3" json:"task_title"` // 任务标题 + StartTime string `protobuf:"bytes,7,opt,name=start_time,json=startTime,proto3" json:"start_time"` // 开始时间 + EndTime string `protobuf:"bytes,8,opt,name=end_time,json=endTime,proto3" json:"end_time"` // 结束时间 + Duration int32 `protobuf:"varint,9,opt,name=duration,proto3" json:"duration"` // 执行时长(秒) + Status int32 `protobuf:"varint,10,opt,name=status,proto3" json:"status"` // 执行状态:1(处理中),2(已完成) + Result int32 `protobuf:"varint,11,opt,name=result,proto3" json:"result"` // 执行结果:1(成功),2(失败) + ResultDesc string `protobuf:"bytes,12,opt,name=result_desc,json=resultDesc,proto3" json:"result_desc"` // 结果描述 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExecutionResult) Reset() { + *x = ExecutionResult{} + mi := &file_pb_cron_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExecutionResult) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExecutionResult) ProtoMessage() {} + +func (x *ExecutionResult) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[4] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ExecutionResult.ProtoReflect.Descriptor instead. +func (*ExecutionResult) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{4} +} + +func (x *ExecutionResult) GetExecutionId() int32 { + if x != nil { + return x.ExecutionId + } + return 0 +} + +func (x *ExecutionResult) GetTaskId() int32 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *ExecutionResult) GetWorkUuid() string { + if x != nil { + return x.WorkUuid + } + return "" +} + +func (x *ExecutionResult) GetArtistId() int32 { + if x != nil { + return x.ArtistId + } + return 0 +} + +func (x *ExecutionResult) GetArtistName() string { + if x != nil { + return x.ArtistName + } + return "" +} + +func (x *ExecutionResult) GetTaskTitle() string { + if x != nil { + return x.TaskTitle + } + return "" +} + +func (x *ExecutionResult) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *ExecutionResult) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +func (x *ExecutionResult) GetDuration() int32 { + if x != nil { + return x.Duration + } + return 0 +} + +func (x *ExecutionResult) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *ExecutionResult) GetResult() int32 { + if x != nil { + return x.Result + } + return 0 +} + +func (x *ExecutionResult) GetResultDesc() string { + if x != nil { + return x.ResultDesc + } + return "" +} + +// 任务详情 +type TaskDetail struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` + TaskId uint32 `protobuf:"varint,2,opt,name=task_id,json=taskId,proto3" json:"task_id"` + ArtistCount int32 `protobuf:"varint,3,opt,name=artist_count,json=artistCount,proto3" json:"artist_count"` + Artists []*ArtistInfo `protobuf:"bytes,4,rep,name=artists,proto3" json:"artists"` + Num int32 `protobuf:"varint,5,opt,name=num,proto3" json:"num"` + CreatedAt string `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at"` + UpdatedAt string `protobuf:"bytes,7,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TaskDetail) Reset() { + *x = TaskDetail{} + mi := &file_pb_cron_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskDetail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskDetail) ProtoMessage() {} + +func (x *TaskDetail) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TaskDetail.ProtoReflect.Descriptor instead. +func (*TaskDetail) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{5} +} + +func (x *TaskDetail) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *TaskDetail) GetTaskId() uint32 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *TaskDetail) GetArtistCount() int32 { + if x != nil { + return x.ArtistCount + } + return 0 +} + +func (x *TaskDetail) GetArtists() []*ArtistInfo { + if x != nil { + return x.Artists + } + return nil +} + +func (x *TaskDetail) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *TaskDetail) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +func (x *TaskDetail) GetUpdatedAt() string { + if x != nil { + return x.UpdatedAt + } + return "" +} + +type ArtistInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ArtistInfo) Reset() { + *x = ArtistInfo{} + mi := &file_pb_cron_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ArtistInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ArtistInfo) ProtoMessage() {} + +func (x *ArtistInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[6] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ArtistInfo.ProtoReflect.Descriptor instead. +func (*ArtistInfo) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{6} +} + +func (x *ArtistInfo) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ArtistInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// 创建定时任务请求 +type CreateScheduleTaskRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + TaskTitle string `protobuf:"bytes,1,opt,name=task_title,json=taskTitle,proto3" json:"task_title"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description"` + PeriodType int32 `protobuf:"varint,3,opt,name=period_type,json=periodType,proto3" json:"period_type"` + Weekdays []int32 `protobuf:"varint,4,rep,packed,name=weekdays,proto3" json:"weekdays"` + CustomDays []string `protobuf:"bytes,5,rep,name=custom_days,json=customDays,proto3" json:"custom_days"` + StartDate string `protobuf:"bytes,6,opt,name=start_date,json=startDate,proto3" json:"start_date"` + ExecuteStartTime string `protobuf:"bytes,7,opt,name=execute_start_time,json=executeStartTime,proto3" json:"execute_start_time"` + ExecuteEndTime string `protobuf:"bytes,8,opt,name=execute_end_time,json=executeEndTime,proto3" json:"execute_end_time"` + Remark string `protobuf:"bytes,10,opt,name=remark,proto3" json:"remark"` + TaskDetail *TaskDetailRequest `protobuf:"bytes,11,opt,name=task_detail,json=taskDetail,proto3" json:"task_detail"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateScheduleTaskRequest) Reset() { + *x = CreateScheduleTaskRequest{} + mi := &file_pb_cron_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateScheduleTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateScheduleTaskRequest) ProtoMessage() {} + +func (x *CreateScheduleTaskRequest) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateScheduleTaskRequest.ProtoReflect.Descriptor instead. +func (*CreateScheduleTaskRequest) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{7} +} + +func (x *CreateScheduleTaskRequest) GetTaskTitle() string { + if x != nil { + return x.TaskTitle + } + return "" +} + +func (x *CreateScheduleTaskRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreateScheduleTaskRequest) GetPeriodType() int32 { + if x != nil { + return x.PeriodType + } + return 0 +} + +func (x *CreateScheduleTaskRequest) GetWeekdays() []int32 { + if x != nil { + return x.Weekdays + } + return nil +} + +func (x *CreateScheduleTaskRequest) GetCustomDays() []string { + if x != nil { + return x.CustomDays + } + return nil +} + +func (x *CreateScheduleTaskRequest) GetStartDate() string { + if x != nil { + return x.StartDate + } + return "" +} + +func (x *CreateScheduleTaskRequest) GetExecuteStartTime() string { + if x != nil { + return x.ExecuteStartTime + } + return "" +} + +func (x *CreateScheduleTaskRequest) GetExecuteEndTime() string { + if x != nil { + return x.ExecuteEndTime + } + return "" +} + +func (x *CreateScheduleTaskRequest) GetRemark() string { + if x != nil { + return x.Remark + } + return "" +} + +func (x *CreateScheduleTaskRequest) GetTaskDetail() *TaskDetailRequest { + if x != nil { + return x.TaskDetail + } + return nil +} + +// 任务详情请求 +type TaskDetailRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ArtistCount int32 `protobuf:"varint,1,opt,name=artist_count,json=artistCount,proto3" json:"artist_count"` + Artists []*ArtistInfo `protobuf:"bytes,2,rep,name=artists,proto3" json:"artists"` + Num int32 `protobuf:"varint,3,opt,name=num,proto3" json:"num"` + ContentType int32 `protobuf:"varint,4,opt,name=content_type,json=contentType,proto3" json:"content_type"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TaskDetailRequest) Reset() { + *x = TaskDetailRequest{} + mi := &file_pb_cron_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TaskDetailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TaskDetailRequest) ProtoMessage() {} + +func (x *TaskDetailRequest) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TaskDetailRequest.ProtoReflect.Descriptor instead. +func (*TaskDetailRequest) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{8} +} + +func (x *TaskDetailRequest) GetArtistCount() int32 { + if x != nil { + return x.ArtistCount + } + return 0 +} + +func (x *TaskDetailRequest) GetArtists() []*ArtistInfo { + if x != nil { + return x.Artists + } + return nil +} + +func (x *TaskDetailRequest) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *TaskDetailRequest) GetContentType() int32 { + if x != nil { + return x.ContentType + } + return 0 +} + +type CreateScheduleTaskResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message"` + Data *ScheduleTask `protobuf:"bytes,3,opt,name=data,proto3" json:"data"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CreateScheduleTaskResponse) Reset() { + *x = CreateScheduleTaskResponse{} + mi := &file_pb_cron_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateScheduleTaskResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateScheduleTaskResponse) ProtoMessage() {} + +func (x *CreateScheduleTaskResponse) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateScheduleTaskResponse.ProtoReflect.Descriptor instead. +func (*CreateScheduleTaskResponse) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{9} +} + +func (x *CreateScheduleTaskResponse) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *CreateScheduleTaskResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *CreateScheduleTaskResponse) GetData() *ScheduleTask { + if x != nil { + return x.Data + } + return nil +} + +type GetListScheduleTaskRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page"` + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size"` + TaskTitle string `protobuf:"bytes,3,opt,name=task_title,json=taskTitle,proto3" json:"task_title"` //任务标题 + PeriodType string `protobuf:"bytes,4,opt,name=period_type,json=periodType,proto3" json:"period_type"` //任务类型 + StartTime string `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3" json:"start_time"` //开始日期 + EndTime string `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3" json:"end_time"` //结束日期 + Status int32 `protobuf:"varint,7,opt,name=Status,proto3" json:"Status"` // 状态 + ContentType int32 `protobuf:"varint,8,opt,name=content_type,json=contentType,proto3" json:"content_type"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetListScheduleTaskRequest) Reset() { + *x = GetListScheduleTaskRequest{} + mi := &file_pb_cron_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetListScheduleTaskRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListScheduleTaskRequest) ProtoMessage() {} + +func (x *GetListScheduleTaskRequest) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListScheduleTaskRequest.ProtoReflect.Descriptor instead. +func (*GetListScheduleTaskRequest) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{10} +} + +func (x *GetListScheduleTaskRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetListScheduleTaskRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *GetListScheduleTaskRequest) GetTaskTitle() string { + if x != nil { + return x.TaskTitle + } + return "" +} + +func (x *GetListScheduleTaskRequest) GetPeriodType() string { + if x != nil { + return x.PeriodType + } + return "" +} + +func (x *GetListScheduleTaskRequest) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *GetListScheduleTaskRequest) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +func (x *GetListScheduleTaskRequest) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *GetListScheduleTaskRequest) GetContentType() int32 { + if x != nil { + return x.ContentType + } + return 0 +} + +type GetListScheduleTaskResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message"` + Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total"` + Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page"` + Size int32 `protobuf:"varint,5,opt,name=size,proto3" json:"size"` + Data []*ScheduleTask `protobuf:"bytes,6,rep,name=data,proto3" json:"data"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetListScheduleTaskResponse) Reset() { + *x = GetListScheduleTaskResponse{} + mi := &file_pb_cron_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetListScheduleTaskResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListScheduleTaskResponse) ProtoMessage() {} + +func (x *GetListScheduleTaskResponse) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListScheduleTaskResponse.ProtoReflect.Descriptor instead. +func (*GetListScheduleTaskResponse) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{11} +} + +func (x *GetListScheduleTaskResponse) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *GetListScheduleTaskResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *GetListScheduleTaskResponse) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *GetListScheduleTaskResponse) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetListScheduleTaskResponse) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *GetListScheduleTaskResponse) GetData() []*ScheduleTask { + if x != nil { + return x.Data + } + return nil +} + +type GetListExecutionRecordRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page"` // 页码 + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size"` // 每页显示的记录数 + TaskTitle string `protobuf:"bytes,3,opt,name=task_title,json=taskTitle,proto3" json:"task_title"` // 任务标题 + PeriodType string `protobuf:"bytes,4,opt,name=period_type,json=periodType,proto3" json:"period_type"` // 执行周期类型 + StartTime string `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3" json:"start_time"` // 起始时间 + EndTime string `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3" json:"end_time"` // 结束时间 + Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status"` //状态 + Result int32 `protobuf:"varint,8,opt,name=result,proto3" json:"result"` //结果 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetListExecutionRecordRequest) Reset() { + *x = GetListExecutionRecordRequest{} + mi := &file_pb_cron_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetListExecutionRecordRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListExecutionRecordRequest) ProtoMessage() {} + +func (x *GetListExecutionRecordRequest) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListExecutionRecordRequest.ProtoReflect.Descriptor instead. +func (*GetListExecutionRecordRequest) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{12} +} + +func (x *GetListExecutionRecordRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetListExecutionRecordRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *GetListExecutionRecordRequest) GetTaskTitle() string { + if x != nil { + return x.TaskTitle + } + return "" +} + +func (x *GetListExecutionRecordRequest) GetPeriodType() string { + if x != nil { + return x.PeriodType + } + return "" +} + +func (x *GetListExecutionRecordRequest) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *GetListExecutionRecordRequest) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +func (x *GetListExecutionRecordRequest) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *GetListExecutionRecordRequest) GetResult() int32 { + if x != nil { + return x.Result + } + return 0 +} + +type GetListExecutionRecordResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应代码 + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message"` // 响应消息 + Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total"` // 总记录数 + Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page"` // 当前页码 + Size int32 `protobuf:"varint,5,opt,name=size,proto3" json:"size"` // 当前页的记录数 + Data []*ExecutionRecord `protobuf:"bytes,6,rep,name=data,proto3" json:"data"` // 执行记录数据 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetListExecutionRecordResponse) Reset() { + *x = GetListExecutionRecordResponse{} + mi := &file_pb_cron_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetListExecutionRecordResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListExecutionRecordResponse) ProtoMessage() {} + +func (x *GetListExecutionRecordResponse) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListExecutionRecordResponse.ProtoReflect.Descriptor instead. +func (*GetListExecutionRecordResponse) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{13} +} + +func (x *GetListExecutionRecordResponse) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *GetListExecutionRecordResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *GetListExecutionRecordResponse) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *GetListExecutionRecordResponse) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetListExecutionRecordResponse) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *GetListExecutionRecordResponse) GetData() []*ExecutionRecord { + if x != nil { + return x.Data + } + return nil +} + +// 请求:获取执行结果列表的请求参数 +type GetListExecutionResultRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page"` // 页码 + PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size"` // 每页显示的记录数 + TaskTitle string `protobuf:"bytes,3,opt,name=task_title,json=taskTitle,proto3" json:"task_title"` // 任务标题 + ArtistName string `protobuf:"bytes,4,opt,name=artist_name,json=artistName,proto3" json:"artist_name"` // 艺人名称 + StartTime string `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3" json:"start_time"` // 起始时间 + EndTime string `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3" json:"end_time"` // 结束时间 + Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status"` // 执行状态:1(处理中),2(已完成) + Result int32 `protobuf:"varint,8,opt,name=result,proto3" json:"result"` // 执行结果:1(成功),2(失败) + ExecutionId int64 `protobuf:"varint,9,opt,name=execution_id,json=executionId,proto3" json:"execution_id"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetListExecutionResultRequest) Reset() { + *x = GetListExecutionResultRequest{} + mi := &file_pb_cron_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetListExecutionResultRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListExecutionResultRequest) ProtoMessage() {} + +func (x *GetListExecutionResultRequest) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListExecutionResultRequest.ProtoReflect.Descriptor instead. +func (*GetListExecutionResultRequest) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{14} +} + +func (x *GetListExecutionResultRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetListExecutionResultRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *GetListExecutionResultRequest) GetTaskTitle() string { + if x != nil { + return x.TaskTitle + } + return "" +} + +func (x *GetListExecutionResultRequest) GetArtistName() string { + if x != nil { + return x.ArtistName + } + return "" +} + +func (x *GetListExecutionResultRequest) GetStartTime() string { + if x != nil { + return x.StartTime + } + return "" +} + +func (x *GetListExecutionResultRequest) GetEndTime() string { + if x != nil { + return x.EndTime + } + return "" +} + +func (x *GetListExecutionResultRequest) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *GetListExecutionResultRequest) GetResult() int32 { + if x != nil { + return x.Result + } + return 0 +} + +func (x *GetListExecutionResultRequest) GetExecutionId() int64 { + if x != nil { + return x.ExecutionId + } + return 0 +} + +// 响应:执行结果列表的响应 +type GetListExecutionResultResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应代码 + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message"` // 响应消息 + Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total"` // 总记录数 + Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page"` // 当前页码 + Size int32 `protobuf:"varint,5,opt,name=size,proto3" json:"size"` // 当前页的记录数 + Data []*ExecutionResult `protobuf:"bytes,6,rep,name=data,proto3" json:"data"` // 执行结果列表 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetListExecutionResultResponse) Reset() { + *x = GetListExecutionResultResponse{} + mi := &file_pb_cron_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetListExecutionResultResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetListExecutionResultResponse) ProtoMessage() {} + +func (x *GetListExecutionResultResponse) ProtoReflect() protoreflect.Message { + mi := &file_pb_cron_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetListExecutionResultResponse.ProtoReflect.Descriptor instead. +func (*GetListExecutionResultResponse) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{15} +} + +func (x *GetListExecutionResultResponse) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *GetListExecutionResultResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *GetListExecutionResultResponse) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *GetListExecutionResultResponse) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetListExecutionResultResponse) GetSize() int32 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *GetListExecutionResultResponse) GetData() []*ExecutionResult { + if x != nil { + return x.Data + } + return nil +} + +var File_pb_cron_proto protoreflect.FileDescriptor + +const file_pb_cron_proto_rawDesc = "" + + "\n" + + "\rpb/cron.proto\x12\x04cron\"!\n" + + "\x0fCommonIDRequest\x12\x0e\n" + + "\x02id\x18\x01 \x01(\rR\x02id\">\n" + + "\x0eCommonResponse\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"\x8a\x05\n" + + "\fScheduleTask\x12\x0e\n" + + "\x02id\x18\x01 \x01(\rR\x02id\x12\x1d\n" + + "\n" + + "task_title\x18\x02 \x01(\tR\ttaskTitle\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x1f\n" + + "\vperiod_type\x18\x04 \x01(\x05R\n" + + "periodType\x12'\n" + + "\x0fcron_expression\x18\x05 \x01(\tR\x0ecronExpression\x12\x1a\n" + + "\bweekdays\x18\x06 \x03(\x05R\bweekdays\x12\x1f\n" + + "\vcustom_days\x18\a \x03(\tR\n" + + "customDays\x12\x1d\n" + + "\n" + + "start_date\x18\b \x01(\tR\tstartDate\x12,\n" + + "\x12execute_start_time\x18\t \x01(\tR\x10executeStartTime\x12(\n" + + "\x10execute_end_time\x18\n" + + " \x01(\tR\x0eexecuteEndTime\x12\"\n" + + "\rlast_run_time\x18\v \x01(\tR\vlastRunTime\x12\"\n" + + "\rnext_run_time\x18\f \x01(\tR\vnextRunTime\x12\x16\n" + + "\x06status\x18\r \x01(\x05R\x06status\x12\x16\n" + + "\x06remark\x18\x0f \x01(\tR\x06remark\x12\x1d\n" + + "\n" + + "created_at\x18\x10 \x01(\tR\tcreatedAt\x12\x1d\n" + + "\n" + + "updated_at\x18\x11 \x01(\tR\tupdatedAt\x121\n" + + "\vtask_detail\x18\x12 \x01(\v2\x10.cron.TaskDetailR\n" + + "taskDetail\x12B\n" + + "\x11execution_records\x18\x13 \x03(\v2\x15.cron.ExecutionRecordR\x10executionRecords\"\xe6\x03\n" + + "\x0fExecutionRecord\x12\x17\n" + + "\atask_id\x18\x01 \x01(\x05R\x06taskId\x12%\n" + + "\x0eexecution_date\x18\x02 \x01(\tR\rexecutionDate\x12\x1d\n" + + "\n" + + "start_time\x18\x03 \x01(\tR\tstartTime\x12\x19\n" + + "\bend_time\x18\x04 \x01(\tR\aendTime\x12\x1a\n" + + "\bduration\x18\x05 \x01(\x05R\bduration\x12\x16\n" + + "\x06status\x18\x06 \x01(\x05R\x06status\x12\x16\n" + + "\x06result\x18\a \x01(\x05R\x06result\x12#\n" + + "\rtotal_artists\x18\b \x01(\x05R\ftotalArtists\x12#\n" + + "\rsuccess_count\x18\t \x01(\x05R\fsuccessCount\x12!\n" + + "\ffailed_count\x18\n" + + " \x01(\x05R\vfailedCount\x12#\n" + + "\rskipped_count\x18\v \x01(\x05R\fskippedCount\x12\x18\n" + + "\aartists\x18\f \x01(\tR\aartists\x12B\n" + + "\x11execution_results\x18\r \x03(\v2\x15.cron.ExecutionResultR\x10executionResults\x12\x1d\n" + + "\n" + + "task_title\x18\x0e \x01(\tR\ttaskTitle\"\xee\x02\n" + + "\x0fExecutionResult\x12!\n" + + "\fexecution_id\x18\x01 \x01(\x05R\vexecutionId\x12\x17\n" + + "\atask_id\x18\x02 \x01(\x05R\x06taskId\x12\x1b\n" + + "\twork_uuid\x18\x03 \x01(\tR\bworkUuid\x12\x1b\n" + + "\tartist_id\x18\x04 \x01(\x05R\bartistId\x12\x1f\n" + + "\vartist_name\x18\x05 \x01(\tR\n" + + "artistName\x12\x1d\n" + + "\n" + + "task_title\x18\x06 \x01(\tR\ttaskTitle\x12\x1d\n" + + "\n" + + "start_time\x18\a \x01(\tR\tstartTime\x12\x19\n" + + "\bend_time\x18\b \x01(\tR\aendTime\x12\x1a\n" + + "\bduration\x18\t \x01(\x05R\bduration\x12\x16\n" + + "\x06status\x18\n" + + " \x01(\x05R\x06status\x12\x16\n" + + "\x06result\x18\v \x01(\x05R\x06result\x12\x1f\n" + + "\vresult_desc\x18\f \x01(\tR\n" + + "resultDesc\"\xd4\x01\n" + + "\n" + + "TaskDetail\x12\x0e\n" + + "\x02id\x18\x01 \x01(\rR\x02id\x12\x17\n" + + "\atask_id\x18\x02 \x01(\rR\x06taskId\x12!\n" + + "\fartist_count\x18\x03 \x01(\x05R\vartistCount\x12*\n" + + "\aartists\x18\x04 \x03(\v2\x10.cron.ArtistInfoR\aartists\x12\x10\n" + + "\x03num\x18\x05 \x01(\x05R\x03num\x12\x1d\n" + + "\n" + + "created_at\x18\x06 \x01(\tR\tcreatedAt\x12\x1d\n" + + "\n" + + "updated_at\x18\a \x01(\tR\tupdatedAt\"0\n" + + "\n" + + "ArtistInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\rR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\"\x83\x03\n" + + "\x19CreateScheduleTaskRequest\x12\x1d\n" + + "\n" + + "task_title\x18\x01 \x01(\tR\ttaskTitle\x12 \n" + + "\vdescription\x18\x02 \x01(\tR\vdescription\x12\x1f\n" + + "\vperiod_type\x18\x03 \x01(\x05R\n" + + "periodType\x12\x1a\n" + + "\bweekdays\x18\x04 \x03(\x05R\bweekdays\x12\x1f\n" + + "\vcustom_days\x18\x05 \x03(\tR\n" + + "customDays\x12\x1d\n" + + "\n" + + "start_date\x18\x06 \x01(\tR\tstartDate\x12,\n" + + "\x12execute_start_time\x18\a \x01(\tR\x10executeStartTime\x12(\n" + + "\x10execute_end_time\x18\b \x01(\tR\x0eexecuteEndTime\x12\x16\n" + + "\x06remark\x18\n" + + " \x01(\tR\x06remark\x128\n" + + "\vtask_detail\x18\v \x01(\v2\x17.cron.TaskDetailRequestR\n" + + "taskDetail\"\x97\x01\n" + + "\x11TaskDetailRequest\x12!\n" + + "\fartist_count\x18\x01 \x01(\x05R\vartistCount\x12*\n" + + "\aartists\x18\x02 \x03(\v2\x10.cron.ArtistInfoR\aartists\x12\x10\n" + + "\x03num\x18\x03 \x01(\x05R\x03num\x12!\n" + + "\fcontent_type\x18\x04 \x01(\x05R\vcontentType\"r\n" + + "\x1aCreateScheduleTaskResponse\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12&\n" + + "\x04data\x18\x03 \x01(\v2\x12.cron.ScheduleTaskR\x04data\"\x82\x02\n" + + "\x1aGetListScheduleTaskRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "task_title\x18\x03 \x01(\tR\ttaskTitle\x12\x1f\n" + + "\vperiod_type\x18\x04 \x01(\tR\n" + + "periodType\x12\x1d\n" + + "\n" + + "start_time\x18\x05 \x01(\tR\tstartTime\x12\x19\n" + + "\bend_time\x18\x06 \x01(\tR\aendTime\x12\x16\n" + + "\x06Status\x18\a \x01(\x05R\x06Status\x12!\n" + + "\fcontent_type\x18\b \x01(\x05R\vcontentType\"\xb1\x01\n" + + "\x1bGetListScheduleTaskResponse\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12\x14\n" + + "\x05total\x18\x03 \x01(\x03R\x05total\x12\x12\n" + + "\x04page\x18\x04 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x05 \x01(\x05R\x04size\x12&\n" + + "\x04data\x18\x06 \x03(\v2\x12.cron.ScheduleTaskR\x04data\"\xfa\x01\n" + + "\x1dGetListExecutionRecordRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "task_title\x18\x03 \x01(\tR\ttaskTitle\x12\x1f\n" + + "\vperiod_type\x18\x04 \x01(\tR\n" + + "periodType\x12\x1d\n" + + "\n" + + "start_time\x18\x05 \x01(\tR\tstartTime\x12\x19\n" + + "\bend_time\x18\x06 \x01(\tR\aendTime\x12\x16\n" + + "\x06status\x18\a \x01(\x05R\x06status\x12\x16\n" + + "\x06result\x18\b \x01(\x05R\x06result\"\xb7\x01\n" + + "\x1eGetListExecutionRecordResponse\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12\x14\n" + + "\x05total\x18\x03 \x01(\x03R\x05total\x12\x12\n" + + "\x04page\x18\x04 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x05 \x01(\x05R\x04size\x12)\n" + + "\x04data\x18\x06 \x03(\v2\x15.cron.ExecutionRecordR\x04data\"\x9d\x02\n" + + "\x1dGetListExecutionResultRequest\x12\x12\n" + + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + + "\n" + + "task_title\x18\x03 \x01(\tR\ttaskTitle\x12\x1f\n" + + "\vartist_name\x18\x04 \x01(\tR\n" + + "artistName\x12\x1d\n" + + "\n" + + "start_time\x18\x05 \x01(\tR\tstartTime\x12\x19\n" + + "\bend_time\x18\x06 \x01(\tR\aendTime\x12\x16\n" + + "\x06status\x18\a \x01(\x05R\x06status\x12\x16\n" + + "\x06result\x18\b \x01(\x05R\x06result\x12!\n" + + "\fexecution_id\x18\t \x01(\x03R\vexecutionId\"\xb7\x01\n" + + "\x1eGetListExecutionResultResponse\x12\x12\n" + + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + + "\amessage\x18\x02 \x01(\tR\amessage\x12\x14\n" + + "\x05total\x18\x03 \x01(\x03R\x05total\x12\x12\n" + + "\x04page\x18\x04 \x01(\x05R\x04page\x12\x12\n" + + "\x04size\x18\x05 \x01(\x05R\x04size\x12)\n" + + "\x04data\x18\x06 \x03(\v2\x15.cron.ExecutionResultR\x04data2\xda\x04\n" + + "\x04Cron\x12Y\n" + + "\x12CreateScheduleTask\x12\x1f.cron.CreateScheduleTaskRequest\x1a .cron.CreateScheduleTaskResponse\"\x00\x12\\\n" + + "\x13GetListScheduleTask\x12 .cron.GetListScheduleTaskRequest\x1a!.cron.GetListScheduleTaskResponse\"\x00\x12e\n" + + "\x16GetListExecutionRecord\x12#.cron.GetListExecutionRecordRequest\x1a$.cron.GetListExecutionRecordResponse\"\x00\x12e\n" + + "\x16GetListExecutionResult\x12#.cron.GetListExecutionResultRequest\x1a$.cron.GetListExecutionResultResponse\"\x00\x12B\n" + + "\x11PauseScheduleTask\x12\x15.cron.CommonIDRequest\x1a\x14.cron.CommonResponse\"\x00\x12B\n" + + "\x11StartScheduleTask\x12\x15.cron.CommonIDRequest\x1a\x14.cron.CommonResponse\"\x00\x12C\n" + + "\x12DeleteScheduleTask\x12\x15.cron.CommonIDRequest\x1a\x14.cron.CommonResponse\"\x00B\bZ\x06./cronb\x06proto3" + +var ( + file_pb_cron_proto_rawDescOnce sync.Once + file_pb_cron_proto_rawDescData []byte +) + +func file_pb_cron_proto_rawDescGZIP() []byte { + file_pb_cron_proto_rawDescOnce.Do(func() { + file_pb_cron_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_pb_cron_proto_rawDesc), len(file_pb_cron_proto_rawDesc))) + }) + return file_pb_cron_proto_rawDescData +} + +var file_pb_cron_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_pb_cron_proto_goTypes = []any{ + (*CommonIDRequest)(nil), // 0: cron.CommonIDRequest + (*CommonResponse)(nil), // 1: cron.CommonResponse + (*ScheduleTask)(nil), // 2: cron.ScheduleTask + (*ExecutionRecord)(nil), // 3: cron.ExecutionRecord + (*ExecutionResult)(nil), // 4: cron.ExecutionResult + (*TaskDetail)(nil), // 5: cron.TaskDetail + (*ArtistInfo)(nil), // 6: cron.ArtistInfo + (*CreateScheduleTaskRequest)(nil), // 7: cron.CreateScheduleTaskRequest + (*TaskDetailRequest)(nil), // 8: cron.TaskDetailRequest + (*CreateScheduleTaskResponse)(nil), // 9: cron.CreateScheduleTaskResponse + (*GetListScheduleTaskRequest)(nil), // 10: cron.GetListScheduleTaskRequest + (*GetListScheduleTaskResponse)(nil), // 11: cron.GetListScheduleTaskResponse + (*GetListExecutionRecordRequest)(nil), // 12: cron.GetListExecutionRecordRequest + (*GetListExecutionRecordResponse)(nil), // 13: cron.GetListExecutionRecordResponse + (*GetListExecutionResultRequest)(nil), // 14: cron.GetListExecutionResultRequest + (*GetListExecutionResultResponse)(nil), // 15: cron.GetListExecutionResultResponse +} +var file_pb_cron_proto_depIdxs = []int32{ + 5, // 0: cron.ScheduleTask.task_detail:type_name -> cron.TaskDetail + 3, // 1: cron.ScheduleTask.execution_records:type_name -> cron.ExecutionRecord + 4, // 2: cron.ExecutionRecord.execution_results:type_name -> cron.ExecutionResult + 6, // 3: cron.TaskDetail.artists:type_name -> cron.ArtistInfo + 8, // 4: cron.CreateScheduleTaskRequest.task_detail:type_name -> cron.TaskDetailRequest + 6, // 5: cron.TaskDetailRequest.artists:type_name -> cron.ArtistInfo + 2, // 6: cron.CreateScheduleTaskResponse.data:type_name -> cron.ScheduleTask + 2, // 7: cron.GetListScheduleTaskResponse.data:type_name -> cron.ScheduleTask + 3, // 8: cron.GetListExecutionRecordResponse.data:type_name -> cron.ExecutionRecord + 4, // 9: cron.GetListExecutionResultResponse.data:type_name -> cron.ExecutionResult + 7, // 10: cron.Cron.CreateScheduleTask:input_type -> cron.CreateScheduleTaskRequest + 10, // 11: cron.Cron.GetListScheduleTask:input_type -> cron.GetListScheduleTaskRequest + 12, // 12: cron.Cron.GetListExecutionRecord:input_type -> cron.GetListExecutionRecordRequest + 14, // 13: cron.Cron.GetListExecutionResult:input_type -> cron.GetListExecutionResultRequest + 0, // 14: cron.Cron.PauseScheduleTask:input_type -> cron.CommonIDRequest + 0, // 15: cron.Cron.StartScheduleTask:input_type -> cron.CommonIDRequest + 0, // 16: cron.Cron.DeleteScheduleTask:input_type -> cron.CommonIDRequest + 9, // 17: cron.Cron.CreateScheduleTask:output_type -> cron.CreateScheduleTaskResponse + 11, // 18: cron.Cron.GetListScheduleTask:output_type -> cron.GetListScheduleTaskResponse + 13, // 19: cron.Cron.GetListExecutionRecord:output_type -> cron.GetListExecutionRecordResponse + 15, // 20: cron.Cron.GetListExecutionResult:output_type -> cron.GetListExecutionResultResponse + 1, // 21: cron.Cron.PauseScheduleTask:output_type -> cron.CommonResponse + 1, // 22: cron.Cron.StartScheduleTask:output_type -> cron.CommonResponse + 1, // 23: cron.Cron.DeleteScheduleTask:output_type -> cron.CommonResponse + 17, // [17:24] is the sub-list for method output_type + 10, // [10:17] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_pb_cron_proto_init() } +func file_pb_cron_proto_init() { + if File_pb_cron_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_cron_proto_rawDesc), len(file_pb_cron_proto_rawDesc)), + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_pb_cron_proto_goTypes, + DependencyIndexes: file_pb_cron_proto_depIdxs, + MessageInfos: file_pb_cron_proto_msgTypes, + }.Build() + File_pb_cron_proto = out.File + file_pb_cron_proto_goTypes = nil + file_pb_cron_proto_depIdxs = nil +} diff --git a/api/cron/cron.validator.pb.go b/api/cron/cron.validator.pb.go new file mode 100644 index 0000000..1ee4b41 --- /dev/null +++ b/api/cron/cron.validator.pb.go @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pb/cron.proto + +package cron + +import ( + fmt "fmt" + math "math" + proto "github.com/golang/protobuf/proto" + github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +func (this *CommonIDRequest) Validate() error { + return nil +} +func (this *CommonResponse) Validate() error { + return nil +} +func (this *ScheduleTask) Validate() error { + if this.TaskDetail != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TaskDetail); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("TaskDetail", err) + } + } + for _, item := range this.ExecutionRecords { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("ExecutionRecords", err) + } + } + } + return nil +} +func (this *ExecutionRecord) Validate() error { + for _, item := range this.ExecutionResults { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("ExecutionResults", err) + } + } + } + return nil +} +func (this *ExecutionResult) Validate() error { + return nil +} +func (this *TaskDetail) Validate() error { + for _, item := range this.Artists { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Artists", err) + } + } + } + return nil +} +func (this *ArtistInfo) Validate() error { + return nil +} +func (this *CreateScheduleTaskRequest) Validate() error { + if this.TaskDetail != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.TaskDetail); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("TaskDetail", err) + } + } + return nil +} +func (this *TaskDetailRequest) Validate() error { + for _, item := range this.Artists { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Artists", err) + } + } + } + return nil +} +func (this *CreateScheduleTaskResponse) Validate() error { + if this.Data != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + return nil +} +func (this *GetListScheduleTaskRequest) Validate() error { + return nil +} +func (this *GetListScheduleTaskResponse) Validate() error { + for _, item := range this.Data { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + } + return nil +} +func (this *GetListExecutionRecordRequest) Validate() error { + return nil +} +func (this *GetListExecutionRecordResponse) Validate() error { + for _, item := range this.Data { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + } + return nil +} +func (this *GetListExecutionResultRequest) Validate() error { + return nil +} +func (this *GetListExecutionResultResponse) Validate() error { + for _, item := range this.Data { + if item != nil { + if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil { + return github_com_mwitkow_go_proto_validators.FieldError("Data", err) + } + } + } + return nil +} diff --git a/api/cron/cron_triple.pb.go b/api/cron/cron_triple.pb.go new file mode 100644 index 0000000..4f95091 --- /dev/null +++ b/api/cron/cron_triple.pb.go @@ -0,0 +1,417 @@ +// Code generated by protoc-gen-go-triple. DO NOT EDIT. +// versions: +// - protoc-gen-go-triple v1.0.5 +// - protoc v6.32.0 +// source: pb/cron.proto + +package cron + +import ( + context "context" + protocol "dubbo.apache.org/dubbo-go/v3/protocol" + dubbo3 "dubbo.apache.org/dubbo-go/v3/protocol/dubbo3" + invocation "dubbo.apache.org/dubbo-go/v3/protocol/invocation" + grpc_go "github.com/dubbogo/grpc-go" + codes "github.com/dubbogo/grpc-go/codes" + metadata "github.com/dubbogo/grpc-go/metadata" + status "github.com/dubbogo/grpc-go/status" + common "github.com/dubbogo/triple/pkg/common" + constant "github.com/dubbogo/triple/pkg/common/constant" + triple "github.com/dubbogo/triple/pkg/triple" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc_go.SupportPackageIsVersion7 + +// CronClient is the client API for Cron service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type CronClient interface { + CreateScheduleTask(ctx context.Context, in *CreateScheduleTaskRequest, opts ...grpc_go.CallOption) (*CreateScheduleTaskResponse, common.ErrorWithAttachment) + GetListScheduleTask(ctx context.Context, in *GetListScheduleTaskRequest, opts ...grpc_go.CallOption) (*GetListScheduleTaskResponse, common.ErrorWithAttachment) + GetListExecutionRecord(ctx context.Context, in *GetListExecutionRecordRequest, opts ...grpc_go.CallOption) (*GetListExecutionRecordResponse, common.ErrorWithAttachment) + GetListExecutionResult(ctx context.Context, in *GetListExecutionResultRequest, opts ...grpc_go.CallOption) (*GetListExecutionResultResponse, common.ErrorWithAttachment) + PauseScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) + StartScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) + DeleteScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) +} + +type cronClient struct { + cc *triple.TripleConn +} + +type CronClientImpl struct { + CreateScheduleTask func(ctx context.Context, in *CreateScheduleTaskRequest) (*CreateScheduleTaskResponse, error) + GetListScheduleTask func(ctx context.Context, in *GetListScheduleTaskRequest) (*GetListScheduleTaskResponse, error) + GetListExecutionRecord func(ctx context.Context, in *GetListExecutionRecordRequest) (*GetListExecutionRecordResponse, error) + GetListExecutionResult func(ctx context.Context, in *GetListExecutionResultRequest) (*GetListExecutionResultResponse, error) + PauseScheduleTask func(ctx context.Context, in *CommonIDRequest) (*CommonResponse, error) + StartScheduleTask func(ctx context.Context, in *CommonIDRequest) (*CommonResponse, error) + DeleteScheduleTask func(ctx context.Context, in *CommonIDRequest) (*CommonResponse, error) +} + +func (c *CronClientImpl) GetDubboStub(cc *triple.TripleConn) CronClient { + return NewCronClient(cc) +} + +func (c *CronClientImpl) XXX_InterfaceName() string { + return "cron.Cron" +} + +func NewCronClient(cc *triple.TripleConn) CronClient { + return &cronClient{cc} +} + +func (c *cronClient) CreateScheduleTask(ctx context.Context, in *CreateScheduleTaskRequest, opts ...grpc_go.CallOption) (*CreateScheduleTaskResponse, common.ErrorWithAttachment) { + out := new(CreateScheduleTaskResponse) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CreateScheduleTask", in, out) +} + +func (c *cronClient) GetListScheduleTask(ctx context.Context, in *GetListScheduleTaskRequest, opts ...grpc_go.CallOption) (*GetListScheduleTaskResponse, common.ErrorWithAttachment) { + out := new(GetListScheduleTaskResponse) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetListScheduleTask", in, out) +} + +func (c *cronClient) GetListExecutionRecord(ctx context.Context, in *GetListExecutionRecordRequest, opts ...grpc_go.CallOption) (*GetListExecutionRecordResponse, common.ErrorWithAttachment) { + out := new(GetListExecutionRecordResponse) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetListExecutionRecord", in, out) +} + +func (c *cronClient) GetListExecutionResult(ctx context.Context, in *GetListExecutionResultRequest, opts ...grpc_go.CallOption) (*GetListExecutionResultResponse, common.ErrorWithAttachment) { + out := new(GetListExecutionResultResponse) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetListExecutionResult", in, out) +} + +func (c *cronClient) PauseScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) { + out := new(CommonResponse) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/PauseScheduleTask", in, out) +} + +func (c *cronClient) StartScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) { + out := new(CommonResponse) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/StartScheduleTask", in, out) +} + +func (c *cronClient) DeleteScheduleTask(ctx context.Context, in *CommonIDRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) { + out := new(CommonResponse) + interfaceKey := ctx.Value(constant.InterfaceKey).(string) + return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/DeleteScheduleTask", in, out) +} + +// CronServer is the server API for Cron service. +// All implementations must embed UnimplementedCronServer +// for forward compatibility +type CronServer interface { + CreateScheduleTask(context.Context, *CreateScheduleTaskRequest) (*CreateScheduleTaskResponse, error) + GetListScheduleTask(context.Context, *GetListScheduleTaskRequest) (*GetListScheduleTaskResponse, error) + GetListExecutionRecord(context.Context, *GetListExecutionRecordRequest) (*GetListExecutionRecordResponse, error) + GetListExecutionResult(context.Context, *GetListExecutionResultRequest) (*GetListExecutionResultResponse, error) + PauseScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error) + StartScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error) + DeleteScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error) + mustEmbedUnimplementedCronServer() +} + +// UnimplementedCronServer must be embedded to have forward compatible implementations. +type UnimplementedCronServer struct { + proxyImpl protocol.Invoker +} + +func (UnimplementedCronServer) CreateScheduleTask(context.Context, *CreateScheduleTaskRequest) (*CreateScheduleTaskResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateScheduleTask not implemented") +} +func (UnimplementedCronServer) GetListScheduleTask(context.Context, *GetListScheduleTaskRequest) (*GetListScheduleTaskResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListScheduleTask not implemented") +} +func (UnimplementedCronServer) GetListExecutionRecord(context.Context, *GetListExecutionRecordRequest) (*GetListExecutionRecordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListExecutionRecord not implemented") +} +func (UnimplementedCronServer) GetListExecutionResult(context.Context, *GetListExecutionResultRequest) (*GetListExecutionResultResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetListExecutionResult not implemented") +} +func (UnimplementedCronServer) PauseScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PauseScheduleTask not implemented") +} +func (UnimplementedCronServer) StartScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StartScheduleTask not implemented") +} +func (UnimplementedCronServer) DeleteScheduleTask(context.Context, *CommonIDRequest) (*CommonResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteScheduleTask not implemented") +} +func (s *UnimplementedCronServer) XXX_SetProxyImpl(impl protocol.Invoker) { + s.proxyImpl = impl +} + +func (s *UnimplementedCronServer) XXX_GetProxyImpl() protocol.Invoker { + return s.proxyImpl +} + +func (s *UnimplementedCronServer) XXX_ServiceDesc() *grpc_go.ServiceDesc { + return &Cron_ServiceDesc +} +func (s *UnimplementedCronServer) XXX_InterfaceName() string { + return "cron.Cron" +} + +func (UnimplementedCronServer) mustEmbedUnimplementedCronServer() {} + +// UnsafeCronServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to CronServer will +// result in compilation errors. +type UnsafeCronServer interface { + mustEmbedUnimplementedCronServer() +} + +func RegisterCronServer(s grpc_go.ServiceRegistrar, srv CronServer) { + s.RegisterService(&Cron_ServiceDesc, srv) +} + +func _Cron_CreateScheduleTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateScheduleTaskRequest) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("CreateScheduleTask", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Cron_GetListScheduleTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(GetListScheduleTaskRequest) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("GetListScheduleTask", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Cron_GetListExecutionRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(GetListExecutionRecordRequest) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("GetListExecutionRecord", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Cron_GetListExecutionResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(GetListExecutionResultRequest) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("GetListExecutionResult", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Cron_PauseScheduleTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(CommonIDRequest) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("PauseScheduleTask", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Cron_StartScheduleTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(CommonIDRequest) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("StartScheduleTask", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +func _Cron_DeleteScheduleTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) { + in := new(CommonIDRequest) + if err := dec(in); err != nil { + return nil, err + } + base := srv.(dubbo3.Dubbo3GrpcService) + args := []interface{}{} + args = append(args, in) + md, _ := metadata.FromIncomingContext(ctx) + invAttachment := make(map[string]interface{}, len(md)) + for k, v := range md { + invAttachment[k] = v + } + invo := invocation.NewRPCInvocation("DeleteScheduleTask", args, invAttachment) + if interceptor == nil { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + info := &grpc_go.UnaryServerInfo{ + Server: srv, + FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string), + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + result := base.XXX_GetProxyImpl().Invoke(ctx, invo) + return result, result.Error() + } + return interceptor(ctx, in, info, handler) +} + +// Cron_ServiceDesc is the grpc_go.ServiceDesc for Cron service. +// It's only intended for direct use with grpc_go.RegisterService, +// and not to be introspected or modified (even as a copy) +var Cron_ServiceDesc = grpc_go.ServiceDesc{ + ServiceName: "cron.Cron", + HandlerType: (*CronServer)(nil), + Methods: []grpc_go.MethodDesc{ + { + MethodName: "CreateScheduleTask", + Handler: _Cron_CreateScheduleTask_Handler, + }, + { + MethodName: "GetListScheduleTask", + Handler: _Cron_GetListScheduleTask_Handler, + }, + { + MethodName: "GetListExecutionRecord", + Handler: _Cron_GetListExecutionRecord_Handler, + }, + { + MethodName: "GetListExecutionResult", + Handler: _Cron_GetListExecutionResult_Handler, + }, + { + MethodName: "PauseScheduleTask", + Handler: _Cron_PauseScheduleTask_Handler, + }, + { + MethodName: "StartScheduleTask", + Handler: _Cron_StartScheduleTask_Handler, + }, + { + MethodName: "DeleteScheduleTask", + Handler: _Cron_DeleteScheduleTask_Handler, + }, + }, + Streams: []grpc_go.StreamDesc{}, + Metadata: "pb/cron.proto", +} diff --git a/conf/dubbogo.yaml b/conf/dubbogo.yaml index 48c9d1c..54d8a1f 100644 --- a/conf/dubbogo.yaml +++ b/conf/dubbogo.yaml @@ -2,10 +2,27 @@ dubbo: registries: demoZK: protocol: zookeeper - timeout: 5s + timeout: 3s + # address: 121.229.45.214:9004 address: 127.0.0.1:2181 + # address: 127.0.0.1:2181 + # address: 114.218.158.24:2181 consumer: + filter: tracing + request-timeout: 300s references: + OrderClientImpl: + protocol: tri + retries: 0 + interface: com.fontree.microservices.common.order # must be compatible with grpc or dubbo-java + # filter: cshutdown,sign,fonDomainFilter,fonValidateFilter + params: + .accessKeyId: "SYD8-order-04" + .secretAccessKey: "Al-order-FDF112" + BundleClientImpl: + protocol: tri + retries: 0 + interface: com.fontree.microservices.fiee.bundle # must be compatible with grpc or dubbo-java AccountClientImpl: protocol: tri retries: 0 @@ -14,19 +31,65 @@ dubbo: params: .accessKeyId: "Accountksl" .secretAccessKey: "BSDY-FDF1-Fontree_account" - AccountFieeClientImpl: protocol: tri - retries: 0 + retries: 3 interface: com.fontree.microservices.common.micro.account.fiee -# filter: cshutdown,sign,fonDomainFilter,fonValidateFilter -# params: -# .accessKeyId: "Accountksl" -# .secretAccessKey: "BSDY-FDF1-Fontree_account" - BundleClientImpl: + # filter: echo,metrics,token,accesslog,sign,tps,generic_service,execute,pshutdown,auth,fonValidateFilter + PaymentCentClientImpl: protocol: tri retries: 0 - interface: com.fontree.microservices.fiee.bundle # must be compatible with grpc or dubbo-java + interface: com.fontree.microservices.common.payment.cent # must be compatible with grpc or dubbo-java CastClientImpl: protocol: tri - interface: com.fontree.microservices.fiee.multicast \ No newline at end of file + interface: com.fontree.microservices.fiee.multicast + SecFilingsClientImpl: + protocol: tri + retries: 0 + interface: com.fontree.microservices.fiee.SecFiling + AyrshareClientImpl: + protocol: tri + interface: com.fontree.microservices.fiee.ayrshare + FieeCronClientImpl: + protocol: tri + interface: com.fontree.microservices.fiee.cron + logger: + zap-config: + level: error # 日志级别 + development: false + disableCaller: false + disableStacktrace: false + encoding: "json" + # zap encoder 配置 + encoderConfig: + messageKey: "message" + levelKey: "level" + timeKey: "time" + nameKey: "logger" + callerKey: "caller" + stacktraceKey: "stacktrace" + lineEnding: "" + levelEncoder: "capitalColor" + timeEncoder: "iso8601" + durationEncoder: "seconds" + callerEncoder: "short" + nameEncoder: "" + EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"), + EncodeDuration: zapcore.SecondsDurationEncoder, + outputPaths: + - "stderr" + errorOutputPaths: + - "stderr" + lumberjack-config: + # 写日志的文件名称 + filename: "runtime/logs/fiee.log" + # 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB + maxSize: 5 + # 日志保留的最大天数(只保留最近多少天的日志) + maxAge: 30 + # 只保留最近多少个日志文件,用于控制程序总日志的大小 + maxBackups: 30 + # 是否使用本地时间,默认使用 UTC 时间 + localTime: true + # 是否压缩日志文件,压缩方法 gzip + compress: false diff --git a/docs/dev/dubbogo.yaml b/docs/dev/dubbogo.yaml index b3d50fa..2447e66 100644 --- a/docs/dev/dubbogo.yaml +++ b/docs/dev/dubbogo.yaml @@ -50,6 +50,9 @@ dubbo: AyrshareClientImpl: protocol: tri interface: com.fontree.microservices.fiee.ayrshare + FieeCronClientImpl: + protocol: tri + interface: com.fontree.microservices.fiee.cron logger: zap-config: level: error # 日志级别 diff --git a/docs/prod/dubbogo.yaml b/docs/prod/dubbogo.yaml index 1944e79..fbf2f9c 100644 --- a/docs/prod/dubbogo.yaml +++ b/docs/prod/dubbogo.yaml @@ -52,6 +52,9 @@ dubbo: AyrshareClientImpl: protocol: tri interface: com.fontree.microservices.fiee.ayrshare + FieeCronClientImpl: + protocol: tri + interface: com.fontree.microservices.fiee.cron logger: zap-config: level: error # 日志级别 diff --git a/docs/test/dubbogo.yaml b/docs/test/dubbogo.yaml index a7a46c6..2bb38a6 100644 --- a/docs/test/dubbogo.yaml +++ b/docs/test/dubbogo.yaml @@ -50,6 +50,9 @@ dubbo: AyrshareClientImpl: protocol: tri interface: com.fontree.microservices.fiee.ayrshare + FieeCronClientImpl: + protocol: tri + interface: com.fontree.microservices.fiee.cron logger: zap-config: level: error # 日志级别 diff --git a/pkg/router/cron.go b/pkg/router/cron.go new file mode 100644 index 0000000..4452858 --- /dev/null +++ b/pkg/router/cron.go @@ -0,0 +1,23 @@ +package router + +import ( + cronService "fonchain-fiee/pkg/service/cron" + + "github.com/gin-gonic/gin" +) + +func cronRouter(r *gin.RouterGroup) { + auth := r.Group("") + //auth.Use(middleware.CheckWebLogin(service.AccountProvider)) + cron := auth.Group("cron") + { + cron.POST("createScheduleTask", cronService.CreateScheduleTask) + cron.POST("pauseScheduleTask", cronService.PauseScheduleTask) + cron.POST("startScheduleTask", cronService.StartScheduleTask) + cron.POST("deleteScheduleTask", cronService.DeleteScheduleTask) + cron.GET("getListScheduleTask", cronService.GetListScheduleTask) + cron.GET("getListExecutionResult", cronService.GetListExecutionResult) + cron.GET("getListExecutionRecord", cronService.GetListExecutionRecord) + + } +} diff --git a/pkg/router/router.go b/pkg/router/router.go index 848a399..119ba2d 100644 --- a/pkg/router/router.go +++ b/pkg/router/router.go @@ -55,6 +55,7 @@ func NewRouter() *gin.Engine { MediaRouter(privateGroup) SecFilingRouter(privateGroup) app.MediaAppRouter(privateGroup) + cronRouter(privateGroup) { v1.POST("version", version.Version) //版本号公共 } diff --git a/pkg/service/cron/cron.go b/pkg/service/cron/cron.go new file mode 100644 index 0000000..47390b3 --- /dev/null +++ b/pkg/service/cron/cron.go @@ -0,0 +1,135 @@ +package cron + +import ( + "context" + "errors" + "fonchain-fiee/api/cron" + "fonchain-fiee/pkg/service" + + "github.com/gin-gonic/gin" + "github.com/gin-gonic/gin/binding" +) + +func CreateScheduleTask(c *gin.Context) { + var req cron.CreateScheduleTaskRequest + if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil { + service.Error(c, errors.New("参数错误")) + return + } + res, err := service.CronProvider.CreateScheduleTask(context.Background(), &req) + if err != nil { + service.Error(c, errors.New("网络超时,请重试")) + return + } + if res.Code != 200 { + service.Error(c, errors.New(res.Message)) + return + } + service.Success(c, res) +} + +func GetListScheduleTask(c *gin.Context) { + var req cron.GetListScheduleTaskRequest + if err := c.ShouldBindJSON(&req); err != nil { + service.Error(c, errors.New("参数错误")) + return + } + res, err := service.CronProvider.GetListScheduleTask(context.Background(), &req) + if err != nil { + service.Error(c, errors.New("网络超时,请重试")) + return + } + if res.Code != 200 { + service.Error(c, errors.New(res.Message)) + return + } + service.Success(c, res) +} + +func GetListExecutionRecord(c *gin.Context) { + var req cron.GetListExecutionRecordRequest + if err := c.ShouldBindJSON(&req); err != nil { + service.Error(c, errors.New("参数错误")) + return + } + res, err := service.CronProvider.GetListExecutionRecord(context.Background(), &req) + if err != nil { + service.Error(c, errors.New("网络超时,请重试")) + return + } + if res.Code != 200 { + service.Error(c, errors.New(res.Message)) + return + } + service.Success(c, res) +} +func GetListExecutionResult(c *gin.Context) { + var req cron.GetListExecutionResultRequest + if err := c.ShouldBindJSON(&req); err != nil { + service.Error(c, errors.New("参数错误")) + return + } + res, err := service.CronProvider.GetListExecutionResult(context.Background(), &req) + if err != nil { + service.Error(c, errors.New("网络超时,请重试")) + return + } + if res.Code != 200 { + service.Error(c, errors.New(res.Message)) + return + } + service.Success(c, res) +} +func StartScheduleTask(c *gin.Context) { + var req cron.CommonIDRequest + if err := c.ShouldBindJSON(&req); err != nil { + service.Error(c, errors.New("参数错误")) + return + } + res, err := service.CronProvider.StartScheduleTask(context.Background(), &req) + if err != nil { + service.Error(c, errors.New("网络超时,请重试")) + return + } + if res.Code != 200 { + service.Error(c, errors.New(res.Message)) + return + } + service.Success(c, res) +} + +func PauseScheduleTask(c *gin.Context) { + var req cron.CommonIDRequest + if err := c.ShouldBindJSON(&req); err != nil { + service.Error(c, errors.New("参数错误")) + return + } + res, err := service.CronProvider.PauseScheduleTask(context.Background(), &req) + if err != nil { + service.Error(c, errors.New("网络超时,请重试")) + return + } + if res.Code != 200 { + service.Error(c, errors.New(res.Message)) + return + } + service.Success(c, res) +} + +func DeleteScheduleTask(c *gin.Context) { + var req cron.CommonIDRequest + if err := c.ShouldBindJSON(&req); err != nil { + service.Error(c, errors.New("参数错误")) + return + } + res, err := service.CronProvider.DeleteScheduleTask(context.Background(), &req) + if err != nil { + service.Error(c, errors.New("网络超时,请重试")) + return + } + if res.Code != 200 { + service.Error(c, errors.New(res.Message)) + return + } + service.Success(c, res) +} diff --git a/pkg/service/init.go b/pkg/service/init.go index 8322d53..f39c4ee 100644 --- a/pkg/service/init.go +++ b/pkg/service/init.go @@ -7,6 +7,7 @@ import ( "fonchain-fiee/api/aryshare" "fonchain-fiee/api/bundle" "fonchain-fiee/api/cast" + "fonchain-fiee/api/cron" "fonchain-fiee/api/files" "fonchain-fiee/api/governance" "fonchain-fiee/api/order" @@ -33,6 +34,7 @@ var GovernanceProvider = new(governance.GovernanceClientImpl) var PressReleasesProvider = new(pressreleases.PressReleasesClientImpl) var SecFilingProvider = new(secFilings.SecFilingsClientImpl) var AyrshareProvider = new(aryshare.AyrshareClientImpl) +var CronProvider = new(cron.CronClientImpl) func init() { config.SetConsumerService(BundleProvider) @@ -46,6 +48,7 @@ func init() { config.SetConsumerService(PressReleasesProvider) config.SetConsumerService(SecFilingProvider) config.SetConsumerService(AyrshareProvider) + config.SetConsumerService(CronProvider) if err := config.Load(); err != nil { panic(err)