Merge branch 'wwq'

This commit is contained in:
bx1834938347-prog 2026-01-09 14:03:16 +08:00
commit d095fdedf4
4 changed files with 246 additions and 95 deletions

View File

@ -9,7 +9,6 @@ package cron
import ( import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
_ "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect" reflect "reflect"
sync "sync" sync "sync"
unsafe "unsafe" unsafe "unsafe"
@ -1039,18 +1038,18 @@ func (x *CreateScheduleTaskResponse) GetData() *ScheduleTask {
} }
type UpdateScheduleTaskRequest struct { type UpdateScheduleTaskRequest struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
TaskId uint64 `protobuf:"varint,1,opt,name=task_id,json=taskId,proto3" json:"task_id"` // 任务ID用于标识需要更新的任务 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"` // 任务标题 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"` // 描述 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"` // 周期类型 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"` // 每周任务的星期几 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"` // 自定义日期 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"` // 开始日期 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"` // 执行开始时间 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"` // 执行结束时间 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"` // 备注 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"` // 任务详情 TaskDetail *UpdateScheduleTaskRequestTaskDetail `protobuf:"bytes,11,opt,name=task_detail,json=taskDetail,proto3" json:"task_detail"` // 任务详情
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
@ -1155,13 +1154,97 @@ func (x *UpdateScheduleTaskRequest) GetRemark() string {
return "" return ""
} }
func (x *UpdateScheduleTaskRequest) GetTaskDetail() *TaskDetailRequest { func (x *UpdateScheduleTaskRequest) GetTaskDetail() *UpdateScheduleTaskRequestTaskDetail {
if x != nil { if x != nil {
return x.TaskDetail return x.TaskDetail
} }
return nil 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 { type UpdateScheduleTaskResponse struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应码 Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应码
@ -1173,7 +1256,7 @@ type UpdateScheduleTaskResponse struct {
func (x *UpdateScheduleTaskResponse) Reset() { func (x *UpdateScheduleTaskResponse) Reset() {
*x = UpdateScheduleTaskResponse{} *x = UpdateScheduleTaskResponse{}
mi := &file_pb_cron_proto_msgTypes[11] mi := &file_pb_cron_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1185,7 +1268,7 @@ func (x *UpdateScheduleTaskResponse) String() string {
func (*UpdateScheduleTaskResponse) ProtoMessage() {} func (*UpdateScheduleTaskResponse) ProtoMessage() {}
func (x *UpdateScheduleTaskResponse) ProtoReflect() protoreflect.Message { func (x *UpdateScheduleTaskResponse) ProtoReflect() protoreflect.Message {
mi := &file_pb_cron_proto_msgTypes[11] mi := &file_pb_cron_proto_msgTypes[12]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1198,7 +1281,7 @@ func (x *UpdateScheduleTaskResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateScheduleTaskResponse.ProtoReflect.Descriptor instead. // Deprecated: Use UpdateScheduleTaskResponse.ProtoReflect.Descriptor instead.
func (*UpdateScheduleTaskResponse) Descriptor() ([]byte, []int) { 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 { func (x *UpdateScheduleTaskResponse) GetCode() int32 {
@ -1232,13 +1315,14 @@ type GetListScheduleTaskRequest struct {
EndTime string `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3" json:"end_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"` // 任务状态 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"` // 内容类型 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 unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
} }
func (x *GetListScheduleTaskRequest) Reset() { func (x *GetListScheduleTaskRequest) Reset() {
*x = GetListScheduleTaskRequest{} *x = GetListScheduleTaskRequest{}
mi := &file_pb_cron_proto_msgTypes[12] mi := &file_pb_cron_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1250,7 +1334,7 @@ func (x *GetListScheduleTaskRequest) String() string {
func (*GetListScheduleTaskRequest) ProtoMessage() {} func (*GetListScheduleTaskRequest) ProtoMessage() {}
func (x *GetListScheduleTaskRequest) ProtoReflect() protoreflect.Message { func (x *GetListScheduleTaskRequest) ProtoReflect() protoreflect.Message {
mi := &file_pb_cron_proto_msgTypes[12] mi := &file_pb_cron_proto_msgTypes[13]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1263,7 +1347,7 @@ func (x *GetListScheduleTaskRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetListScheduleTaskRequest.ProtoReflect.Descriptor instead. // Deprecated: Use GetListScheduleTaskRequest.ProtoReflect.Descriptor instead.
func (*GetListScheduleTaskRequest) Descriptor() ([]byte, []int) { 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 { func (x *GetListScheduleTaskRequest) GetPage() int32 {
@ -1322,6 +1406,13 @@ func (x *GetListScheduleTaskRequest) GetContentType() int32 {
return 0 return 0
} }
func (x *GetListScheduleTaskRequest) GetSorts() map[string]string {
if x != nil {
return x.Sorts
}
return nil
}
type GetListScheduleTaskResponse struct { type GetListScheduleTaskResponse struct {
state protoimpl.MessageState `protogen:"open.v1"` state protoimpl.MessageState `protogen:"open.v1"`
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应码 Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code"` // 响应码
@ -1336,7 +1427,7 @@ type GetListScheduleTaskResponse struct {
func (x *GetListScheduleTaskResponse) Reset() { func (x *GetListScheduleTaskResponse) Reset() {
*x = GetListScheduleTaskResponse{} *x = GetListScheduleTaskResponse{}
mi := &file_pb_cron_proto_msgTypes[13] mi := &file_pb_cron_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1348,7 +1439,7 @@ func (x *GetListScheduleTaskResponse) String() string {
func (*GetListScheduleTaskResponse) ProtoMessage() {} func (*GetListScheduleTaskResponse) ProtoMessage() {}
func (x *GetListScheduleTaskResponse) ProtoReflect() protoreflect.Message { func (x *GetListScheduleTaskResponse) ProtoReflect() protoreflect.Message {
mi := &file_pb_cron_proto_msgTypes[13] mi := &file_pb_cron_proto_msgTypes[14]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1361,7 +1452,7 @@ func (x *GetListScheduleTaskResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetListScheduleTaskResponse.ProtoReflect.Descriptor instead. // Deprecated: Use GetListScheduleTaskResponse.ProtoReflect.Descriptor instead.
func (*GetListScheduleTaskResponse) Descriptor() ([]byte, []int) { 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 { func (x *GetListScheduleTaskResponse) GetCode() int32 {
@ -1422,7 +1513,7 @@ type GetListExecutionRecordRequest struct {
func (x *GetListExecutionRecordRequest) Reset() { func (x *GetListExecutionRecordRequest) Reset() {
*x = GetListExecutionRecordRequest{} *x = GetListExecutionRecordRequest{}
mi := &file_pb_cron_proto_msgTypes[14] mi := &file_pb_cron_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1434,7 +1525,7 @@ func (x *GetListExecutionRecordRequest) String() string {
func (*GetListExecutionRecordRequest) ProtoMessage() {} func (*GetListExecutionRecordRequest) ProtoMessage() {}
func (x *GetListExecutionRecordRequest) ProtoReflect() protoreflect.Message { func (x *GetListExecutionRecordRequest) ProtoReflect() protoreflect.Message {
mi := &file_pb_cron_proto_msgTypes[14] mi := &file_pb_cron_proto_msgTypes[15]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1447,7 +1538,7 @@ func (x *GetListExecutionRecordRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetListExecutionRecordRequest.ProtoReflect.Descriptor instead. // Deprecated: Use GetListExecutionRecordRequest.ProtoReflect.Descriptor instead.
func (*GetListExecutionRecordRequest) Descriptor() ([]byte, []int) { 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 { func (x *GetListExecutionRecordRequest) GetPage() int32 {
@ -1520,7 +1611,7 @@ type GetListExecutionRecordResponse struct {
func (x *GetListExecutionRecordResponse) Reset() { func (x *GetListExecutionRecordResponse) Reset() {
*x = GetListExecutionRecordResponse{} *x = GetListExecutionRecordResponse{}
mi := &file_pb_cron_proto_msgTypes[15] mi := &file_pb_cron_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1532,7 +1623,7 @@ func (x *GetListExecutionRecordResponse) String() string {
func (*GetListExecutionRecordResponse) ProtoMessage() {} func (*GetListExecutionRecordResponse) ProtoMessage() {}
func (x *GetListExecutionRecordResponse) ProtoReflect() protoreflect.Message { func (x *GetListExecutionRecordResponse) ProtoReflect() protoreflect.Message {
mi := &file_pb_cron_proto_msgTypes[15] mi := &file_pb_cron_proto_msgTypes[16]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1545,7 +1636,7 @@ func (x *GetListExecutionRecordResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetListExecutionRecordResponse.ProtoReflect.Descriptor instead. // Deprecated: Use GetListExecutionRecordResponse.ProtoReflect.Descriptor instead.
func (*GetListExecutionRecordResponse) Descriptor() ([]byte, []int) { 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 { func (x *GetListExecutionRecordResponse) GetCode() int32 {
@ -1607,7 +1698,7 @@ type GetListExecutionResultRequest struct {
func (x *GetListExecutionResultRequest) Reset() { func (x *GetListExecutionResultRequest) Reset() {
*x = GetListExecutionResultRequest{} *x = GetListExecutionResultRequest{}
mi := &file_pb_cron_proto_msgTypes[16] mi := &file_pb_cron_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1619,7 +1710,7 @@ func (x *GetListExecutionResultRequest) String() string {
func (*GetListExecutionResultRequest) ProtoMessage() {} func (*GetListExecutionResultRequest) ProtoMessage() {}
func (x *GetListExecutionResultRequest) ProtoReflect() protoreflect.Message { func (x *GetListExecutionResultRequest) ProtoReflect() protoreflect.Message {
mi := &file_pb_cron_proto_msgTypes[16] mi := &file_pb_cron_proto_msgTypes[17]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1632,7 +1723,7 @@ func (x *GetListExecutionResultRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetListExecutionResultRequest.ProtoReflect.Descriptor instead. // Deprecated: Use GetListExecutionResultRequest.ProtoReflect.Descriptor instead.
func (*GetListExecutionResultRequest) Descriptor() ([]byte, []int) { 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 { func (x *GetListExecutionResultRequest) GetPage() int32 {
@ -1712,7 +1803,7 @@ type GetListExecutionResultResponse struct {
func (x *GetListExecutionResultResponse) Reset() { func (x *GetListExecutionResultResponse) Reset() {
*x = GetListExecutionResultResponse{} *x = GetListExecutionResultResponse{}
mi := &file_pb_cron_proto_msgTypes[17] mi := &file_pb_cron_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1724,7 +1815,7 @@ func (x *GetListExecutionResultResponse) String() string {
func (*GetListExecutionResultResponse) ProtoMessage() {} func (*GetListExecutionResultResponse) ProtoMessage() {}
func (x *GetListExecutionResultResponse) ProtoReflect() protoreflect.Message { func (x *GetListExecutionResultResponse) ProtoReflect() protoreflect.Message {
mi := &file_pb_cron_proto_msgTypes[17] mi := &file_pb_cron_proto_msgTypes[18]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1737,7 +1828,7 @@ func (x *GetListExecutionResultResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetListExecutionResultResponse.ProtoReflect.Descriptor instead. // Deprecated: Use GetListExecutionResultResponse.ProtoReflect.Descriptor instead.
func (*GetListExecutionResultResponse) Descriptor() ([]byte, []int) { 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 { func (x *GetListExecutionResultResponse) GetCode() int32 {
@ -1792,7 +1883,7 @@ type TaskStatus struct {
func (x *TaskStatus) Reset() { func (x *TaskStatus) Reset() {
*x = TaskStatus{} *x = TaskStatus{}
mi := &file_pb_cron_proto_msgTypes[18] mi := &file_pb_cron_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1804,7 +1895,7 @@ func (x *TaskStatus) String() string {
func (*TaskStatus) ProtoMessage() {} func (*TaskStatus) ProtoMessage() {}
func (x *TaskStatus) ProtoReflect() protoreflect.Message { func (x *TaskStatus) ProtoReflect() protoreflect.Message {
mi := &file_pb_cron_proto_msgTypes[18] mi := &file_pb_cron_proto_msgTypes[19]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1817,7 +1908,7 @@ func (x *TaskStatus) ProtoReflect() protoreflect.Message {
// Deprecated: Use TaskStatus.ProtoReflect.Descriptor instead. // Deprecated: Use TaskStatus.ProtoReflect.Descriptor instead.
func (*TaskStatus) Descriptor() ([]byte, []int) { 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 { func (x *TaskStatus) GetKey() int32 {
@ -1845,7 +1936,7 @@ type GetScheduleTaskStatusResponse struct {
func (x *GetScheduleTaskStatusResponse) Reset() { func (x *GetScheduleTaskStatusResponse) Reset() {
*x = GetScheduleTaskStatusResponse{} *x = GetScheduleTaskStatusResponse{}
mi := &file_pb_cron_proto_msgTypes[19] mi := &file_pb_cron_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
} }
@ -1857,7 +1948,7 @@ func (x *GetScheduleTaskStatusResponse) String() string {
func (*GetScheduleTaskStatusResponse) ProtoMessage() {} func (*GetScheduleTaskStatusResponse) ProtoMessage() {}
func (x *GetScheduleTaskStatusResponse) ProtoReflect() protoreflect.Message { func (x *GetScheduleTaskStatusResponse) ProtoReflect() protoreflect.Message {
mi := &file_pb_cron_proto_msgTypes[19] mi := &file_pb_cron_proto_msgTypes[20]
if x != nil { if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
@ -1870,7 +1961,7 @@ func (x *GetScheduleTaskStatusResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetScheduleTaskStatusResponse.ProtoReflect.Descriptor instead. // Deprecated: Use GetScheduleTaskStatusResponse.ProtoReflect.Descriptor instead.
func (*GetScheduleTaskStatusResponse) Descriptor() ([]byte, []int) { 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 { func (x *GetScheduleTaskStatusResponse) GetCode() int32 {
@ -1898,7 +1989,7 @@ var File_pb_cron_proto protoreflect.FileDescriptor
const file_pb_cron_proto_rawDesc = "" + const file_pb_cron_proto_rawDesc = "" +
"\n" + "\n" +
"\rpb/cron.proto\x12\x04cron\x1a\x1bgoogle/protobuf/empty.proto\"!\n" + "\rpb/cron.proto\x12\x04cron\"!\n" +
"\x0fCommonIDRequest\x12\x0e\n" + "\x0fCommonIDRequest\x12\x0e\n" +
"\x02id\x18\x01 \x01(\rR\x02id\">\n" + "\x02id\x18\x01 \x01(\rR\x02id\">\n" +
"\x0eCommonResponse\x12\x12\n" + "\x0eCommonResponse\x12\x12\n" +
@ -2018,7 +2109,7 @@ const file_pb_cron_proto_rawDesc = "" +
"\x1aCreateScheduleTaskResponse\x12\x12\n" + "\x1aCreateScheduleTaskResponse\x12\x12\n" +
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\x12&\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" + "\x19UpdateScheduleTaskRequest\x12\x17\n" +
"\atask_id\x18\x01 \x01(\x04R\x06taskId\x12\x1d\n" + "\atask_id\x18\x01 \x01(\x04R\x06taskId\x12\x1d\n" +
"\n" + "\n" +
@ -2034,13 +2125,20 @@ const file_pb_cron_proto_rawDesc = "" +
"\x12execute_start_time\x18\b \x01(\tR\x10executeStartTime\x12(\n" + "\x12execute_start_time\x18\b \x01(\tR\x10executeStartTime\x12(\n" +
"\x10execute_end_time\x18\t \x01(\tR\x0eexecuteEndTime\x12\x16\n" + "\x10execute_end_time\x18\t \x01(\tR\x0eexecuteEndTime\x12\x16\n" +
"\x06remark\x18\n" + "\x06remark\x18\n" +
" \x01(\tR\x06remark\x128\n" + " \x01(\tR\x06remark\x12J\n" +
"\vtask_detail\x18\v \x01(\v2\x17.cron.TaskDetailRequestR\n" + "\vtask_detail\x18\v \x01(\v2).cron.UpdateScheduleTaskRequestTaskDetailR\n" +
"taskDetail\"r\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" + "\x1aUpdateScheduleTaskResponse\x12\x12\n" +
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\x12&\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" + "\x1aGetListScheduleTaskRequest\x12\x12\n" +
"\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" + "\x04page\x18\x01 \x01(\x05R\x04page\x12\x1b\n" +
"\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x1d\n" +
@ -2052,7 +2150,12 @@ const file_pb_cron_proto_rawDesc = "" +
"start_time\x18\x05 \x01(\tR\tstartTime\x12\x19\n" + "start_time\x18\x05 \x01(\tR\tstartTime\x12\x19\n" +
"\bend_time\x18\x06 \x01(\tR\aendTime\x12\x16\n" + "\bend_time\x18\x06 \x01(\tR\aendTime\x12\x16\n" +
"\x06Status\x18\a \x01(\x05R\x06Status\x12!\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" + "\x1bGetListScheduleTaskResponse\x12\x12\n" +
"\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" + "\x04code\x18\x01 \x01(\x05R\x04code\x12\x18\n" +
"\amessage\x18\x02 \x01(\tR\amessage\x12\x14\n" + "\amessage\x18\x02 \x01(\tR\amessage\x12\x14\n" +
@ -2120,28 +2223,30 @@ func file_pb_cron_proto_rawDescGZIP() []byte {
return file_pb_cron_proto_rawDescData 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, 22)
var file_pb_cron_proto_goTypes = []any{ var file_pb_cron_proto_goTypes = []any{
(*CommonIDRequest)(nil), // 0: cron.CommonIDRequest (*CommonIDRequest)(nil), // 0: cron.CommonIDRequest
(*CommonResponse)(nil), // 1: cron.CommonResponse (*CommonResponse)(nil), // 1: cron.CommonResponse
(*ScheduleTask)(nil), // 2: cron.ScheduleTask (*ScheduleTask)(nil), // 2: cron.ScheduleTask
(*TaskDetail)(nil), // 3: cron.TaskDetail (*TaskDetail)(nil), // 3: cron.TaskDetail
(*ArtistInfo)(nil), // 4: cron.ArtistInfo (*ArtistInfo)(nil), // 4: cron.ArtistInfo
(*ExecutionRecord)(nil), // 5: cron.ExecutionRecord (*ExecutionRecord)(nil), // 5: cron.ExecutionRecord
(*ExecutionResult)(nil), // 6: cron.ExecutionResult (*ExecutionResult)(nil), // 6: cron.ExecutionResult
(*CreateScheduleTaskRequest)(nil), // 7: cron.CreateScheduleTaskRequest (*CreateScheduleTaskRequest)(nil), // 7: cron.CreateScheduleTaskRequest
(*TaskDetailRequest)(nil), // 8: cron.TaskDetailRequest (*TaskDetailRequest)(nil), // 8: cron.TaskDetailRequest
(*CreateScheduleTaskResponse)(nil), // 9: cron.CreateScheduleTaskResponse (*CreateScheduleTaskResponse)(nil), // 9: cron.CreateScheduleTaskResponse
(*UpdateScheduleTaskRequest)(nil), // 10: cron.UpdateScheduleTaskRequest (*UpdateScheduleTaskRequest)(nil), // 10: cron.UpdateScheduleTaskRequest
(*UpdateScheduleTaskResponse)(nil), // 11: cron.UpdateScheduleTaskResponse (*UpdateScheduleTaskRequestTaskDetail)(nil), // 11: cron.UpdateScheduleTaskRequestTaskDetail
(*GetListScheduleTaskRequest)(nil), // 12: cron.GetListScheduleTaskRequest (*UpdateScheduleTaskResponse)(nil), // 12: cron.UpdateScheduleTaskResponse
(*GetListScheduleTaskResponse)(nil), // 13: cron.GetListScheduleTaskResponse (*GetListScheduleTaskRequest)(nil), // 13: cron.GetListScheduleTaskRequest
(*GetListExecutionRecordRequest)(nil), // 14: cron.GetListExecutionRecordRequest (*GetListScheduleTaskResponse)(nil), // 14: cron.GetListScheduleTaskResponse
(*GetListExecutionRecordResponse)(nil), // 15: cron.GetListExecutionRecordResponse (*GetListExecutionRecordRequest)(nil), // 15: cron.GetListExecutionRecordRequest
(*GetListExecutionResultRequest)(nil), // 16: cron.GetListExecutionResultRequest (*GetListExecutionRecordResponse)(nil), // 16: cron.GetListExecutionRecordResponse
(*GetListExecutionResultResponse)(nil), // 17: cron.GetListExecutionResultResponse (*GetListExecutionResultRequest)(nil), // 17: cron.GetListExecutionResultRequest
(*TaskStatus)(nil), // 18: cron.TaskStatus (*GetListExecutionResultResponse)(nil), // 18: cron.GetListExecutionResultResponse
(*GetScheduleTaskStatusResponse)(nil), // 19: cron.GetScheduleTaskStatusResponse (*TaskStatus)(nil), // 19: cron.TaskStatus
(*GetScheduleTaskStatusResponse)(nil), // 20: cron.GetScheduleTaskStatusResponse
nil, // 21: cron.GetListScheduleTaskRequest.SortsEntry
} }
var file_pb_cron_proto_depIdxs = []int32{ var file_pb_cron_proto_depIdxs = []int32{
3, // 0: cron.ScheduleTask.task_detail:type_name -> cron.TaskDetail 3, // 0: cron.ScheduleTask.task_detail:type_name -> cron.TaskDetail
@ -2151,17 +2256,19 @@ var file_pb_cron_proto_depIdxs = []int32{
8, // 4: cron.CreateScheduleTaskRequest.task_detail:type_name -> cron.TaskDetailRequest 8, // 4: cron.CreateScheduleTaskRequest.task_detail:type_name -> cron.TaskDetailRequest
4, // 5: cron.TaskDetailRequest.artists:type_name -> cron.ArtistInfo 4, // 5: cron.TaskDetailRequest.artists:type_name -> cron.ArtistInfo
2, // 6: cron.CreateScheduleTaskResponse.data:type_name -> cron.ScheduleTask 2, // 6: cron.CreateScheduleTaskResponse.data:type_name -> cron.ScheduleTask
8, // 7: cron.UpdateScheduleTaskRequest.task_detail:type_name -> cron.TaskDetailRequest 11, // 7: cron.UpdateScheduleTaskRequest.task_detail:type_name -> cron.UpdateScheduleTaskRequestTaskDetail
2, // 8: cron.UpdateScheduleTaskResponse.data:type_name -> cron.ScheduleTask 4, // 8: cron.UpdateScheduleTaskRequestTaskDetail.artists:type_name -> cron.ArtistInfo
2, // 9: cron.GetListScheduleTaskResponse.data:type_name -> cron.ScheduleTask 2, // 9: cron.UpdateScheduleTaskResponse.data:type_name -> cron.ScheduleTask
5, // 10: cron.GetListExecutionRecordResponse.data:type_name -> cron.ExecutionRecord 21, // 10: cron.GetListScheduleTaskRequest.sorts:type_name -> cron.GetListScheduleTaskRequest.SortsEntry
6, // 11: cron.GetListExecutionResultResponse.data:type_name -> cron.ExecutionResult 2, // 11: cron.GetListScheduleTaskResponse.data:type_name -> cron.ScheduleTask
18, // 12: cron.GetScheduleTaskStatusResponse.data:type_name -> cron.TaskStatus 5, // 12: cron.GetListExecutionRecordResponse.data:type_name -> cron.ExecutionRecord
13, // [13:13] is the sub-list for method output_type 6, // 13: cron.GetListExecutionResultResponse.data:type_name -> cron.ExecutionResult
13, // [13:13] is the sub-list for method input_type 19, // 14: cron.GetScheduleTaskStatusResponse.data:type_name -> cron.TaskStatus
13, // [13:13] is the sub-list for extension type_name 15, // [15:15] is the sub-list for method output_type
13, // [13:13] is the sub-list for extension extendee 15, // [15:15] is the sub-list for method input_type
0, // [0:13] is the sub-list for field type_name 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() } func init() { file_pb_cron_proto_init() }
@ -2175,7 +2282,7 @@ func file_pb_cron_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_cron_proto_rawDesc), len(file_pb_cron_proto_rawDesc)), RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_cron_proto_rawDesc), len(file_pb_cron_proto_rawDesc)),
NumEnums: 0, NumEnums: 0,
NumMessages: 20, NumMessages: 22,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -7,7 +7,6 @@ import (
fmt "fmt" fmt "fmt"
math "math" math "math"
proto "github.com/golang/protobuf/proto" 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" github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
) )
@ -97,6 +96,16 @@ func (this *UpdateScheduleTaskRequest) Validate() error {
} }
return nil 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 { func (this *UpdateScheduleTaskResponse) Validate() error {
if this.Data != nil { if this.Data != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil { if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Data); err != nil {
@ -106,6 +115,7 @@ func (this *UpdateScheduleTaskResponse) Validate() error {
return nil return nil
} }
func (this *GetListScheduleTaskRequest) Validate() error { func (this *GetListScheduleTaskRequest) Validate() error {
// Validation of proto3 map<> fields is unsupported.
return nil return nil
} }
func (this *GetListScheduleTaskResponse) Validate() error { func (this *GetListScheduleTaskResponse) Validate() error {

View File

@ -30,6 +30,8 @@ type excelData struct {
SubNum string //用户编号 必须字段 SubNum string //用户编号 必须字段
TikTok string TikTok string
Instagram string Instagram string
YouTube string
BlueSky string
Youtube string Youtube string
Desc string //艺人简介 Desc string //艺人简介
TitleRequire string //标题要求 必须字段 TitleRequire string //标题要求 必须字段
@ -178,27 +180,30 @@ func readExcel(excelPath string) ([]excelData, error) {
if subNum == "" { if subNum == "" {
return nil, fmt.Errorf("第%d行应该有编号", i+1) return nil, fmt.Errorf("第%d行应该有编号", i+1)
} }
tikTok := getCellValue(f, sheetName, i, 2) blueSky := getCellValue(f, sheetName, i, 2)
if blueSky == "" {
return nil, fmt.Errorf("第%d行应该有bluesky账号昵称", i+1)
}
tikTok := getCellValue(f, sheetName, i, 3)
if tikTok == "" { if tikTok == "" {
return nil, fmt.Errorf("第%d行应该有tiktok账号昵称", i+1) return nil, fmt.Errorf("第%d行应该有tiktok账号昵称", i+1)
} }
instagram := getCellValue(f, sheetName, i, 3) instagram := getCellValue(f, sheetName, i, 4)
if instagram == "" {
return nil, fmt.Errorf("第%d行应该有ins账号昵称", i+1) desc := getCellValue(f, sheetName, i, 5)
}
desc := getCellValue(f, sheetName, i, 4) titleRequire := getCellValue(f, sheetName, i, 6)
titleRequire := getCellValue(f, sheetName, i, 5)
if titleRequire == "" { if titleRequire == "" {
return nil, fmt.Errorf("第%d行应该有标题要求", i+1) return nil, fmt.Errorf("第%d行应该有标题要求", i+1)
} }
contentRequire := getCellValue(f, sheetName, i, 6) contentRequire := getCellValue(f, sheetName, i, 7)
if contentRequire == "" { if contentRequire == "" {
return nil, fmt.Errorf("第%d行应该有内容要求", i+1) return nil, fmt.Errorf("第%d行应该有内容要求", i+1)
} }
photoRequire := getCellValue(f, sheetName, i, 7) photoRequire := getCellValue(f, sheetName, i, 8)
photoUrl := getCellValue(f, sheetName, i, 8) photoUrl := getCellValue(f, sheetName, i, 9)
photoNumStr := getCellValue(f, sheetName, i, 9) photoNumStr := getCellValue(f, sheetName, i, 10)
photoDpi := getCellValue(f, sheetName, i, 10) photoDpi := getCellValue(f, sheetName, i, 11)
var num int var num int
if photoUrl == "" { //如果没有关联画作,数量必须有,需求必须有 if photoUrl == "" { //如果没有关联画作,数量必须有,需求必须有
//需求必须有 //需求必须有
@ -220,6 +225,7 @@ func readExcel(excelPath string) ([]excelData, error) {
data := excelData{ data := excelData{
ArtistName: artistName, ArtistName: artistName,
SubNum: subNum, SubNum: subNum,
BlueSky: blueSky,
TikTok: tikTok, TikTok: tikTok,
Instagram: instagram, Instagram: instagram,
Desc: desc, Desc: desc,

View File

@ -293,6 +293,7 @@ func (p *BatchProcessor) submitTask(req *excelData) error {
if !tiktokFound { if !tiktokFound {
return fmt.Errorf("未找到匹配的TikTok账号: %s", req.TikTok) return fmt.Errorf("未找到匹配的TikTok账号: %s", req.TikTok)
} }
// 获取 Instagram 自媒体账号 // 获取 Instagram 自媒体账号
accountListIns, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{ accountListIns, err := service.CastProvider.MediaUserList(context.Background(), &apiCast.MediaUserListReq{
ArtistVal: req.ArtistName, ArtistVal: req.ArtistName,
@ -307,7 +308,6 @@ func (p *BatchProcessor) submitTask(req *excelData) error {
if accountListIns == nil || len(accountListIns.Data) == 0 { if accountListIns == nil || len(accountListIns.Data) == 0 {
return fmt.Errorf("ins自媒体账号数量为0") return fmt.Errorf("ins自媒体账号数量为0")
} }
// 查找 Instagram 账号 // 查找 Instagram 账号
insFound := false insFound := false
for _, user := range accountListIns.Data { for _, user := range accountListIns.Data {
@ -322,6 +322,34 @@ func (p *BatchProcessor) submitTask(req *excelData) error {
return fmt.Errorf("未找到匹配的Instagram账号: %s", req.Instagram) 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)
}
switch { switch {
case req.PhotoUrl == "": // 如果没有提供照片 URL生成标题和内容 case req.PhotoUrl == "": // 如果没有提供照片 URL生成标题和内容
// 生成标题和内容 // 生成标题和内容