From 4110717751e219cda505211c53dbaf2650c2b43d Mon Sep 17 00:00:00 2001 From: bx1834938347-prog Date: Tue, 6 Jan 2026 14:04:57 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat=EF=BC=9A=E4=BF=AE=E6=94=B9pd=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/cron/cron.pb.go | 41 ++++++++++++++++++++++++----------- api/cron/cron.validator.pb.go | 1 + 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/api/cron/cron.pb.go b/api/cron/cron.pb.go index 3f40dd0..8c00184 100644 --- a/api/cron/cron.pb.go +++ b/api/cron/cron.pb.go @@ -1232,6 +1232,7 @@ type GetListScheduleTaskRequest struct { 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"` // 内容类型 + Sorts map[string]string `protobuf:"bytes,9,rep,name=sorts,proto3" json:"sorts" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1322,6 +1323,13 @@ func (x *GetListScheduleTaskRequest) GetContentType() int32 { return 0 } +func (x *GetListScheduleTaskRequest) GetSorts() map[string]string { + if x != nil { + return x.Sorts + } + return nil +} + type GetListScheduleTaskResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应码 @@ -2040,7 +2048,7 @@ const file_pb_cron_proto_rawDesc = "" + "\x1aUpdateScheduleTaskResponse\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" + + "\x04data\x18\x03 \x01(\v2\x12.cron.ScheduleTaskR\x04data\"\xff\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" + @@ -2052,7 +2060,12 @@ const file_pb_cron_proto_rawDesc = "" + "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" + + "\fcontent_type\x18\b \x01(\x05R\vcontentType\x12A\n" + + "\x05sorts\x18\t \x03(\v2+.cron.GetListScheduleTaskRequest.SortsEntryR\x05sorts\x1a8\n" + + "\n" + + "SortsEntry\x12\x10\n" + + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\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" + @@ -2120,7 +2133,7 @@ func file_pb_cron_proto_rawDescGZIP() []byte { return file_pb_cron_proto_rawDescData } -var file_pb_cron_proto_msgTypes = make([]protoimpl.MessageInfo, 20) +var file_pb_cron_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_pb_cron_proto_goTypes = []any{ (*CommonIDRequest)(nil), // 0: cron.CommonIDRequest (*CommonResponse)(nil), // 1: cron.CommonResponse @@ -2142,6 +2155,7 @@ var file_pb_cron_proto_goTypes = []any{ (*GetListExecutionResultResponse)(nil), // 17: cron.GetListExecutionResultResponse (*TaskStatus)(nil), // 18: cron.TaskStatus (*GetScheduleTaskStatusResponse)(nil), // 19: cron.GetScheduleTaskStatusResponse + nil, // 20: cron.GetListScheduleTaskRequest.SortsEntry } var file_pb_cron_proto_depIdxs = []int32{ 3, // 0: cron.ScheduleTask.task_detail:type_name -> cron.TaskDetail @@ -2153,15 +2167,16 @@ var file_pb_cron_proto_depIdxs = []int32{ 2, // 6: cron.CreateScheduleTaskResponse.data:type_name -> cron.ScheduleTask 8, // 7: cron.UpdateScheduleTaskRequest.task_detail:type_name -> cron.TaskDetailRequest 2, // 8: cron.UpdateScheduleTaskResponse.data:type_name -> cron.ScheduleTask - 2, // 9: cron.GetListScheduleTaskResponse.data:type_name -> cron.ScheduleTask - 5, // 10: cron.GetListExecutionRecordResponse.data:type_name -> cron.ExecutionRecord - 6, // 11: cron.GetListExecutionResultResponse.data:type_name -> cron.ExecutionResult - 18, // 12: cron.GetScheduleTaskStatusResponse.data:type_name -> cron.TaskStatus - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 20, // 9: cron.GetListScheduleTaskRequest.sorts:type_name -> cron.GetListScheduleTaskRequest.SortsEntry + 2, // 10: cron.GetListScheduleTaskResponse.data:type_name -> cron.ScheduleTask + 5, // 11: cron.GetListExecutionRecordResponse.data:type_name -> cron.ExecutionRecord + 6, // 12: cron.GetListExecutionResultResponse.data:type_name -> cron.ExecutionResult + 18, // 13: cron.GetScheduleTaskStatusResponse.data:type_name -> cron.TaskStatus + 14, // [14:14] is the sub-list for method output_type + 14, // [14:14] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_pb_cron_proto_init() } @@ -2175,7 +2190,7 @@ func file_pb_cron_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_cron_proto_rawDesc), len(file_pb_cron_proto_rawDesc)), NumEnums: 0, - NumMessages: 20, + NumMessages: 21, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cron/cron.validator.pb.go b/api/cron/cron.validator.pb.go index 3ce2308..013f142 100644 --- a/api/cron/cron.validator.pb.go +++ b/api/cron/cron.validator.pb.go @@ -106,6 +106,7 @@ func (this *UpdateScheduleTaskResponse) Validate() error { return nil } func (this *GetListScheduleTaskRequest) Validate() error { + // Validation of proto3 map<> fields is unsupported. return nil } func (this *GetListScheduleTaskResponse) Validate() error { From 0b2f0da573eb52926b086cda2779694ca9d35b5a Mon Sep 17 00:00:00 2001 From: bx1834938347-prog Date: Wed, 7 Jan 2026 11:31:58 +0800 Subject: [PATCH 2/7] =?UTF-8?q?feat=EF=BC=9A=E6=96=B0=E5=A2=9E=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1pd=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/cron/cron.pb.go | 254 +++++++++++++++++++++++----------- api/cron/cron.validator.pb.go | 11 +- 2 files changed, 183 insertions(+), 82 deletions(-) diff --git a/api/cron/cron.pb.go b/api/cron/cron.pb.go index 8c00184..d07ceeb 100644 --- a/api/cron/cron.pb.go +++ b/api/cron/cron.pb.go @@ -9,7 +9,6 @@ package cron import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/known/emptypb" reflect "reflect" sync "sync" unsafe "unsafe" @@ -1039,18 +1038,18 @@ func (x *CreateScheduleTaskResponse) GetData() *ScheduleTask { } type UpdateScheduleTaskRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - TaskId uint64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id"` // 任务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"` // 周期类型 - Weekdays []int32 `protobuf:"varint,5,rep,packed,name=weekdays,proto3" json:"weekdays"` // 每周任务的星期几 - CustomDays []string `protobuf:"bytes,6,rep,name=custom_days,json=customDays,proto3" json:"custom_days"` // 自定义日期 - StartDate string `protobuf:"bytes,7,opt,name=start_date,json=startDate,proto3" json:"start_date"` // 开始日期 - ExecuteStartTime string `protobuf:"bytes,8,opt,name=execute_start_time,json=executeStartTime,proto3" json:"execute_start_time"` // 执行开始时间 - ExecuteEndTime string `protobuf:"bytes,9,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"` // 任务详情 + state protoimpl.MessageState `protogen:"open.v1"` + TaskId uint64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id"` // 任务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"` // 周期类型 + Weekdays []int32 `protobuf:"varint,5,rep,packed,name=weekdays,proto3" json:"weekdays"` // 每周任务的星期几 + CustomDays []string `protobuf:"bytes,6,rep,name=custom_days,json=customDays,proto3" json:"custom_days"` // 自定义日期 + StartDate string `protobuf:"bytes,7,opt,name=start_date,json=startDate,proto3" json:"start_date"` // 开始日期 + ExecuteStartTime string `protobuf:"bytes,8,opt,name=execute_start_time,json=executeStartTime,proto3" json:"execute_start_time"` // 执行开始时间 + ExecuteEndTime string `protobuf:"bytes,9,opt,name=execute_end_time,json=executeEndTime,proto3" json:"execute_end_time"` // 执行结束时间 + Remark string `protobuf:"bytes,10,opt,name=remark,proto3" json:"remark"` // 备注 + TaskDetail *UpdateScheduleTaskRequestTaskDetail `protobuf:"bytes,11,opt,name=task_detail,json=taskDetail,proto3" json:"task_detail"` // 任务详情 unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1155,13 +1154,97 @@ func (x *UpdateScheduleTaskRequest) GetRemark() string { return "" } -func (x *UpdateScheduleTaskRequest) GetTaskDetail() *TaskDetailRequest { +func (x *UpdateScheduleTaskRequest) GetTaskDetail() *UpdateScheduleTaskRequestTaskDetail { if x != nil { return x.TaskDetail } return nil } +type UpdateScheduleTaskRequestTaskDetail struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int32 `protobuf:"varint,5,opt,name=id,proto3" json:"id"` + TaskId int32 `protobuf:"varint,6,opt,name=task_id,json=taskId,proto3" json:"task_id"` + 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 *UpdateScheduleTaskRequestTaskDetail) Reset() { + *x = UpdateScheduleTaskRequestTaskDetail{} + mi := &file_pb_cron_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateScheduleTaskRequestTaskDetail) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateScheduleTaskRequestTaskDetail) ProtoMessage() {} + +func (x *UpdateScheduleTaskRequestTaskDetail) 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 UpdateScheduleTaskRequestTaskDetail.ProtoReflect.Descriptor instead. +func (*UpdateScheduleTaskRequestTaskDetail) Descriptor() ([]byte, []int) { + return file_pb_cron_proto_rawDescGZIP(), []int{11} +} + +func (x *UpdateScheduleTaskRequestTaskDetail) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UpdateScheduleTaskRequestTaskDetail) GetTaskId() int32 { + if x != nil { + return x.TaskId + } + return 0 +} + +func (x *UpdateScheduleTaskRequestTaskDetail) GetArtistCount() int32 { + if x != nil { + return x.ArtistCount + } + return 0 +} + +func (x *UpdateScheduleTaskRequestTaskDetail) GetArtists() []*ArtistInfo { + if x != nil { + return x.Artists + } + return nil +} + +func (x *UpdateScheduleTaskRequestTaskDetail) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +func (x *UpdateScheduleTaskRequestTaskDetail) GetContentType() int32 { + if x != nil { + return x.ContentType + } + return 0 +} + type UpdateScheduleTaskResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应码 @@ -1173,7 +1256,7 @@ type UpdateScheduleTaskResponse struct { func (x *UpdateScheduleTaskResponse) Reset() { *x = UpdateScheduleTaskResponse{} - mi := &file_pb_cron_proto_msgTypes[11] + mi := &file_pb_cron_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1185,7 +1268,7 @@ func (x *UpdateScheduleTaskResponse) String() string { func (*UpdateScheduleTaskResponse) ProtoMessage() {} func (x *UpdateScheduleTaskResponse) ProtoReflect() protoreflect.Message { - mi := &file_pb_cron_proto_msgTypes[11] + mi := &file_pb_cron_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1198,7 +1281,7 @@ func (x *UpdateScheduleTaskResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateScheduleTaskResponse.ProtoReflect.Descriptor instead. func (*UpdateScheduleTaskResponse) Descriptor() ([]byte, []int) { - return file_pb_cron_proto_rawDescGZIP(), []int{11} + return file_pb_cron_proto_rawDescGZIP(), []int{12} } func (x *UpdateScheduleTaskResponse) GetCode() int32 { @@ -1239,7 +1322,7 @@ type GetListScheduleTaskRequest struct { func (x *GetListScheduleTaskRequest) Reset() { *x = GetListScheduleTaskRequest{} - mi := &file_pb_cron_proto_msgTypes[12] + mi := &file_pb_cron_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1251,7 +1334,7 @@ func (x *GetListScheduleTaskRequest) String() string { func (*GetListScheduleTaskRequest) ProtoMessage() {} func (x *GetListScheduleTaskRequest) ProtoReflect() protoreflect.Message { - mi := &file_pb_cron_proto_msgTypes[12] + mi := &file_pb_cron_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1264,7 +1347,7 @@ func (x *GetListScheduleTaskRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetListScheduleTaskRequest.ProtoReflect.Descriptor instead. func (*GetListScheduleTaskRequest) Descriptor() ([]byte, []int) { - return file_pb_cron_proto_rawDescGZIP(), []int{12} + return file_pb_cron_proto_rawDescGZIP(), []int{13} } func (x *GetListScheduleTaskRequest) GetPage() int32 { @@ -1344,7 +1427,7 @@ type GetListScheduleTaskResponse struct { func (x *GetListScheduleTaskResponse) Reset() { *x = GetListScheduleTaskResponse{} - mi := &file_pb_cron_proto_msgTypes[13] + mi := &file_pb_cron_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1356,7 +1439,7 @@ func (x *GetListScheduleTaskResponse) String() string { func (*GetListScheduleTaskResponse) ProtoMessage() {} func (x *GetListScheduleTaskResponse) ProtoReflect() protoreflect.Message { - mi := &file_pb_cron_proto_msgTypes[13] + mi := &file_pb_cron_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1369,7 +1452,7 @@ func (x *GetListScheduleTaskResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetListScheduleTaskResponse.ProtoReflect.Descriptor instead. func (*GetListScheduleTaskResponse) Descriptor() ([]byte, []int) { - return file_pb_cron_proto_rawDescGZIP(), []int{13} + return file_pb_cron_proto_rawDescGZIP(), []int{14} } func (x *GetListScheduleTaskResponse) GetCode() int32 { @@ -1430,7 +1513,7 @@ type GetListExecutionRecordRequest struct { func (x *GetListExecutionRecordRequest) Reset() { *x = GetListExecutionRecordRequest{} - mi := &file_pb_cron_proto_msgTypes[14] + mi := &file_pb_cron_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1442,7 +1525,7 @@ func (x *GetListExecutionRecordRequest) String() string { func (*GetListExecutionRecordRequest) ProtoMessage() {} func (x *GetListExecutionRecordRequest) ProtoReflect() protoreflect.Message { - mi := &file_pb_cron_proto_msgTypes[14] + mi := &file_pb_cron_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1455,7 +1538,7 @@ func (x *GetListExecutionRecordRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetListExecutionRecordRequest.ProtoReflect.Descriptor instead. func (*GetListExecutionRecordRequest) Descriptor() ([]byte, []int) { - return file_pb_cron_proto_rawDescGZIP(), []int{14} + return file_pb_cron_proto_rawDescGZIP(), []int{15} } func (x *GetListExecutionRecordRequest) GetPage() int32 { @@ -1528,7 +1611,7 @@ type GetListExecutionRecordResponse struct { func (x *GetListExecutionRecordResponse) Reset() { *x = GetListExecutionRecordResponse{} - mi := &file_pb_cron_proto_msgTypes[15] + mi := &file_pb_cron_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1540,7 +1623,7 @@ func (x *GetListExecutionRecordResponse) String() string { func (*GetListExecutionRecordResponse) ProtoMessage() {} func (x *GetListExecutionRecordResponse) ProtoReflect() protoreflect.Message { - mi := &file_pb_cron_proto_msgTypes[15] + mi := &file_pb_cron_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1553,7 +1636,7 @@ func (x *GetListExecutionRecordResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetListExecutionRecordResponse.ProtoReflect.Descriptor instead. func (*GetListExecutionRecordResponse) Descriptor() ([]byte, []int) { - return file_pb_cron_proto_rawDescGZIP(), []int{15} + return file_pb_cron_proto_rawDescGZIP(), []int{16} } func (x *GetListExecutionRecordResponse) GetCode() int32 { @@ -1615,7 +1698,7 @@ type GetListExecutionResultRequest struct { func (x *GetListExecutionResultRequest) Reset() { *x = GetListExecutionResultRequest{} - mi := &file_pb_cron_proto_msgTypes[16] + mi := &file_pb_cron_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1627,7 +1710,7 @@ func (x *GetListExecutionResultRequest) String() string { func (*GetListExecutionResultRequest) ProtoMessage() {} func (x *GetListExecutionResultRequest) ProtoReflect() protoreflect.Message { - mi := &file_pb_cron_proto_msgTypes[16] + mi := &file_pb_cron_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1640,7 +1723,7 @@ func (x *GetListExecutionResultRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetListExecutionResultRequest.ProtoReflect.Descriptor instead. func (*GetListExecutionResultRequest) Descriptor() ([]byte, []int) { - return file_pb_cron_proto_rawDescGZIP(), []int{16} + return file_pb_cron_proto_rawDescGZIP(), []int{17} } func (x *GetListExecutionResultRequest) GetPage() int32 { @@ -1720,7 +1803,7 @@ type GetListExecutionResultResponse struct { func (x *GetListExecutionResultResponse) Reset() { *x = GetListExecutionResultResponse{} - mi := &file_pb_cron_proto_msgTypes[17] + mi := &file_pb_cron_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1732,7 +1815,7 @@ func (x *GetListExecutionResultResponse) String() string { func (*GetListExecutionResultResponse) ProtoMessage() {} func (x *GetListExecutionResultResponse) ProtoReflect() protoreflect.Message { - mi := &file_pb_cron_proto_msgTypes[17] + mi := &file_pb_cron_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1745,7 +1828,7 @@ func (x *GetListExecutionResultResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetListExecutionResultResponse.ProtoReflect.Descriptor instead. func (*GetListExecutionResultResponse) Descriptor() ([]byte, []int) { - return file_pb_cron_proto_rawDescGZIP(), []int{17} + return file_pb_cron_proto_rawDescGZIP(), []int{18} } func (x *GetListExecutionResultResponse) GetCode() int32 { @@ -1800,7 +1883,7 @@ type TaskStatus struct { func (x *TaskStatus) Reset() { *x = TaskStatus{} - mi := &file_pb_cron_proto_msgTypes[18] + mi := &file_pb_cron_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1812,7 +1895,7 @@ func (x *TaskStatus) String() string { func (*TaskStatus) ProtoMessage() {} func (x *TaskStatus) ProtoReflect() protoreflect.Message { - mi := &file_pb_cron_proto_msgTypes[18] + mi := &file_pb_cron_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1825,7 +1908,7 @@ func (x *TaskStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use TaskStatus.ProtoReflect.Descriptor instead. func (*TaskStatus) Descriptor() ([]byte, []int) { - return file_pb_cron_proto_rawDescGZIP(), []int{18} + return file_pb_cron_proto_rawDescGZIP(), []int{19} } func (x *TaskStatus) GetKey() int32 { @@ -1853,7 +1936,7 @@ type GetScheduleTaskStatusResponse struct { func (x *GetScheduleTaskStatusResponse) Reset() { *x = GetScheduleTaskStatusResponse{} - mi := &file_pb_cron_proto_msgTypes[19] + mi := &file_pb_cron_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1865,7 +1948,7 @@ func (x *GetScheduleTaskStatusResponse) String() string { func (*GetScheduleTaskStatusResponse) ProtoMessage() {} func (x *GetScheduleTaskStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_pb_cron_proto_msgTypes[19] + mi := &file_pb_cron_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1878,7 +1961,7 @@ func (x *GetScheduleTaskStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetScheduleTaskStatusResponse.ProtoReflect.Descriptor instead. func (*GetScheduleTaskStatusResponse) Descriptor() ([]byte, []int) { - return file_pb_cron_proto_rawDescGZIP(), []int{19} + return file_pb_cron_proto_rawDescGZIP(), []int{20} } func (x *GetScheduleTaskStatusResponse) GetCode() int32 { @@ -1906,7 +1989,7 @@ var File_pb_cron_proto protoreflect.FileDescriptor const file_pb_cron_proto_rawDesc = "" + "\n" + - "\rpb/cron.proto\x12\x04cron\x1a\x1bgoogle/protobuf/empty.proto\"!\n" + + "\rpb/cron.proto\x12\x04cron\"!\n" + "\x0fCommonIDRequest\x12\x0e\n" + "\x02id\x18\x01 \x01(\rR\x02id\">\n" + "\x0eCommonResponse\x12\x12\n" + @@ -2026,7 +2109,7 @@ const file_pb_cron_proto_rawDesc = "" + "\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\"\x9c\x03\n" + + "\x04data\x18\x03 \x01(\v2\x12.cron.ScheduleTaskR\x04data\"\xae\x03\n" + "\x19UpdateScheduleTaskRequest\x12\x17\n" + "\atask_id\x18\x01 \x01(\x04R\x06taskId\x12\x1d\n" + "\n" + @@ -2042,9 +2125,16 @@ const file_pb_cron_proto_rawDesc = "" + "\x12execute_start_time\x18\b \x01(\tR\x10executeStartTime\x12(\n" + "\x10execute_end_time\x18\t \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\"r\n" + + " \x01(\tR\x06remark\x12J\n" + + "\vtask_detail\x18\v \x01(\v2).cron.UpdateScheduleTaskRequestTaskDetailR\n" + + "taskDetail\"\xd2\x01\n" + + "#UpdateScheduleTaskRequestTaskDetail\x12\x0e\n" + + "\x02id\x18\x05 \x01(\x05R\x02id\x12\x17\n" + + "\atask_id\x18\x06 \x01(\x05R\x06taskId\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" + "\x1aUpdateScheduleTaskResponse\x12\x12\n" + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + "\amessage\x18\x02 \x01(\tR\amessage\x12&\n" + @@ -2133,29 +2223,30 @@ func file_pb_cron_proto_rawDescGZIP() []byte { return file_pb_cron_proto_rawDescData } -var file_pb_cron_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_pb_cron_proto_msgTypes = make([]protoimpl.MessageInfo, 22) var file_pb_cron_proto_goTypes = []any{ - (*CommonIDRequest)(nil), // 0: cron.CommonIDRequest - (*CommonResponse)(nil), // 1: cron.CommonResponse - (*ScheduleTask)(nil), // 2: cron.ScheduleTask - (*TaskDetail)(nil), // 3: cron.TaskDetail - (*ArtistInfo)(nil), // 4: cron.ArtistInfo - (*ExecutionRecord)(nil), // 5: cron.ExecutionRecord - (*ExecutionResult)(nil), // 6: cron.ExecutionResult - (*CreateScheduleTaskRequest)(nil), // 7: cron.CreateScheduleTaskRequest - (*TaskDetailRequest)(nil), // 8: cron.TaskDetailRequest - (*CreateScheduleTaskResponse)(nil), // 9: cron.CreateScheduleTaskResponse - (*UpdateScheduleTaskRequest)(nil), // 10: cron.UpdateScheduleTaskRequest - (*UpdateScheduleTaskResponse)(nil), // 11: cron.UpdateScheduleTaskResponse - (*GetListScheduleTaskRequest)(nil), // 12: cron.GetListScheduleTaskRequest - (*GetListScheduleTaskResponse)(nil), // 13: cron.GetListScheduleTaskResponse - (*GetListExecutionRecordRequest)(nil), // 14: cron.GetListExecutionRecordRequest - (*GetListExecutionRecordResponse)(nil), // 15: cron.GetListExecutionRecordResponse - (*GetListExecutionResultRequest)(nil), // 16: cron.GetListExecutionResultRequest - (*GetListExecutionResultResponse)(nil), // 17: cron.GetListExecutionResultResponse - (*TaskStatus)(nil), // 18: cron.TaskStatus - (*GetScheduleTaskStatusResponse)(nil), // 19: cron.GetScheduleTaskStatusResponse - nil, // 20: cron.GetListScheduleTaskRequest.SortsEntry + (*CommonIDRequest)(nil), // 0: cron.CommonIDRequest + (*CommonResponse)(nil), // 1: cron.CommonResponse + (*ScheduleTask)(nil), // 2: cron.ScheduleTask + (*TaskDetail)(nil), // 3: cron.TaskDetail + (*ArtistInfo)(nil), // 4: cron.ArtistInfo + (*ExecutionRecord)(nil), // 5: cron.ExecutionRecord + (*ExecutionResult)(nil), // 6: cron.ExecutionResult + (*CreateScheduleTaskRequest)(nil), // 7: cron.CreateScheduleTaskRequest + (*TaskDetailRequest)(nil), // 8: cron.TaskDetailRequest + (*CreateScheduleTaskResponse)(nil), // 9: cron.CreateScheduleTaskResponse + (*UpdateScheduleTaskRequest)(nil), // 10: cron.UpdateScheduleTaskRequest + (*UpdateScheduleTaskRequestTaskDetail)(nil), // 11: cron.UpdateScheduleTaskRequestTaskDetail + (*UpdateScheduleTaskResponse)(nil), // 12: cron.UpdateScheduleTaskResponse + (*GetListScheduleTaskRequest)(nil), // 13: cron.GetListScheduleTaskRequest + (*GetListScheduleTaskResponse)(nil), // 14: cron.GetListScheduleTaskResponse + (*GetListExecutionRecordRequest)(nil), // 15: cron.GetListExecutionRecordRequest + (*GetListExecutionRecordResponse)(nil), // 16: cron.GetListExecutionRecordResponse + (*GetListExecutionResultRequest)(nil), // 17: cron.GetListExecutionResultRequest + (*GetListExecutionResultResponse)(nil), // 18: cron.GetListExecutionResultResponse + (*TaskStatus)(nil), // 19: cron.TaskStatus + (*GetScheduleTaskStatusResponse)(nil), // 20: cron.GetScheduleTaskStatusResponse + nil, // 21: cron.GetListScheduleTaskRequest.SortsEntry } var file_pb_cron_proto_depIdxs = []int32{ 3, // 0: cron.ScheduleTask.task_detail:type_name -> cron.TaskDetail @@ -2165,18 +2256,19 @@ var file_pb_cron_proto_depIdxs = []int32{ 8, // 4: cron.CreateScheduleTaskRequest.task_detail:type_name -> cron.TaskDetailRequest 4, // 5: cron.TaskDetailRequest.artists:type_name -> cron.ArtistInfo 2, // 6: cron.CreateScheduleTaskResponse.data:type_name -> cron.ScheduleTask - 8, // 7: cron.UpdateScheduleTaskRequest.task_detail:type_name -> cron.TaskDetailRequest - 2, // 8: cron.UpdateScheduleTaskResponse.data:type_name -> cron.ScheduleTask - 20, // 9: cron.GetListScheduleTaskRequest.sorts:type_name -> cron.GetListScheduleTaskRequest.SortsEntry - 2, // 10: cron.GetListScheduleTaskResponse.data:type_name -> cron.ScheduleTask - 5, // 11: cron.GetListExecutionRecordResponse.data:type_name -> cron.ExecutionRecord - 6, // 12: cron.GetListExecutionResultResponse.data:type_name -> cron.ExecutionResult - 18, // 13: cron.GetScheduleTaskStatusResponse.data:type_name -> cron.TaskStatus - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 11, // 7: cron.UpdateScheduleTaskRequest.task_detail:type_name -> cron.UpdateScheduleTaskRequestTaskDetail + 4, // 8: cron.UpdateScheduleTaskRequestTaskDetail.artists:type_name -> cron.ArtistInfo + 2, // 9: cron.UpdateScheduleTaskResponse.data:type_name -> cron.ScheduleTask + 21, // 10: cron.GetListScheduleTaskRequest.sorts:type_name -> cron.GetListScheduleTaskRequest.SortsEntry + 2, // 11: cron.GetListScheduleTaskResponse.data:type_name -> cron.ScheduleTask + 5, // 12: cron.GetListExecutionRecordResponse.data:type_name -> cron.ExecutionRecord + 6, // 13: cron.GetListExecutionResultResponse.data:type_name -> cron.ExecutionResult + 19, // 14: cron.GetScheduleTaskStatusResponse.data:type_name -> cron.TaskStatus + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_pb_cron_proto_init() } @@ -2190,7 +2282,7 @@ func file_pb_cron_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_cron_proto_rawDesc), len(file_pb_cron_proto_rawDesc)), NumEnums: 0, - NumMessages: 21, + NumMessages: 22, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cron/cron.validator.pb.go b/api/cron/cron.validator.pb.go index 013f142..e2d124b 100644 --- a/api/cron/cron.validator.pb.go +++ b/api/cron/cron.validator.pb.go @@ -7,7 +7,6 @@ import ( fmt "fmt" math "math" proto "github.com/golang/protobuf/proto" - _ "google.golang.org/protobuf/types/known/emptypb" github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" ) @@ -97,6 +96,16 @@ func (this *UpdateScheduleTaskRequest) Validate() error { } return nil } +func (this *UpdateScheduleTaskRequestTaskDetail) 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 *UpdateScheduleTaskResponse) Validate() error { if this.Data != nil { if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil { From 28e7e3beba2b5e49275f1ae3fcd37324f0ea0572 Mon Sep 17 00:00:00 2001 From: bx1834938347-prog Date: Thu, 8 Jan 2026 11:26:11 +0800 Subject: [PATCH 3/7] =?UTF-8?q?feat=EF=BC=9A=E6=96=B0=E5=A2=9E=E5=9B=BE?= =?UTF-8?q?=E6=96=87=E5=AF=BC=E5=85=A5=E7=9A=84=E5=85=B6=E4=BB=96=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/import/imageContentImport.go | 30 +++++++---- pkg/service/import/imageContentProcessor.go | 58 ++++++++++++++++++++- 2 files changed, 78 insertions(+), 10 deletions(-) diff --git a/pkg/service/import/imageContentImport.go b/pkg/service/import/imageContentImport.go index 7470368..6f43d79 100644 --- a/pkg/service/import/imageContentImport.go +++ b/pkg/service/import/imageContentImport.go @@ -30,6 +30,8 @@ type excelData struct { SubNum string //用户编号 必须字段 TikTok string Instagram string + YouTube string + BlueSky string Youtube string Desc string //艺人简介 TitleRequire string //标题要求 必须字段 @@ -178,27 +180,35 @@ func readExcel(excelPath string) ([]excelData, error) { if subNum == "" { return nil, fmt.Errorf("第%d行应该有编号", i+1) } - tikTok := getCellValue(f, sheetName, i, 2) + blueSky := getCellValue(f, sheetName, i, 3) + if blueSky == "" { + return nil, fmt.Errorf("第%d行应该有bluesky账号昵称", i+1) + } + tikTok := getCellValue(f, sheetName, i, 4) if tikTok == "" { return nil, fmt.Errorf("第%d行应该有tiktok账号昵称", i+1) } - instagram := getCellValue(f, sheetName, i, 3) + youtube := getCellValue(f, sheetName, i, 5) + if youtube == "" { + return nil, fmt.Errorf("第%d行应该有youtube账号昵称", i+1) + } + instagram := getCellValue(f, sheetName, i, 6) if instagram == "" { return nil, fmt.Errorf("第%d行应该有ins账号昵称", i+1) } - desc := getCellValue(f, sheetName, i, 4) - titleRequire := getCellValue(f, sheetName, i, 5) + desc := getCellValue(f, sheetName, i, 6) + titleRequire := getCellValue(f, sheetName, i, 7) if titleRequire == "" { return nil, fmt.Errorf("第%d行应该有标题要求", i+1) } - contentRequire := getCellValue(f, sheetName, i, 6) + contentRequire := getCellValue(f, sheetName, i, 8) if contentRequire == "" { return nil, fmt.Errorf("第%d行应该有内容要求", i+1) } - photoRequire := getCellValue(f, sheetName, i, 7) - photoUrl := getCellValue(f, sheetName, i, 8) - photoNumStr := getCellValue(f, sheetName, i, 9) - photoDpi := getCellValue(f, sheetName, i, 10) + photoRequire := getCellValue(f, sheetName, i, 9) + photoUrl := getCellValue(f, sheetName, i, 10) + photoNumStr := getCellValue(f, sheetName, i, 11) + photoDpi := getCellValue(f, sheetName, i, 12) var num int if photoUrl == "" { //如果没有关联画作,数量必须有,需求必须有 //需求必须有 @@ -220,8 +230,10 @@ func readExcel(excelPath string) ([]excelData, error) { data := excelData{ ArtistName: artistName, SubNum: subNum, + BlueSky: blueSky, TikTok: tikTok, Instagram: instagram, + YouTube: youtube, Desc: desc, TitleRequire: titleRequire, ContentRequire: contentRequire, diff --git a/pkg/service/import/imageContentProcessor.go b/pkg/service/import/imageContentProcessor.go index 862a6d9..042b27e 100644 --- a/pkg/service/import/imageContentProcessor.go +++ b/pkg/service/import/imageContentProcessor.go @@ -293,6 +293,7 @@ func (p *BatchProcessor) submitTask(req *excelData) error { if !tiktokFound { return fmt.Errorf("未找到匹配的TikTok账号: %s", req.TikTok) } + // 获取 Instagram 自媒体账号 accountListIns, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{ ArtistVal: req.ArtistName, @@ -307,7 +308,6 @@ func (p *BatchProcessor) submitTask(req *excelData) error { if accountListIns == nil || len(accountListIns.Data) == 0 { return fmt.Errorf("ins自媒体账号数量为0") } - // 查找 Instagram 账号 insFound := false for _, user := range accountListIns.Data { @@ -322,6 +322,62 @@ func (p *BatchProcessor) submitTask(req *excelData) error { return fmt.Errorf("未找到匹配的Instagram账号: %s", req.Instagram) } + // 获取 Bluesky 自媒体账号 + accountListBlueSky, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{ + ArtistVal: req.ArtistName, + PlatformID: 5, // Bluesky platform ID + Page: 1, + PageSize: 10, + ArtistUuid: strconv.FormatUint(list.UserList[0].Id, 10), + }) + if err != nil { + return fmt.Errorf("获取 Bluesky 账号失败: %s", err.Error()) + } + if accountListBlueSky == nil || len(accountListBlueSky.Data) == 0 { + return fmt.Errorf("bluesky自媒体账号数量为0") + } + // 查找 Bluesky 账号 + blueSkyFound := false + for _, user := range accountListBlueSky.Data { + if user.PlatformUserName == req.BlueSky { + req.MediaAccountNames = append(req.MediaAccountNames, user.PlatformUserName) + req.MediaAccountUuids = append(req.MediaAccountUuids, user.MediaAccountUuid) + blueSkyFound = true + break + } + } + if !blueSkyFound { + return fmt.Errorf("未找到匹配的Bluesky账号: %s", req.BlueSky) + } + + // 获取 YouTube 自媒体账号 + accountListYouTube, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{ + ArtistVal: req.ArtistName, + PlatformID: 2, // YouTube platform ID + Page: 1, + PageSize: 10, + ArtistUuid: strconv.FormatUint(list.UserList[0].Id, 10), + }) + if err != nil { + return fmt.Errorf("获取 YouTube 账号失败: %s", err.Error()) + } + if accountListYouTube == nil || len(accountListYouTube.Data) == 0 { + return fmt.Errorf("youtube自媒体账号数量为0") + } + // 查找 YouTube 账号 + youTubeFound := false + for _, user := range accountListYouTube.Data { + if user.PlatformUserName == req.YouTube { + req.MediaAccountNames = append(req.MediaAccountNames, user.PlatformUserName) + req.MediaAccountUuids = append(req.MediaAccountUuids, user.MediaAccountUuid) + youTubeFound = true + break + } + } + if !youTubeFound { + return fmt.Errorf("未找到匹配的YouTube账号: %s", req.YouTube) + } + switch { case req.PhotoUrl == "": // 如果没有提供照片 URL,生成标题和内容 // 生成标题和内容 From e7aae9247cad98721aceadb36ad9ea8a26c94170 Mon Sep 17 00:00:00 2001 From: bx1834938347-prog Date: Thu, 8 Jan 2026 13:24:20 +0800 Subject: [PATCH 4/7] Update imageContentImport.go --- pkg/service/import/imageContentImport.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/service/import/imageContentImport.go b/pkg/service/import/imageContentImport.go index 6f43d79..c86613a 100644 --- a/pkg/service/import/imageContentImport.go +++ b/pkg/service/import/imageContentImport.go @@ -180,19 +180,19 @@ func readExcel(excelPath string) ([]excelData, error) { if subNum == "" { return nil, fmt.Errorf("第%d行应该有编号", i+1) } - blueSky := getCellValue(f, sheetName, i, 3) + blueSky := getCellValue(f, sheetName, i, 2) if blueSky == "" { return nil, fmt.Errorf("第%d行应该有bluesky账号昵称", i+1) } - tikTok := getCellValue(f, sheetName, i, 4) + tikTok := getCellValue(f, sheetName, i, 3) if tikTok == "" { return nil, fmt.Errorf("第%d行应该有tiktok账号昵称", i+1) } - youtube := getCellValue(f, sheetName, i, 5) + youtube := getCellValue(f, sheetName, i, 4) if youtube == "" { return nil, fmt.Errorf("第%d行应该有youtube账号昵称", i+1) } - instagram := getCellValue(f, sheetName, i, 6) + instagram := getCellValue(f, sheetName, i, 5) if instagram == "" { return nil, fmt.Errorf("第%d行应该有ins账号昵称", i+1) } From 646b4c7f3f61c9eacb5028bf5515f0ccbc6ee28c Mon Sep 17 00:00:00 2001 From: bx1834938347-prog Date: Thu, 8 Jan 2026 13:31:03 +0800 Subject: [PATCH 5/7] Update imageContentImport.go --- pkg/service/import/imageContentImport.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkg/service/import/imageContentImport.go b/pkg/service/import/imageContentImport.go index c86613a..2f23c01 100644 --- a/pkg/service/import/imageContentImport.go +++ b/pkg/service/import/imageContentImport.go @@ -189,13 +189,7 @@ func readExcel(excelPath string) ([]excelData, error) { return nil, fmt.Errorf("第%d行应该有tiktok账号昵称", i+1) } youtube := getCellValue(f, sheetName, i, 4) - if youtube == "" { - return nil, fmt.Errorf("第%d行应该有youtube账号昵称", i+1) - } instagram := getCellValue(f, sheetName, i, 5) - if instagram == "" { - return nil, fmt.Errorf("第%d行应该有ins账号昵称", i+1) - } desc := getCellValue(f, sheetName, i, 6) titleRequire := getCellValue(f, sheetName, i, 7) if titleRequire == "" { From 420d7060355fd7ff11f762b15a7e1fcd010f743a Mon Sep 17 00:00:00 2001 From: bx1834938347-prog Date: Thu, 8 Jan 2026 15:20:13 +0800 Subject: [PATCH 6/7] =?UTF-8?q?feat=EF=BC=9A=E4=BF=AE=E6=94=B9=E5=AF=BC?= =?UTF-8?q?=E5=85=A5excel=E7=9A=84=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/import/imageContentImport.go | 19 +++++++------- pkg/service/import/imageContentProcessor.go | 28 --------------------- 2 files changed, 10 insertions(+), 37 deletions(-) diff --git a/pkg/service/import/imageContentImport.go b/pkg/service/import/imageContentImport.go index 2f23c01..9f6262c 100644 --- a/pkg/service/import/imageContentImport.go +++ b/pkg/service/import/imageContentImport.go @@ -188,21 +188,22 @@ func readExcel(excelPath string) ([]excelData, error) { if tikTok == "" { return nil, fmt.Errorf("第%d行应该有tiktok账号昵称", i+1) } - youtube := getCellValue(f, sheetName, i, 4) - instagram := getCellValue(f, sheetName, i, 5) - desc := getCellValue(f, sheetName, i, 6) - titleRequire := getCellValue(f, sheetName, i, 7) + instagram := getCellValue(f, sheetName, i, 4) + + desc := getCellValue(f, sheetName, i, 5) + + titleRequire := getCellValue(f, sheetName, i, 6) if titleRequire == "" { return nil, fmt.Errorf("第%d行应该有标题要求", i+1) } - contentRequire := getCellValue(f, sheetName, i, 8) + contentRequire := getCellValue(f, sheetName, i, 7) if contentRequire == "" { return nil, fmt.Errorf("第%d行应该有内容要求", i+1) } - photoRequire := getCellValue(f, sheetName, i, 9) - photoUrl := getCellValue(f, sheetName, i, 10) - photoNumStr := getCellValue(f, sheetName, i, 11) - photoDpi := getCellValue(f, sheetName, i, 12) + photoRequire := getCellValue(f, sheetName, i, 8) + photoUrl := getCellValue(f, sheetName, i, 9) + photoNumStr := getCellValue(f, sheetName, i, 10) + photoDpi := getCellValue(f, sheetName, i, 11) var num int if photoUrl == "" { //如果没有关联画作,数量必须有,需求必须有 //需求必须有 diff --git a/pkg/service/import/imageContentProcessor.go b/pkg/service/import/imageContentProcessor.go index 042b27e..a5e3299 100644 --- a/pkg/service/import/imageContentProcessor.go +++ b/pkg/service/import/imageContentProcessor.go @@ -350,34 +350,6 @@ func (p *BatchProcessor) submitTask(req *excelData) error { return fmt.Errorf("未找到匹配的Bluesky账号: %s", req.BlueSky) } - // 获取 YouTube 自媒体账号 - accountListYouTube, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{ - ArtistVal: req.ArtistName, - PlatformID: 2, // YouTube platform ID - Page: 1, - PageSize: 10, - ArtistUuid: strconv.FormatUint(list.UserList[0].Id, 10), - }) - if err != nil { - return fmt.Errorf("获取 YouTube 账号失败: %s", err.Error()) - } - if accountListYouTube == nil || len(accountListYouTube.Data) == 0 { - return fmt.Errorf("youtube自媒体账号数量为0") - } - // 查找 YouTube 账号 - youTubeFound := false - for _, user := range accountListYouTube.Data { - if user.PlatformUserName == req.YouTube { - req.MediaAccountNames = append(req.MediaAccountNames, user.PlatformUserName) - req.MediaAccountUuids = append(req.MediaAccountUuids, user.MediaAccountUuid) - youTubeFound = true - break - } - } - if !youTubeFound { - return fmt.Errorf("未找到匹配的YouTube账号: %s", req.YouTube) - } - switch { case req.PhotoUrl == "": // 如果没有提供照片 URL,生成标题和内容 // 生成标题和内容 From 13caea6d29633f29053b6b63ece7fd536891d5f2 Mon Sep 17 00:00:00 2001 From: bx1834938347-prog Date: Thu, 8 Jan 2026 15:21:05 +0800 Subject: [PATCH 7/7] Update imageContentImport.go --- pkg/service/import/imageContentImport.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/service/import/imageContentImport.go b/pkg/service/import/imageContentImport.go index 9f6262c..f298484 100644 --- a/pkg/service/import/imageContentImport.go +++ b/pkg/service/import/imageContentImport.go @@ -228,7 +228,6 @@ func readExcel(excelPath string) ([]excelData, error) { BlueSky: blueSky, TikTok: tikTok, Instagram: instagram, - YouTube: youtube, Desc: desc, TitleRequire: titleRequire, ContentRequire: contentRequire,