From 9505244db0e400519509d6cb595b790965740ce0 Mon Sep 17 00:00:00 2001 From: zerosaturation Date: Tue, 12 May 2026 10:42:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=96=B0=E5=A2=9E=E9=93=B8=E9=80=A0?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E8=BF=90=E8=90=A5=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/activity.pb.go | 1579 +++++++++++++++++ .../gateway/controller/activity_controller.go | 86 + backend/gateway/router/router.go | 6 + .../pkg/proto/gallery/gallery.triple.go | 338 ---- backend/pkg/models/minting_activity.go | 19 + backend/pkg/proto/activity/activity.pb.go | 358 +++- backend/pkg/proto/activity/activity.triple.go | 31 +- backend/pkg/proto/gallery/gallery.pb.go | 369 ++-- backend/proto/activity.proto | 38 + backend/services/activityService/main.go | 4 +- .../provider/activity_provider.go | 28 + .../repository/minting_activity_repository.go | 80 + frontend/pages/components/CastloveContent.vue | 75 +- frontend/utils/api.js | 14 + 14 files changed, 2386 insertions(+), 639 deletions(-) create mode 100644 backend/activity.pb.go delete mode 100644 backend/github.com/topfans/backend/pkg/proto/gallery/gallery.triple.go create mode 100644 backend/pkg/models/minting_activity.go create mode 100644 backend/services/activityService/repository/minting_activity_repository.go diff --git a/backend/activity.pb.go b/backend/activity.pb.go new file mode 100644 index 0000000..4f7a0ed --- /dev/null +++ b/backend/activity.pb.go @@ -0,0 +1,1579 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.11 +// protoc v7.34.0 +// source: activity.proto + +package activity + +import ( + common "github.com/topfans/backend/pkg/proto/common" + _ "google.golang.org/genproto/googleapis/api/annotations" + 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 Activity struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ActivityType string `protobuf:"bytes,2,opt,name=activity_type,json=activityType,proto3" json:"activity_type,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + Theme string `protobuf:"bytes,17,opt,name=theme,proto3" json:"theme,omitempty"` // 中文主题 + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + StarId int64 `protobuf:"varint,5,opt,name=star_id,json=starId,proto3" json:"star_id,omitempty"` + StartTime int64 `protobuf:"varint,6,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"` + EndTime int64 `protobuf:"varint,7,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + TargetProgress int64 `protobuf:"varint,8,opt,name=target_progress,json=targetProgress,proto3" json:"target_progress,omitempty"` + CurrentProgress int64 `protobuf:"varint,9,opt,name=current_progress,json=currentProgress,proto3" json:"current_progress,omitempty"` + Status string `protobuf:"bytes,10,opt,name=status,proto3" json:"status,omitempty"` + CurrentStage string `protobuf:"bytes,11,opt,name=current_stage,json=currentStage,proto3" json:"current_stage,omitempty"` // 当前阶段: early/mid/late/completed + Items []*ActivityItem `protobuf:"bytes,12,rep,name=items,proto3" json:"items,omitempty"` + CoverImage string `protobuf:"bytes,13,opt,name=cover_image,json=coverImage,proto3" json:"cover_image,omitempty"` // 封面图 + BannerImage string `protobuf:"bytes,14,opt,name=banner_image,json=bannerImage,proto3" json:"banner_image,omitempty"` // 横幅图 + CurrentStageBackground string `protobuf:"bytes,15,opt,name=current_stage_background,json=currentStageBackground,proto3" json:"current_stage_background,omitempty"` // 当前阶段背景图 + CurrentStageTitle string `protobuf:"bytes,16,opt,name=current_stage_title,json=currentStageTitle,proto3" json:"current_stage_title,omitempty"` // 当前阶段标题 + OverallEndTime int64 `protobuf:"varint,18,opt,name=overall_end_time,json=overallEndTime,proto3" json:"overall_end_time,omitempty"` // 整体活动结束时间 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Activity) Reset() { + *x = Activity{} + mi := &file_activity_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Activity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Activity) ProtoMessage() {} + +func (x *Activity) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 Activity.ProtoReflect.Descriptor instead. +func (*Activity) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{0} +} + +func (x *Activity) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Activity) GetActivityType() string { + if x != nil { + return x.ActivityType + } + return "" +} + +func (x *Activity) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *Activity) GetTheme() string { + if x != nil { + return x.Theme + } + return "" +} + +func (x *Activity) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *Activity) GetStarId() int64 { + if x != nil { + return x.StarId + } + return 0 +} + +func (x *Activity) GetStartTime() int64 { + if x != nil { + return x.StartTime + } + return 0 +} + +func (x *Activity) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *Activity) GetTargetProgress() int64 { + if x != nil { + return x.TargetProgress + } + return 0 +} + +func (x *Activity) GetCurrentProgress() int64 { + if x != nil { + return x.CurrentProgress + } + return 0 +} + +func (x *Activity) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *Activity) GetCurrentStage() string { + if x != nil { + return x.CurrentStage + } + return "" +} + +func (x *Activity) GetItems() []*ActivityItem { + if x != nil { + return x.Items + } + return nil +} + +func (x *Activity) GetCoverImage() string { + if x != nil { + return x.CoverImage + } + return "" +} + +func (x *Activity) GetBannerImage() string { + if x != nil { + return x.BannerImage + } + return "" +} + +func (x *Activity) GetCurrentStageBackground() string { + if x != nil { + return x.CurrentStageBackground + } + return "" +} + +func (x *Activity) GetCurrentStageTitle() string { + if x != nil { + return x.CurrentStageTitle + } + return "" +} + +func (x *Activity) GetOverallEndTime() int64 { + if x != nil { + return x.OverallEndTime + } + return 0 +} + +// 活动道具 +type ActivityItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + ItemType string `protobuf:"bytes,2,opt,name=item_type,json=itemType,proto3" json:"item_type,omitempty"` + ItemName string `protobuf:"bytes,3,opt,name=item_name,json=itemName,proto3" json:"item_name,omitempty"` + IconUrl string `protobuf:"bytes,4,opt,name=icon_url,json=iconUrl,proto3" json:"icon_url,omitempty"` + CrystalCost int32 `protobuf:"varint,5,opt,name=crystal_cost,json=crystalCost,proto3" json:"crystal_cost,omitempty"` + ContributionPoints int32 `protobuf:"varint,6,opt,name=contribution_points,json=contributionPoints,proto3" json:"contribution_points,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ActivityItem) Reset() { + *x = ActivityItem{} + mi := &file_activity_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ActivityItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivityItem) ProtoMessage() {} + +func (x *ActivityItem) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 ActivityItem.ProtoReflect.Descriptor instead. +func (*ActivityItem) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{1} +} + +func (x *ActivityItem) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ActivityItem) GetItemType() string { + if x != nil { + return x.ItemType + } + return "" +} + +func (x *ActivityItem) GetItemName() string { + if x != nil { + return x.ItemName + } + return "" +} + +func (x *ActivityItem) GetIconUrl() string { + if x != nil { + return x.IconUrl + } + return "" +} + +func (x *ActivityItem) GetCrystalCost() int32 { + if x != nil { + return x.CrystalCost + } + return 0 +} + +func (x *ActivityItem) GetContributionPoints() int32 { + if x != nil { + return x.ContributionPoints + } + return 0 +} + +// 活动道具列表响应 +type ActivityItemsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Items []*ActivityItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ActivityItemsResponse) Reset() { + *x = ActivityItemsResponse{} + mi := &file_activity_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ActivityItemsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivityItemsResponse) ProtoMessage() {} + +func (x *ActivityItemsResponse) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 ActivityItemsResponse.ProtoReflect.Descriptor instead. +func (*ActivityItemsResponse) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{2} +} + +func (x *ActivityItemsResponse) GetItems() []*ActivityItem { + if x != nil { + return x.Items + } + return nil +} + +// 购买道具请求 +type PurchaseItemRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActivityId int64 `protobuf:"varint,1,opt,name=activity_id,json=activityId,proto3" json:"activity_id,omitempty"` + ItemType string `protobuf:"bytes,2,opt,name=item_type,json=itemType,proto3" json:"item_type,omitempty"` + Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"` + StarId int64 `protobuf:"varint,4,opt,name=star_id,json=starId,proto3" json:"star_id,omitempty"` + UserId int64 `protobuf:"varint,5,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 当前用户ID + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PurchaseItemRequest) Reset() { + *x = PurchaseItemRequest{} + mi := &file_activity_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PurchaseItemRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PurchaseItemRequest) ProtoMessage() {} + +func (x *PurchaseItemRequest) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 PurchaseItemRequest.ProtoReflect.Descriptor instead. +func (*PurchaseItemRequest) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{3} +} + +func (x *PurchaseItemRequest) GetActivityId() int64 { + if x != nil { + return x.ActivityId + } + return 0 +} + +func (x *PurchaseItemRequest) GetItemType() string { + if x != nil { + return x.ItemType + } + return "" +} + +func (x *PurchaseItemRequest) GetQuantity() int32 { + if x != nil { + return x.Quantity + } + return 0 +} + +func (x *PurchaseItemRequest) GetStarId() int64 { + if x != nil { + return x.StarId + } + return 0 +} + +func (x *PurchaseItemRequest) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +// 购买道具响应 +type PurchaseItemResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Base *common.BaseResponse `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + TotalCrystalSpent int64 `protobuf:"varint,2,opt,name=total_crystal_spent,json=totalCrystalSpent,proto3" json:"total_crystal_spent,omitempty"` // 本次消费水晶 + TotalContribution int64 `protobuf:"varint,3,opt,name=total_contribution,json=totalContribution,proto3" json:"total_contribution,omitempty"` // 本次获得贡献点 + CurrentProgress int64 `protobuf:"varint,4,opt,name=current_progress,json=currentProgress,proto3" json:"current_progress,omitempty"` // 当前活动进度 + RemainingBalance int64 `protobuf:"varint,5,opt,name=remaining_balance,json=remainingBalance,proto3" json:"remaining_balance,omitempty"` // 剩余水晶余额 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PurchaseItemResponse) Reset() { + *x = PurchaseItemResponse{} + mi := &file_activity_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PurchaseItemResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PurchaseItemResponse) ProtoMessage() {} + +func (x *PurchaseItemResponse) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 PurchaseItemResponse.ProtoReflect.Descriptor instead. +func (*PurchaseItemResponse) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{4} +} + +func (x *PurchaseItemResponse) GetBase() *common.BaseResponse { + if x != nil { + return x.Base + } + return nil +} + +func (x *PurchaseItemResponse) GetTotalCrystalSpent() int64 { + if x != nil { + return x.TotalCrystalSpent + } + return 0 +} + +func (x *PurchaseItemResponse) GetTotalContribution() int64 { + if x != nil { + return x.TotalContribution + } + return 0 +} + +func (x *PurchaseItemResponse) GetCurrentProgress() int64 { + if x != nil { + return x.CurrentProgress + } + return 0 +} + +func (x *PurchaseItemResponse) GetRemainingBalance() int64 { + if x != nil { + return x.RemainingBalance + } + return 0 +} + +// 贡献点排名请求 +type ContributionRankingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActivityId int64 `protobuf:"varint,1,opt,name=activity_id,json=activityId,proto3" json:"activity_id,omitempty"` + StarId int64 `protobuf:"varint,2,opt,name=star_id,json=starId,proto3" json:"star_id,omitempty"` + Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + UserId int64 `protobuf:"varint,5,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 当前用户ID,用于获取自己的排名 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContributionRankingRequest) Reset() { + *x = ContributionRankingRequest{} + mi := &file_activity_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContributionRankingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContributionRankingRequest) ProtoMessage() {} + +func (x *ContributionRankingRequest) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 ContributionRankingRequest.ProtoReflect.Descriptor instead. +func (*ContributionRankingRequest) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{5} +} + +func (x *ContributionRankingRequest) GetActivityId() int64 { + if x != nil { + return x.ActivityId + } + return 0 +} + +func (x *ContributionRankingRequest) GetStarId() int64 { + if x != nil { + return x.StarId + } + return 0 +} + +func (x *ContributionRankingRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ContributionRankingRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ContributionRankingRequest) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +// 贡献点排名项 +type ContributionRankingItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + Rank int32 `protobuf:"varint,1,opt,name=rank,proto3" json:"rank,omitempty"` + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Nickname string `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname,omitempty"` + AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + TotalContribution int64 `protobuf:"varint,5,opt,name=total_contribution,json=totalContribution,proto3" json:"total_contribution,omitempty"` + TotalCrystalSpent int64 `protobuf:"varint,6,opt,name=total_crystal_spent,json=totalCrystalSpent,proto3" json:"total_crystal_spent,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContributionRankingItem) Reset() { + *x = ContributionRankingItem{} + mi := &file_activity_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContributionRankingItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContributionRankingItem) ProtoMessage() {} + +func (x *ContributionRankingItem) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 ContributionRankingItem.ProtoReflect.Descriptor instead. +func (*ContributionRankingItem) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{6} +} + +func (x *ContributionRankingItem) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *ContributionRankingItem) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ContributionRankingItem) GetNickname() string { + if x != nil { + return x.Nickname + } + return "" +} + +func (x *ContributionRankingItem) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +func (x *ContributionRankingItem) GetTotalContribution() int64 { + if x != nil { + return x.TotalContribution + } + return 0 +} + +func (x *ContributionRankingItem) GetTotalCrystalSpent() int64 { + if x != nil { + return x.TotalCrystalSpent + } + return 0 +} + +// 贡献点排名响应 +type ContributionRankingResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Base *common.BaseResponse `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + Items []*ContributionRankingItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` + MyContribution *MyContribution `protobuf:"bytes,3,opt,name=my_contribution,json=myContribution,proto3" json:"my_contribution,omitempty"` + Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Total int32 `protobuf:"varint,6,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ContributionRankingResponse) Reset() { + *x = ContributionRankingResponse{} + mi := &file_activity_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ContributionRankingResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ContributionRankingResponse) ProtoMessage() {} + +func (x *ContributionRankingResponse) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 ContributionRankingResponse.ProtoReflect.Descriptor instead. +func (*ContributionRankingResponse) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{7} +} + +func (x *ContributionRankingResponse) GetBase() *common.BaseResponse { + if x != nil { + return x.Base + } + return nil +} + +func (x *ContributionRankingResponse) GetItems() []*ContributionRankingItem { + if x != nil { + return x.Items + } + return nil +} + +func (x *ContributionRankingResponse) GetMyContribution() *MyContribution { + if x != nil { + return x.MyContribution + } + return nil +} + +func (x *ContributionRankingResponse) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ContributionRankingResponse) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ContributionRankingResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 我的贡献信息 +type MyContribution struct { + state protoimpl.MessageState `protogen:"open.v1"` + Rank int32 `protobuf:"varint,1,opt,name=rank,proto3" json:"rank,omitempty"` + TotalContribution int64 `protobuf:"varint,2,opt,name=total_contribution,json=totalContribution,proto3" json:"total_contribution,omitempty"` + TotalCrystalSpent int64 `protobuf:"varint,3,opt,name=total_crystal_spent,json=totalCrystalSpent,proto3" json:"total_crystal_spent,omitempty"` + Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` // ranked/unranked + Nickname string `protobuf:"bytes,5,opt,name=nickname,proto3" json:"nickname,omitempty"` + AvatarUrl string `protobuf:"bytes,6,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MyContribution) Reset() { + *x = MyContribution{} + mi := &file_activity_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MyContribution) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MyContribution) ProtoMessage() {} + +func (x *MyContribution) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 MyContribution.ProtoReflect.Descriptor instead. +func (*MyContribution) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{8} +} + +func (x *MyContribution) GetRank() int32 { + if x != nil { + return x.Rank + } + return 0 +} + +func (x *MyContribution) GetTotalContribution() int64 { + if x != nil { + return x.TotalContribution + } + return 0 +} + +func (x *MyContribution) GetTotalCrystalSpent() int64 { + if x != nil { + return x.TotalCrystalSpent + } + return 0 +} + +func (x *MyContribution) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *MyContribution) GetNickname() string { + if x != nil { + return x.Nickname + } + return "" +} + +func (x *MyContribution) GetAvatarUrl() string { + if x != nil { + return x.AvatarUrl + } + return "" +} + +// 活动列表请求 +type GetActivityListRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + StarId int64 `protobuf:"varint,1,opt,name=star_id,json=starId,proto3" json:"star_id,omitempty"` + Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // 可选: pending/active/completed/expired + Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetActivityListRequest) Reset() { + *x = GetActivityListRequest{} + mi := &file_activity_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetActivityListRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActivityListRequest) ProtoMessage() {} + +func (x *GetActivityListRequest) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 GetActivityListRequest.ProtoReflect.Descriptor instead. +func (*GetActivityListRequest) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{9} +} + +func (x *GetActivityListRequest) GetStarId() int64 { + if x != nil { + return x.StarId + } + return 0 +} + +func (x *GetActivityListRequest) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +func (x *GetActivityListRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetActivityListRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +// 活动列表响应 +type GetActivityListResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Base *common.BaseResponse `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + Activities []*Activity `protobuf:"bytes,2,rep,name=activities,proto3" json:"activities,omitempty"` + Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Total int32 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetActivityListResponse) Reset() { + *x = GetActivityListResponse{} + mi := &file_activity_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetActivityListResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetActivityListResponse) ProtoMessage() {} + +func (x *GetActivityListResponse) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 GetActivityListResponse.ProtoReflect.Descriptor instead. +func (*GetActivityListResponse) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{10} +} + +func (x *GetActivityListResponse) GetBase() *common.BaseResponse { + if x != nil { + return x.Base + } + return nil +} + +func (x *GetActivityListResponse) GetActivities() []*Activity { + if x != nil { + return x.Activities + } + return nil +} + +func (x *GetActivityListResponse) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetActivityListResponse) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *GetActivityListResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +// 进度信息请求 +type GetProgressRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + ActivityId int64 `protobuf:"varint,1,opt,name=activity_id,json=activityId,proto3" json:"activity_id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProgressRequest) Reset() { + *x = GetProgressRequest{} + mi := &file_activity_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProgressRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProgressRequest) ProtoMessage() {} + +func (x *GetProgressRequest) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 GetProgressRequest.ProtoReflect.Descriptor instead. +func (*GetProgressRequest) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{11} +} + +func (x *GetProgressRequest) GetActivityId() int64 { + if x != nil { + return x.ActivityId + } + return 0 +} + +// 进度信息响应 +type GetProgressResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Base *common.BaseResponse `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + ActivityId int64 `protobuf:"varint,2,opt,name=activity_id,json=activityId,proto3" json:"activity_id,omitempty"` + CurrentProgress int64 `protobuf:"varint,3,opt,name=current_progress,json=currentProgress,proto3" json:"current_progress,omitempty"` + TargetProgress int64 `protobuf:"varint,4,opt,name=target_progress,json=targetProgress,proto3" json:"target_progress,omitempty"` + CurrentStage string `protobuf:"bytes,5,opt,name=current_stage,json=currentStage,proto3" json:"current_stage,omitempty"` // early/mid/late/completed + EndTime int64 `protobuf:"varint,6,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"` + Status string `protobuf:"bytes,7,opt,name=status,proto3" json:"status,omitempty"` // pending/active/completed/expired + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetProgressResponse) Reset() { + *x = GetProgressResponse{} + mi := &file_activity_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetProgressResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetProgressResponse) ProtoMessage() {} + +func (x *GetProgressResponse) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 GetProgressResponse.ProtoReflect.Descriptor instead. +func (*GetProgressResponse) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{12} +} + +func (x *GetProgressResponse) GetBase() *common.BaseResponse { + if x != nil { + return x.Base + } + return nil +} + +func (x *GetProgressResponse) GetActivityId() int64 { + if x != nil { + return x.ActivityId + } + return 0 +} + +func (x *GetProgressResponse) GetCurrentProgress() int64 { + if x != nil { + return x.CurrentProgress + } + return 0 +} + +func (x *GetProgressResponse) GetTargetProgress() int64 { + if x != nil { + return x.TargetProgress + } + return 0 +} + +func (x *GetProgressResponse) GetCurrentStage() string { + if x != nil { + return x.CurrentStage + } + return "" +} + +func (x *GetProgressResponse) GetEndTime() int64 { + if x != nil { + return x.EndTime + } + return 0 +} + +func (x *GetProgressResponse) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +// 铸造活动信息(用于运营banner) +type MintingActivity struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + CoverImage string `protobuf:"bytes,4,opt,name=cover_image,json=coverImage,proto3" json:"cover_image,omitempty"` + StarId int64 `protobuf:"varint,5,opt,name=star_id,json=starId,proto3" json:"star_id,omitempty"` + Route string `protobuf:"bytes,6,opt,name=route,proto3" json:"route,omitempty"` + IsActive bool `protobuf:"varint,7,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"` + CreatedAt int64 `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt int64 `protobuf:"varint,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MintingActivity) Reset() { + *x = MintingActivity{} + mi := &file_activity_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MintingActivity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MintingActivity) ProtoMessage() {} + +func (x *MintingActivity) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 MintingActivity.ProtoReflect.Descriptor instead. +func (*MintingActivity) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{13} +} + +func (x *MintingActivity) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *MintingActivity) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *MintingActivity) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *MintingActivity) GetCoverImage() string { + if x != nil { + return x.CoverImage + } + return "" +} + +func (x *MintingActivity) GetStarId() int64 { + if x != nil { + return x.StarId + } + return 0 +} + +func (x *MintingActivity) GetRoute() string { + if x != nil { + return x.Route + } + return "" +} + +func (x *MintingActivity) GetIsActive() bool { + if x != nil { + return x.IsActive + } + return false +} + +func (x *MintingActivity) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *MintingActivity) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +// 获取铸造活动列表请求 +type GetMintingActivitiesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + StarId int64 `protobuf:"varint,1,opt,name=star_id,json=starId,proto3" json:"star_id,omitempty"` // 可选,不传则返回所有 + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMintingActivitiesRequest) Reset() { + *x = GetMintingActivitiesRequest{} + mi := &file_activity_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMintingActivitiesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMintingActivitiesRequest) ProtoMessage() {} + +func (x *GetMintingActivitiesRequest) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 GetMintingActivitiesRequest.ProtoReflect.Descriptor instead. +func (*GetMintingActivitiesRequest) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{14} +} + +func (x *GetMintingActivitiesRequest) GetStarId() int64 { + if x != nil { + return x.StarId + } + return 0 +} + +func (x *GetMintingActivitiesRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetMintingActivitiesRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +// 获取铸造活动列表响应 +type GetMintingActivitiesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Base *common.BaseResponse `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + Activities []*MintingActivity `protobuf:"bytes,2,rep,name=activities,proto3" json:"activities,omitempty"` + Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Total int32 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMintingActivitiesResponse) Reset() { + *x = GetMintingActivitiesResponse{} + mi := &file_activity_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMintingActivitiesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMintingActivitiesResponse) ProtoMessage() {} + +func (x *GetMintingActivitiesResponse) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 GetMintingActivitiesResponse.ProtoReflect.Descriptor instead. +func (*GetMintingActivitiesResponse) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{15} +} + +func (x *GetMintingActivitiesResponse) GetBase() *common.BaseResponse { + if x != nil { + return x.Base + } + return nil +} + +func (x *GetMintingActivitiesResponse) GetActivities() []*MintingActivity { + if x != nil { + return x.Activities + } + return nil +} + +func (x *GetMintingActivitiesResponse) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetMintingActivitiesResponse) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *GetMintingActivitiesResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +var File_activity_proto protoreflect.FileDescriptor + +const file_activity_proto_rawDesc = "" + + "\n" + + "\x0eactivity.proto\x12\x10topfans.activity\x1a\x12proto/common.proto\x1a\x1cgoogle/api/annotations.proto\"\xff\x04\n" + + "\bActivity\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12#\n" + + "\ractivity_type\x18\x02 \x01(\tR\factivityType\x12\x14\n" + + "\x05title\x18\x03 \x01(\tR\x05title\x12\x14\n" + + "\x05theme\x18\x11 \x01(\tR\x05theme\x12 \n" + + "\vdescription\x18\x04 \x01(\tR\vdescription\x12\x17\n" + + "\astar_id\x18\x05 \x01(\x03R\x06starId\x12\x1d\n" + + "\n" + + "start_time\x18\x06 \x01(\x03R\tstartTime\x12\x19\n" + + "\bend_time\x18\a \x01(\x03R\aendTime\x12'\n" + + "\x0ftarget_progress\x18\b \x01(\x03R\x0etargetProgress\x12)\n" + + "\x10current_progress\x18\t \x01(\x03R\x0fcurrentProgress\x12\x16\n" + + "\x06status\x18\n" + + " \x01(\tR\x06status\x12#\n" + + "\rcurrent_stage\x18\v \x01(\tR\fcurrentStage\x124\n" + + "\x05items\x18\f \x03(\v2\x1e.topfans.activity.ActivityItemR\x05items\x12\x1f\n" + + "\vcover_image\x18\r \x01(\tR\n" + + "coverImage\x12!\n" + + "\fbanner_image\x18\x0e \x01(\tR\vbannerImage\x128\n" + + "\x18current_stage_background\x18\x0f \x01(\tR\x16currentStageBackground\x12.\n" + + "\x13current_stage_title\x18\x10 \x01(\tR\x11currentStageTitle\x12(\n" + + "\x10overall_end_time\x18\x12 \x01(\x03R\x0eoverallEndTime\"\xc7\x01\n" + + "\fActivityItem\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x1b\n" + + "\titem_type\x18\x02 \x01(\tR\bitemType\x12\x1b\n" + + "\titem_name\x18\x03 \x01(\tR\bitemName\x12\x19\n" + + "\bicon_url\x18\x04 \x01(\tR\aiconUrl\x12!\n" + + "\fcrystal_cost\x18\x05 \x01(\x05R\vcrystalCost\x12/\n" + + "\x13contribution_points\x18\x06 \x01(\x05R\x12contributionPoints\"M\n" + + "\x15ActivityItemsResponse\x124\n" + + "\x05items\x18\x01 \x03(\v2\x1e.topfans.activity.ActivityItemR\x05items\"\xa1\x01\n" + + "\x13PurchaseItemRequest\x12\x1f\n" + + "\vactivity_id\x18\x01 \x01(\x03R\n" + + "activityId\x12\x1b\n" + + "\titem_type\x18\x02 \x01(\tR\bitemType\x12\x1a\n" + + "\bquantity\x18\x03 \x01(\x05R\bquantity\x12\x17\n" + + "\astar_id\x18\x04 \x01(\x03R\x06starId\x12\x17\n" + + "\auser_id\x18\x05 \x01(\x03R\x06userId\"\xff\x01\n" + + "\x14PurchaseItemResponse\x120\n" + + "\x04base\x18\x01 \x01(\v2\x1c.topfans.common.BaseResponseR\x04base\x12.\n" + + "\x13total_crystal_spent\x18\x02 \x01(\x03R\x11totalCrystalSpent\x12-\n" + + "\x12total_contribution\x18\x03 \x01(\x03R\x11totalContribution\x12)\n" + + "\x10current_progress\x18\x04 \x01(\x03R\x0fcurrentProgress\x12+\n" + + "\x11remaining_balance\x18\x05 \x01(\x03R\x10remainingBalance\"\xa0\x01\n" + + "\x1aContributionRankingRequest\x12\x1f\n" + + "\vactivity_id\x18\x01 \x01(\x03R\n" + + "activityId\x12\x17\n" + + "\astar_id\x18\x02 \x01(\x03R\x06starId\x12\x12\n" + + "\x04page\x18\x03 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12\x17\n" + + "\auser_id\x18\x05 \x01(\x03R\x06userId\"\xe0\x01\n" + + "\x17ContributionRankingItem\x12\x12\n" + + "\x04rank\x18\x01 \x01(\x05R\x04rank\x12\x17\n" + + "\auser_id\x18\x02 \x01(\x03R\x06userId\x12\x1a\n" + + "\bnickname\x18\x03 \x01(\tR\bnickname\x12\x1d\n" + + "\n" + + "avatar_url\x18\x04 \x01(\tR\tavatarUrl\x12-\n" + + "\x12total_contribution\x18\x05 \x01(\x03R\x11totalContribution\x12.\n" + + "\x13total_crystal_spent\x18\x06 \x01(\x03R\x11totalCrystalSpent\"\xa2\x02\n" + + "\x1bContributionRankingResponse\x120\n" + + "\x04base\x18\x01 \x01(\v2\x1c.topfans.common.BaseResponseR\x04base\x12?\n" + + "\x05items\x18\x02 \x03(\v2).topfans.activity.ContributionRankingItemR\x05items\x12I\n" + + "\x0fmy_contribution\x18\x03 \x01(\v2 .topfans.activity.MyContributionR\x0emyContribution\x12\x12\n" + + "\x04page\x18\x04 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x05 \x01(\x05R\bpageSize\x12\x14\n" + + "\x05total\x18\x06 \x01(\x05R\x05total\"\xd6\x01\n" + + "\x0eMyContribution\x12\x12\n" + + "\x04rank\x18\x01 \x01(\x05R\x04rank\x12-\n" + + "\x12total_contribution\x18\x02 \x01(\x03R\x11totalContribution\x12.\n" + + "\x13total_crystal_spent\x18\x03 \x01(\x03R\x11totalCrystalSpent\x12\x16\n" + + "\x06status\x18\x04 \x01(\tR\x06status\x12\x1a\n" + + "\bnickname\x18\x05 \x01(\tR\bnickname\x12\x1d\n" + + "\n" + + "avatar_url\x18\x06 \x01(\tR\tavatarUrl\"z\n" + + "\x16GetActivityListRequest\x12\x17\n" + + "\astar_id\x18\x01 \x01(\x03R\x06starId\x12\x16\n" + + "\x06status\x18\x02 \x01(\tR\x06status\x12\x12\n" + + "\x04page\x18\x03 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\"\xce\x01\n" + + "\x17GetActivityListResponse\x120\n" + + "\x04base\x18\x01 \x01(\v2\x1c.topfans.common.BaseResponseR\x04base\x12:\n" + + "\n" + + "activities\x18\x02 \x03(\v2\x1a.topfans.activity.ActivityR\n" + + "activities\x12\x12\n" + + "\x04page\x18\x03 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12\x14\n" + + "\x05total\x18\x05 \x01(\x05R\x05total\"5\n" + + "\x12GetProgressRequest\x12\x1f\n" + + "\vactivity_id\x18\x01 \x01(\x03R\n" + + "activityId\"\x94\x02\n" + + "\x13GetProgressResponse\x120\n" + + "\x04base\x18\x01 \x01(\v2\x1c.topfans.common.BaseResponseR\x04base\x12\x1f\n" + + "\vactivity_id\x18\x02 \x01(\x03R\n" + + "activityId\x12)\n" + + "\x10current_progress\x18\x03 \x01(\x03R\x0fcurrentProgress\x12'\n" + + "\x0ftarget_progress\x18\x04 \x01(\x03R\x0etargetProgress\x12#\n" + + "\rcurrent_stage\x18\x05 \x01(\tR\fcurrentStage\x12\x19\n" + + "\bend_time\x18\x06 \x01(\x03R\aendTime\x12\x16\n" + + "\x06status\x18\a \x01(\tR\x06status\"\x84\x02\n" + + "\x0fMintingActivity\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x14\n" + + "\x05title\x18\x02 \x01(\tR\x05title\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x1f\n" + + "\vcover_image\x18\x04 \x01(\tR\n" + + "coverImage\x12\x17\n" + + "\astar_id\x18\x05 \x01(\x03R\x06starId\x12\x14\n" + + "\x05route\x18\x06 \x01(\tR\x05route\x12\x1b\n" + + "\tis_active\x18\a \x01(\bR\bisActive\x12\x1d\n" + + "\n" + + "created_at\x18\b \x01(\x03R\tcreatedAt\x12\x1d\n" + + "\n" + + "updated_at\x18\t \x01(\x03R\tupdatedAt\"g\n" + + "\x1bGetMintingActivitiesRequest\x12\x17\n" + + "\astar_id\x18\x01 \x01(\x03R\x06starId\x12\x12\n" + + "\x04page\x18\x02 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x03 \x01(\x05R\bpageSize\"\xda\x01\n" + + "\x1cGetMintingActivitiesResponse\x120\n" + + "\x04base\x18\x01 \x01(\v2\x1c.topfans.common.BaseResponseR\x04base\x12A\n" + + "\n" + + "activities\x18\x02 \x03(\v2!.topfans.activity.MintingActivityR\n" + + "activities\x12\x12\n" + + "\x04page\x18\x03 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12\x14\n" + + "\x05total\x18\x05 \x01(\x05R\x05total2\x91\b\n" + + "\x0fActivityService\x12\x82\x01\n" + + "\x0fGetActivityList\x12(.topfans.activity.GetActivityListRequest\x1a).topfans.activity.GetActivityListResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/api/v1/activities\x12y\n" + + "\vGetActivity\x12$.topfans.activity.GetProgressRequest\x1a\x1a.topfans.activity.Activity\"(\x82\xd3\xe4\x93\x02\"\x12 /api/v1/activities/{activity_id}\x12\x91\x01\n" + + "\x10GetActivityItems\x12$.topfans.activity.GetProgressRequest\x1a'.topfans.activity.ActivityItemsResponse\".\x82\xd3\xe4\x93\x02(\x12&/api/v1/activities/{activity_id}/items\x12\x8d\x01\n" + + "\vGetProgress\x12$.topfans.activity.GetProgressRequest\x1a%.topfans.activity.GetProgressResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/activities/{activity_id}/progress\x12\x93\x01\n" + + "\fPurchaseItem\x12%.topfans.activity.PurchaseItemRequest\x1a&.topfans.activity.PurchaseItemResponse\"4\x82\xd3\xe4\x93\x02.:\x01*\")/api/v1/activities/{activity_id}/purchase\x12\xa7\x01\n" + + "\x16GetContributionRanking\x12,.topfans.activity.ContributionRankingRequest\x1a-.topfans.activity.ContributionRankingResponse\"0\x82\xd3\xe4\x93\x02*\x12(/api/v1/activities/{activity_id}/ranking\x12\x99\x01\n" + + "\x14GetMintingActivities\x12-.topfans.activity.GetMintingActivitiesRequest\x1a..topfans.activity.GetMintingActivitiesResponse\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/api/v1/minting-activitiesB8Z6github.com/topfans/backend/pkg/proto/activity;activityb\x06proto3" + +var ( + file_activity_proto_rawDescOnce sync.Once + file_activity_proto_rawDescData []byte +) + +func file_activity_proto_rawDescGZIP() []byte { + file_activity_proto_rawDescOnce.Do(func() { + file_activity_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_activity_proto_rawDesc), len(file_activity_proto_rawDesc))) + }) + return file_activity_proto_rawDescData +} + +var file_activity_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_activity_proto_goTypes = []any{ + (*Activity)(nil), // 0: topfans.activity.Activity + (*ActivityItem)(nil), // 1: topfans.activity.ActivityItem + (*ActivityItemsResponse)(nil), // 2: topfans.activity.ActivityItemsResponse + (*PurchaseItemRequest)(nil), // 3: topfans.activity.PurchaseItemRequest + (*PurchaseItemResponse)(nil), // 4: topfans.activity.PurchaseItemResponse + (*ContributionRankingRequest)(nil), // 5: topfans.activity.ContributionRankingRequest + (*ContributionRankingItem)(nil), // 6: topfans.activity.ContributionRankingItem + (*ContributionRankingResponse)(nil), // 7: topfans.activity.ContributionRankingResponse + (*MyContribution)(nil), // 8: topfans.activity.MyContribution + (*GetActivityListRequest)(nil), // 9: topfans.activity.GetActivityListRequest + (*GetActivityListResponse)(nil), // 10: topfans.activity.GetActivityListResponse + (*GetProgressRequest)(nil), // 11: topfans.activity.GetProgressRequest + (*GetProgressResponse)(nil), // 12: topfans.activity.GetProgressResponse + (*MintingActivity)(nil), // 13: topfans.activity.MintingActivity + (*GetMintingActivitiesRequest)(nil), // 14: topfans.activity.GetMintingActivitiesRequest + (*GetMintingActivitiesResponse)(nil), // 15: topfans.activity.GetMintingActivitiesResponse + (*common.BaseResponse)(nil), // 16: topfans.common.BaseResponse +} +var file_activity_proto_depIdxs = []int32{ + 1, // 0: topfans.activity.Activity.items:type_name -> topfans.activity.ActivityItem + 1, // 1: topfans.activity.ActivityItemsResponse.items:type_name -> topfans.activity.ActivityItem + 16, // 2: topfans.activity.PurchaseItemResponse.base:type_name -> topfans.common.BaseResponse + 16, // 3: topfans.activity.ContributionRankingResponse.base:type_name -> topfans.common.BaseResponse + 6, // 4: topfans.activity.ContributionRankingResponse.items:type_name -> topfans.activity.ContributionRankingItem + 8, // 5: topfans.activity.ContributionRankingResponse.my_contribution:type_name -> topfans.activity.MyContribution + 16, // 6: topfans.activity.GetActivityListResponse.base:type_name -> topfans.common.BaseResponse + 0, // 7: topfans.activity.GetActivityListResponse.activities:type_name -> topfans.activity.Activity + 16, // 8: topfans.activity.GetProgressResponse.base:type_name -> topfans.common.BaseResponse + 16, // 9: topfans.activity.GetMintingActivitiesResponse.base:type_name -> topfans.common.BaseResponse + 13, // 10: topfans.activity.GetMintingActivitiesResponse.activities:type_name -> topfans.activity.MintingActivity + 9, // 11: topfans.activity.ActivityService.GetActivityList:input_type -> topfans.activity.GetActivityListRequest + 11, // 12: topfans.activity.ActivityService.GetActivity:input_type -> topfans.activity.GetProgressRequest + 11, // 13: topfans.activity.ActivityService.GetActivityItems:input_type -> topfans.activity.GetProgressRequest + 11, // 14: topfans.activity.ActivityService.GetProgress:input_type -> topfans.activity.GetProgressRequest + 3, // 15: topfans.activity.ActivityService.PurchaseItem:input_type -> topfans.activity.PurchaseItemRequest + 5, // 16: topfans.activity.ActivityService.GetContributionRanking:input_type -> topfans.activity.ContributionRankingRequest + 14, // 17: topfans.activity.ActivityService.GetMintingActivities:input_type -> topfans.activity.GetMintingActivitiesRequest + 10, // 18: topfans.activity.ActivityService.GetActivityList:output_type -> topfans.activity.GetActivityListResponse + 0, // 19: topfans.activity.ActivityService.GetActivity:output_type -> topfans.activity.Activity + 2, // 20: topfans.activity.ActivityService.GetActivityItems:output_type -> topfans.activity.ActivityItemsResponse + 12, // 21: topfans.activity.ActivityService.GetProgress:output_type -> topfans.activity.GetProgressResponse + 4, // 22: topfans.activity.ActivityService.PurchaseItem:output_type -> topfans.activity.PurchaseItemResponse + 7, // 23: topfans.activity.ActivityService.GetContributionRanking:output_type -> topfans.activity.ContributionRankingResponse + 15, // 24: topfans.activity.ActivityService.GetMintingActivities:output_type -> topfans.activity.GetMintingActivitiesResponse + 18, // [18:25] is the sub-list for method output_type + 11, // [11:18] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_activity_proto_init() } +func file_activity_proto_init() { + if File_activity_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_activity_proto_rawDesc), len(file_activity_proto_rawDesc)), + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_activity_proto_goTypes, + DependencyIndexes: file_activity_proto_depIdxs, + MessageInfos: file_activity_proto_msgTypes, + }.Build() + File_activity_proto = out.File + file_activity_proto_goTypes = nil + file_activity_proto_depIdxs = nil +} diff --git a/backend/gateway/controller/activity_controller.go b/backend/gateway/controller/activity_controller.go index 7cefc38..7017661 100644 --- a/backend/gateway/controller/activity_controller.go +++ b/backend/gateway/controller/activity_controller.go @@ -451,6 +451,92 @@ func formatTimestamp(timestamp int64) string { return time.Unix(timestamp, 0).Format("2006-01-02 15:04:05") } +// GetMintingActivities 获取铸造活动列表(用于运营banner) +// @Summary 获取铸造活动列表 +// @Description 获取铸造活动列表,用于运营banner展示 +// @Tags minting-activities +// @Accept json +// @Produce json +// @Security BearerAuth +// @Param star_id query int64 false "粉丝身份ID,不传则返回所有" +// @Param page query int false "页码,默认1" +// @Param page_size query int false "每页数量,默认10" +// @Success 200 {object} response.Response +// @Router /api/v1/minting-activities [get] +func (ctrl *ActivityController) GetMintingActivities(c *gin.Context) { + // 解析查询参数 + starIDStr := c.Query("star_id") + var starID int64 + if starIDStr != "" { + var err error + starID, err = strconv.ParseInt(starIDStr, 10, 64) + if err != nil { + response.Error(c, http.StatusBadRequest, "star_id 参数错误") + return + } + } + + page, _ := strconv.Atoi(c.DefaultQuery("page", "1")) + pageSize, _ := strconv.Atoi(c.DefaultQuery("page_size", "10")) + + logger.Logger.Info("GetMintingActivities request", + zap.Int64("star_id", starID), + zap.Int("page", page), + zap.Int("page_size", pageSize), + ) + + // 设置上下文 + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + + // 调用 RPC + resp, err := ctrl.activityService.GetMintingActivities(ctx, &pbActivity.GetMintingActivitiesRequest{ + StarId: starID, + Page: int32(page), + PageSize: int32(pageSize), + }) + + if err != nil { + logger.Logger.Error("GetMintingActivities RPC failed", zap.Error(err)) + response.Error(c, http.StatusInternalServerError, "获取铸造活动列表失败") + return + } + + if resp.Base.Code != pbCommon.StatusCode_STATUS_OK { + response.ErrorWithCode(c, int(resp.Base.Code), resp.Base.Message) + return + } + + // 转换响应 + data := convertMintingActivitiesResponse(resp) + response.Success(c, data) +} + +// convertMintingActivitiesResponse 转换铸造活动列表响应 +func convertMintingActivitiesResponse(resp *pbActivity.GetMintingActivitiesResponse) map[string]interface{} { + activities := make([]map[string]interface{}, 0, len(resp.Activities)) + for _, activity := range resp.Activities { + activities = append(activities, map[string]interface{}{ + "id": activity.Id, + "title": activity.Title, + "description": activity.Description, + "cover_image": activity.CoverImage, + "star_id": activity.StarId, + "route": activity.Route, + "is_active": activity.IsActive, + "created_at": activity.CreatedAt, + "updated_at": activity.UpdatedAt, + }) + } + + return map[string]interface{}{ + "activities": activities, + "page": resp.Page, + "page_size": resp.PageSize, + "total": resp.Total, + } +} + // convertActivityListResponse 转换活动列表响应 func convertActivityListResponse(resp *pbActivity.GetActivityListResponse) map[string]interface{} { activities := make([]map[string]interface{}, 0, len(resp.Activities)) diff --git a/backend/gateway/router/router.go b/backend/gateway/router/router.go index 5c76e8a..ddfd74c 100644 --- a/backend/gateway/router/router.go +++ b/backend/gateway/router/router.go @@ -242,6 +242,12 @@ func SetupRouter(userClient *client.Client, socialClient *client.Client, assetCl activities.GET("/:id/ranking", activityCtrl.GetContributionRanking) // 获取贡献点排名 } + // 铸造活动相关路由(运营banner)- 公开接口,不需要认证 + mintingActivities := v1.Group("/minting-activities") + { + mintingActivities.GET("", activityCtrl.GetMintingActivities) // 获取铸造活动列表 + } + // 任务相关路由(需要认证) tasks := v1.Group("/tasks") tasks.Use(middleware.AuthMiddleware()) diff --git a/backend/github.com/topfans/backend/pkg/proto/gallery/gallery.triple.go b/backend/github.com/topfans/backend/pkg/proto/gallery/gallery.triple.go deleted file mode 100644 index 56ddfff..0000000 --- a/backend/github.com/topfans/backend/pkg/proto/gallery/gallery.triple.go +++ /dev/null @@ -1,338 +0,0 @@ -// Code generated by protoc-gen-triple. DO NOT EDIT. -// -// Source: proto/gallery.proto -package gallery - -import ( - "context" -) - -import ( - "dubbo.apache.org/dubbo-go/v3" - "dubbo.apache.org/dubbo-go/v3/client" - "dubbo.apache.org/dubbo-go/v3/common" - "dubbo.apache.org/dubbo-go/v3/common/constant" - "dubbo.apache.org/dubbo-go/v3/protocol/triple/triple_protocol" - "dubbo.apache.org/dubbo-go/v3/server" -) - -// This is a compile-time assertion to ensure that this generated file and the Triple package -// are compatible. If you get a compiler error that this constant is not defined, this code was -// generated with a version of Triple newer than the one compiled into your binary. You can fix the -// problem by either regenerating this code with an older version of Triple or updating the Triple -// version compiled into your binary. -const _ = triple_protocol.IsAtLeastVersion0_1_0 - -const ( - // GalleryServiceName is the fully-qualified name of the GalleryService service. - GalleryServiceName = "topfans.gallery.GalleryService" -) - -// These constants are the fully-qualified names of the RPCs defined in this package. They're -// exposed at runtime as procedure and as the final two segments of the HTTP route. -// -// Note that these are different from the fully-qualified method names used by -// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to -// reflection-formatted method names, remove the leading slash and convert the remaining slash to a -// period. -const ( - // GalleryServiceGetMyGalleryProcedure is the fully-qualified name of the GalleryService's GetMyGallery RPC. - GalleryServiceGetMyGalleryProcedure = "/topfans.gallery.GalleryService/GetMyGallery" - // GalleryServiceGetUserGalleryProcedure is the fully-qualified name of the GalleryService's GetUserGallery RPC. - GalleryServiceGetUserGalleryProcedure = "/topfans.gallery.GalleryService/GetUserGallery" - // GalleryServicePlaceAssetProcedure is the fully-qualified name of the GalleryService's PlaceAsset RPC. - GalleryServicePlaceAssetProcedure = "/topfans.gallery.GalleryService/PlaceAsset" - // GalleryServiceUnlockSlotProcedure is the fully-qualified name of the GalleryService's UnlockSlot RPC. - GalleryServiceUnlockSlotProcedure = "/topfans.gallery.GalleryService/UnlockSlot" - // GalleryServiceRemoveFromSlotProcedure is the fully-qualified name of the GalleryService's RemoveFromSlot RPC. - GalleryServiceRemoveFromSlotProcedure = "/topfans.gallery.GalleryService/RemoveFromSlot" - // GalleryServiceGetMyExhibitedAssetsProcedure is the fully-qualified name of the GalleryService's GetMyExhibitedAssets RPC. - GalleryServiceGetMyExhibitedAssetsProcedure = "/topfans.gallery.GalleryService/GetMyExhibitedAssets" - // GalleryServiceGetInspirationFlowProcedure is the fully-qualified name of the GalleryService's GetInspirationFlow RPC. - GalleryServiceGetInspirationFlowProcedure = "/topfans.gallery.GalleryService/GetInspirationFlow" - // GalleryServiceGetUserExhibitedAssetsProcedure is the fully-qualified name of the GalleryService's GetUserExhibitedAssets RPC. - GalleryServiceGetUserExhibitedAssetsProcedure = "/topfans.gallery.GalleryService/GetUserExhibitedAssets" - // GalleryServiceCleanupDisplayStatusProcedure is the fully-qualified name of the GalleryService's CleanupDisplayStatus RPC. - GalleryServiceCleanupDisplayStatusProcedure = "/topfans.gallery.GalleryService/CleanupDisplayStatus" -) - -var ( - _ GalleryService = (*GalleryServiceImpl)(nil) -) - -// GalleryService is a client for the topfans.gallery.GalleryService service. -type GalleryService interface { - GetMyGallery(ctx context.Context, req *GetMyGalleryRequest, opts ...client.CallOption) (*GetMyGalleryResponse, error) - GetUserGallery(ctx context.Context, req *GetUserGalleryRequest, opts ...client.CallOption) (*GetUserGalleryResponse, error) - PlaceAsset(ctx context.Context, req *PlaceAssetRequest, opts ...client.CallOption) (*PlaceAssetResponse, error) - UnlockSlot(ctx context.Context, req *UnlockSlotRequest, opts ...client.CallOption) (*UnlockSlotResponse, error) - RemoveFromSlot(ctx context.Context, req *RemoveFromSlotRequest, opts ...client.CallOption) (*RemoveFromSlotResponse, error) - GetMyExhibitedAssets(ctx context.Context, req *GetMyExhibitedAssetsRequest, opts ...client.CallOption) (*GetMyExhibitedAssetsResponse, error) - GetInspirationFlow(ctx context.Context, req *GetInspirationFlowRequest, opts ...client.CallOption) (*GetInspirationFlowResponse, error) - GetUserExhibitedAssets(ctx context.Context, req *GetUserExhibitedAssetsRequest, opts ...client.CallOption) (*GetUserExhibitedAssetsResponse, error) - CleanupDisplayStatus(ctx context.Context, req *CleanupDisplayStatusRequest, opts ...client.CallOption) (*CleanupDisplayStatusResponse, error) -} - -// NewGalleryService constructs a client for the gallery.GalleryService service. -func NewGalleryService(cli *client.Client, opts ...client.ReferenceOption) (GalleryService, error) { - conn, err := cli.DialWithInfo("topfans.gallery.GalleryService", &GalleryService_ClientInfo, opts...) - if err != nil { - return nil, err - } - return &GalleryServiceImpl{ - conn: conn, - }, nil -} - -func SetConsumerGalleryService(srv common.RPCService) { - dubbo.SetConsumerServiceWithInfo(srv, &GalleryService_ClientInfo) -} - -// GalleryServiceImpl implements GalleryService. -type GalleryServiceImpl struct { - conn *client.Connection -} - -func (c *GalleryServiceImpl) GetMyGallery(ctx context.Context, req *GetMyGalleryRequest, opts ...client.CallOption) (*GetMyGalleryResponse, error) { - resp := new(GetMyGalleryResponse) - if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetMyGallery", opts...); err != nil { - return nil, err - } - return resp, nil -} - -func (c *GalleryServiceImpl) GetUserGallery(ctx context.Context, req *GetUserGalleryRequest, opts ...client.CallOption) (*GetUserGalleryResponse, error) { - resp := new(GetUserGalleryResponse) - if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetUserGallery", opts...); err != nil { - return nil, err - } - return resp, nil -} - -func (c *GalleryServiceImpl) PlaceAsset(ctx context.Context, req *PlaceAssetRequest, opts ...client.CallOption) (*PlaceAssetResponse, error) { - resp := new(PlaceAssetResponse) - if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "PlaceAsset", opts...); err != nil { - return nil, err - } - return resp, nil -} - -func (c *GalleryServiceImpl) UnlockSlot(ctx context.Context, req *UnlockSlotRequest, opts ...client.CallOption) (*UnlockSlotResponse, error) { - resp := new(UnlockSlotResponse) - if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "UnlockSlot", opts...); err != nil { - return nil, err - } - return resp, nil -} - -func (c *GalleryServiceImpl) RemoveFromSlot(ctx context.Context, req *RemoveFromSlotRequest, opts ...client.CallOption) (*RemoveFromSlotResponse, error) { - resp := new(RemoveFromSlotResponse) - if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "RemoveFromSlot", opts...); err != nil { - return nil, err - } - return resp, nil -} - -func (c *GalleryServiceImpl) GetMyExhibitedAssets(ctx context.Context, req *GetMyExhibitedAssetsRequest, opts ...client.CallOption) (*GetMyExhibitedAssetsResponse, error) { - resp := new(GetMyExhibitedAssetsResponse) - if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetMyExhibitedAssets", opts...); err != nil { - return nil, err - } - return resp, nil -} - -func (c *GalleryServiceImpl) GetInspirationFlow(ctx context.Context, req *GetInspirationFlowRequest, opts ...client.CallOption) (*GetInspirationFlowResponse, error) { - resp := new(GetInspirationFlowResponse) - if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetInspirationFlow", opts...); err != nil { - return nil, err - } - return resp, nil -} - -func (c *GalleryServiceImpl) GetUserExhibitedAssets(ctx context.Context, req *GetUserExhibitedAssetsRequest, opts ...client.CallOption) (*GetUserExhibitedAssetsResponse, error) { - resp := new(GetUserExhibitedAssetsResponse) - if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetUserExhibitedAssets", opts...); err != nil { - return nil, err - } - return resp, nil -} - -func (c *GalleryServiceImpl) CleanupDisplayStatus(ctx context.Context, req *CleanupDisplayStatusRequest, opts ...client.CallOption) (*CleanupDisplayStatusResponse, error) { - resp := new(CleanupDisplayStatusResponse) - if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "CleanupDisplayStatus", opts...); err != nil { - return nil, err - } - return resp, nil -} - -var GalleryService_ClientInfo = client.ClientInfo{ - InterfaceName: "topfans.gallery.GalleryService", - MethodNames: []string{"GetMyGallery", "GetUserGallery", "PlaceAsset", "UnlockSlot", "RemoveFromSlot", "GetMyExhibitedAssets", "GetInspirationFlow", "GetUserExhibitedAssets", "CleanupDisplayStatus"}, - ConnectionInjectFunc: func(dubboCliRaw interface{}, conn *client.Connection) { - dubboCli := dubboCliRaw.(*GalleryServiceImpl) - dubboCli.conn = conn - }, -} - -// GalleryServiceHandler is an implementation of the topfans.gallery.GalleryService service. -type GalleryServiceHandler interface { - GetMyGallery(context.Context, *GetMyGalleryRequest) (*GetMyGalleryResponse, error) - GetUserGallery(context.Context, *GetUserGalleryRequest) (*GetUserGalleryResponse, error) - PlaceAsset(context.Context, *PlaceAssetRequest) (*PlaceAssetResponse, error) - UnlockSlot(context.Context, *UnlockSlotRequest) (*UnlockSlotResponse, error) - RemoveFromSlot(context.Context, *RemoveFromSlotRequest) (*RemoveFromSlotResponse, error) - GetMyExhibitedAssets(context.Context, *GetMyExhibitedAssetsRequest) (*GetMyExhibitedAssetsResponse, error) - GetInspirationFlow(context.Context, *GetInspirationFlowRequest) (*GetInspirationFlowResponse, error) - GetUserExhibitedAssets(context.Context, *GetUserExhibitedAssetsRequest) (*GetUserExhibitedAssetsResponse, error) - CleanupDisplayStatus(context.Context, *CleanupDisplayStatusRequest) (*CleanupDisplayStatusResponse, error) -} - -func RegisterGalleryServiceHandler(srv *server.Server, hdlr GalleryServiceHandler, opts ...server.ServiceOption) error { - return srv.Register(hdlr, &GalleryService_ServiceInfo, opts...) -} - -func SetProviderGalleryService(srv common.RPCService) { - dubbo.SetProviderServiceWithInfo(srv, &GalleryService_ServiceInfo) -} - -var GalleryService_ServiceInfo = server.ServiceInfo{ - InterfaceName: "topfans.gallery.GalleryService", - ServiceType: (*GalleryServiceHandler)(nil), - Methods: []server.MethodInfo{ - { - Name: "GetMyGallery", - Type: constant.CallUnary, - ReqInitFunc: func() interface{} { - return new(GetMyGalleryRequest) - }, - MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { - req := args[0].(*GetMyGalleryRequest) - res, err := handler.(GalleryServiceHandler).GetMyGallery(ctx, req) - if err != nil { - return nil, err - } - return triple_protocol.NewResponse(res), nil - }, - }, - { - Name: "GetUserGallery", - Type: constant.CallUnary, - ReqInitFunc: func() interface{} { - return new(GetUserGalleryRequest) - }, - MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { - req := args[0].(*GetUserGalleryRequest) - res, err := handler.(GalleryServiceHandler).GetUserGallery(ctx, req) - if err != nil { - return nil, err - } - return triple_protocol.NewResponse(res), nil - }, - }, - { - Name: "PlaceAsset", - Type: constant.CallUnary, - ReqInitFunc: func() interface{} { - return new(PlaceAssetRequest) - }, - MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { - req := args[0].(*PlaceAssetRequest) - res, err := handler.(GalleryServiceHandler).PlaceAsset(ctx, req) - if err != nil { - return nil, err - } - return triple_protocol.NewResponse(res), nil - }, - }, - { - Name: "UnlockSlot", - Type: constant.CallUnary, - ReqInitFunc: func() interface{} { - return new(UnlockSlotRequest) - }, - MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { - req := args[0].(*UnlockSlotRequest) - res, err := handler.(GalleryServiceHandler).UnlockSlot(ctx, req) - if err != nil { - return nil, err - } - return triple_protocol.NewResponse(res), nil - }, - }, - { - Name: "RemoveFromSlot", - Type: constant.CallUnary, - ReqInitFunc: func() interface{} { - return new(RemoveFromSlotRequest) - }, - MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { - req := args[0].(*RemoveFromSlotRequest) - res, err := handler.(GalleryServiceHandler).RemoveFromSlot(ctx, req) - if err != nil { - return nil, err - } - return triple_protocol.NewResponse(res), nil - }, - }, - { - Name: "GetMyExhibitedAssets", - Type: constant.CallUnary, - ReqInitFunc: func() interface{} { - return new(GetMyExhibitedAssetsRequest) - }, - MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { - req := args[0].(*GetMyExhibitedAssetsRequest) - res, err := handler.(GalleryServiceHandler).GetMyExhibitedAssets(ctx, req) - if err != nil { - return nil, err - } - return triple_protocol.NewResponse(res), nil - }, - }, - { - Name: "GetInspirationFlow", - Type: constant.CallUnary, - ReqInitFunc: func() interface{} { - return new(GetInspirationFlowRequest) - }, - MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { - req := args[0].(*GetInspirationFlowRequest) - res, err := handler.(GalleryServiceHandler).GetInspirationFlow(ctx, req) - if err != nil { - return nil, err - } - return triple_protocol.NewResponse(res), nil - }, - }, - { - Name: "GetUserExhibitedAssets", - Type: constant.CallUnary, - ReqInitFunc: func() interface{} { - return new(GetUserExhibitedAssetsRequest) - }, - MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { - req := args[0].(*GetUserExhibitedAssetsRequest) - res, err := handler.(GalleryServiceHandler).GetUserExhibitedAssets(ctx, req) - if err != nil { - return nil, err - } - return triple_protocol.NewResponse(res), nil - }, - }, - { - Name: "CleanupDisplayStatus", - Type: constant.CallUnary, - ReqInitFunc: func() interface{} { - return new(CleanupDisplayStatusRequest) - }, - MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { - req := args[0].(*CleanupDisplayStatusRequest) - res, err := handler.(GalleryServiceHandler).CleanupDisplayStatus(ctx, req) - if err != nil { - return nil, err - } - return triple_protocol.NewResponse(res), nil - }, - }, - }, -} diff --git a/backend/pkg/models/minting_activity.go b/backend/pkg/models/minting_activity.go new file mode 100644 index 0000000..106bc17 --- /dev/null +++ b/backend/pkg/models/minting_activity.go @@ -0,0 +1,19 @@ +package models + +// MintingActivity 铸造活动表(运营banner) +type MintingActivity struct { + ID int64 `json:"id" gorm:"primaryKey;autoIncrement"` + Title string `json:"title" gorm:"size:100;not null"` + Description string `json:"description" gorm:"type:text"` + CoverImage string `json:"cover_image" gorm:"size:500"` + StarID int64 `json:"star_id" gorm:"not null"` + Route string `json:"route" gorm:"size:200"` + IsActive bool `json:"is_active" gorm:"default:true"` + CreatedAt int64 `json:"created_at"` + UpdatedAt int64 `json:"updated_at"` +} + +// TableName 表名 +func (MintingActivity) TableName() string { + return "minting_activities" +} \ No newline at end of file diff --git a/backend/pkg/proto/activity/activity.pb.go b/backend/pkg/proto/activity/activity.pb.go index 9329517..4f7a0ed 100644 --- a/backend/pkg/proto/activity/activity.pb.go +++ b/backend/pkg/proto/activity/activity.pb.go @@ -1104,6 +1104,253 @@ func (x *GetProgressResponse) GetStatus() string { return "" } +// 铸造活动信息(用于运营banner) +type MintingActivity struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + CoverImage string `protobuf:"bytes,4,opt,name=cover_image,json=coverImage,proto3" json:"cover_image,omitempty"` + StarId int64 `protobuf:"varint,5,opt,name=star_id,json=starId,proto3" json:"star_id,omitempty"` + Route string `protobuf:"bytes,6,opt,name=route,proto3" json:"route,omitempty"` + IsActive bool `protobuf:"varint,7,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"` + CreatedAt int64 `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt int64 `protobuf:"varint,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MintingActivity) Reset() { + *x = MintingActivity{} + mi := &file_activity_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MintingActivity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MintingActivity) ProtoMessage() {} + +func (x *MintingActivity) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 MintingActivity.ProtoReflect.Descriptor instead. +func (*MintingActivity) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{13} +} + +func (x *MintingActivity) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *MintingActivity) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *MintingActivity) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *MintingActivity) GetCoverImage() string { + if x != nil { + return x.CoverImage + } + return "" +} + +func (x *MintingActivity) GetStarId() int64 { + if x != nil { + return x.StarId + } + return 0 +} + +func (x *MintingActivity) GetRoute() string { + if x != nil { + return x.Route + } + return "" +} + +func (x *MintingActivity) GetIsActive() bool { + if x != nil { + return x.IsActive + } + return false +} + +func (x *MintingActivity) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *MintingActivity) GetUpdatedAt() int64 { + if x != nil { + return x.UpdatedAt + } + return 0 +} + +// 获取铸造活动列表请求 +type GetMintingActivitiesRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + StarId int64 `protobuf:"varint,1,opt,name=star_id,json=starId,proto3" json:"star_id,omitempty"` // 可选,不传则返回所有 + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMintingActivitiesRequest) Reset() { + *x = GetMintingActivitiesRequest{} + mi := &file_activity_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMintingActivitiesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMintingActivitiesRequest) ProtoMessage() {} + +func (x *GetMintingActivitiesRequest) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 GetMintingActivitiesRequest.ProtoReflect.Descriptor instead. +func (*GetMintingActivitiesRequest) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{14} +} + +func (x *GetMintingActivitiesRequest) GetStarId() int64 { + if x != nil { + return x.StarId + } + return 0 +} + +func (x *GetMintingActivitiesRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetMintingActivitiesRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +// 获取铸造活动列表响应 +type GetMintingActivitiesResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Base *common.BaseResponse `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` + Activities []*MintingActivity `protobuf:"bytes,2,rep,name=activities,proto3" json:"activities,omitempty"` + Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Total int32 `protobuf:"varint,5,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GetMintingActivitiesResponse) Reset() { + *x = GetMintingActivitiesResponse{} + mi := &file_activity_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GetMintingActivitiesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetMintingActivitiesResponse) ProtoMessage() {} + +func (x *GetMintingActivitiesResponse) ProtoReflect() protoreflect.Message { + mi := &file_activity_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 GetMintingActivitiesResponse.ProtoReflect.Descriptor instead. +func (*GetMintingActivitiesResponse) Descriptor() ([]byte, []int) { + return file_activity_proto_rawDescGZIP(), []int{15} +} + +func (x *GetMintingActivitiesResponse) GetBase() *common.BaseResponse { + if x != nil { + return x.Base + } + return nil +} + +func (x *GetMintingActivitiesResponse) GetActivities() []*MintingActivity { + if x != nil { + return x.Activities + } + return nil +} + +func (x *GetMintingActivitiesResponse) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *GetMintingActivitiesResponse) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *GetMintingActivitiesResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + var File_activity_proto protoreflect.FileDescriptor const file_activity_proto_rawDesc = "" + @@ -1207,14 +1454,40 @@ const file_activity_proto_rawDesc = "" + "\x0ftarget_progress\x18\x04 \x01(\x03R\x0etargetProgress\x12#\n" + "\rcurrent_stage\x18\x05 \x01(\tR\fcurrentStage\x12\x19\n" + "\bend_time\x18\x06 \x01(\x03R\aendTime\x12\x16\n" + - "\x06status\x18\a \x01(\tR\x06status2\xf5\x06\n" + + "\x06status\x18\a \x01(\tR\x06status\"\x84\x02\n" + + "\x0fMintingActivity\x12\x0e\n" + + "\x02id\x18\x01 \x01(\x03R\x02id\x12\x14\n" + + "\x05title\x18\x02 \x01(\tR\x05title\x12 \n" + + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x1f\n" + + "\vcover_image\x18\x04 \x01(\tR\n" + + "coverImage\x12\x17\n" + + "\astar_id\x18\x05 \x01(\x03R\x06starId\x12\x14\n" + + "\x05route\x18\x06 \x01(\tR\x05route\x12\x1b\n" + + "\tis_active\x18\a \x01(\bR\bisActive\x12\x1d\n" + + "\n" + + "created_at\x18\b \x01(\x03R\tcreatedAt\x12\x1d\n" + + "\n" + + "updated_at\x18\t \x01(\x03R\tupdatedAt\"g\n" + + "\x1bGetMintingActivitiesRequest\x12\x17\n" + + "\astar_id\x18\x01 \x01(\x03R\x06starId\x12\x12\n" + + "\x04page\x18\x02 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x03 \x01(\x05R\bpageSize\"\xda\x01\n" + + "\x1cGetMintingActivitiesResponse\x120\n" + + "\x04base\x18\x01 \x01(\v2\x1c.topfans.common.BaseResponseR\x04base\x12A\n" + + "\n" + + "activities\x18\x02 \x03(\v2!.topfans.activity.MintingActivityR\n" + + "activities\x12\x12\n" + + "\x04page\x18\x03 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12\x14\n" + + "\x05total\x18\x05 \x01(\x05R\x05total2\x91\b\n" + "\x0fActivityService\x12\x82\x01\n" + "\x0fGetActivityList\x12(.topfans.activity.GetActivityListRequest\x1a).topfans.activity.GetActivityListResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/api/v1/activities\x12y\n" + "\vGetActivity\x12$.topfans.activity.GetProgressRequest\x1a\x1a.topfans.activity.Activity\"(\x82\xd3\xe4\x93\x02\"\x12 /api/v1/activities/{activity_id}\x12\x91\x01\n" + "\x10GetActivityItems\x12$.topfans.activity.GetProgressRequest\x1a'.topfans.activity.ActivityItemsResponse\".\x82\xd3\xe4\x93\x02(\x12&/api/v1/activities/{activity_id}/items\x12\x8d\x01\n" + "\vGetProgress\x12$.topfans.activity.GetProgressRequest\x1a%.topfans.activity.GetProgressResponse\"1\x82\xd3\xe4\x93\x02+\x12)/api/v1/activities/{activity_id}/progress\x12\x93\x01\n" + "\fPurchaseItem\x12%.topfans.activity.PurchaseItemRequest\x1a&.topfans.activity.PurchaseItemResponse\"4\x82\xd3\xe4\x93\x02.:\x01*\")/api/v1/activities/{activity_id}/purchase\x12\xa7\x01\n" + - "\x16GetContributionRanking\x12,.topfans.activity.ContributionRankingRequest\x1a-.topfans.activity.ContributionRankingResponse\"0\x82\xd3\xe4\x93\x02*\x12(/api/v1/activities/{activity_id}/rankingB8Z6github.com/topfans/backend/pkg/proto/activity;activityb\x06proto3" + "\x16GetContributionRanking\x12,.topfans.activity.ContributionRankingRequest\x1a-.topfans.activity.ContributionRankingResponse\"0\x82\xd3\xe4\x93\x02*\x12(/api/v1/activities/{activity_id}/ranking\x12\x99\x01\n" + + "\x14GetMintingActivities\x12-.topfans.activity.GetMintingActivitiesRequest\x1a..topfans.activity.GetMintingActivitiesResponse\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/api/v1/minting-activitiesB8Z6github.com/topfans/backend/pkg/proto/activity;activityb\x06proto3" var ( file_activity_proto_rawDescOnce sync.Once @@ -1228,50 +1501,57 @@ func file_activity_proto_rawDescGZIP() []byte { return file_activity_proto_rawDescData } -var file_activity_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_activity_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_activity_proto_goTypes = []any{ - (*Activity)(nil), // 0: topfans.activity.Activity - (*ActivityItem)(nil), // 1: topfans.activity.ActivityItem - (*ActivityItemsResponse)(nil), // 2: topfans.activity.ActivityItemsResponse - (*PurchaseItemRequest)(nil), // 3: topfans.activity.PurchaseItemRequest - (*PurchaseItemResponse)(nil), // 4: topfans.activity.PurchaseItemResponse - (*ContributionRankingRequest)(nil), // 5: topfans.activity.ContributionRankingRequest - (*ContributionRankingItem)(nil), // 6: topfans.activity.ContributionRankingItem - (*ContributionRankingResponse)(nil), // 7: topfans.activity.ContributionRankingResponse - (*MyContribution)(nil), // 8: topfans.activity.MyContribution - (*GetActivityListRequest)(nil), // 9: topfans.activity.GetActivityListRequest - (*GetActivityListResponse)(nil), // 10: topfans.activity.GetActivityListResponse - (*GetProgressRequest)(nil), // 11: topfans.activity.GetProgressRequest - (*GetProgressResponse)(nil), // 12: topfans.activity.GetProgressResponse - (*common.BaseResponse)(nil), // 13: topfans.common.BaseResponse + (*Activity)(nil), // 0: topfans.activity.Activity + (*ActivityItem)(nil), // 1: topfans.activity.ActivityItem + (*ActivityItemsResponse)(nil), // 2: topfans.activity.ActivityItemsResponse + (*PurchaseItemRequest)(nil), // 3: topfans.activity.PurchaseItemRequest + (*PurchaseItemResponse)(nil), // 4: topfans.activity.PurchaseItemResponse + (*ContributionRankingRequest)(nil), // 5: topfans.activity.ContributionRankingRequest + (*ContributionRankingItem)(nil), // 6: topfans.activity.ContributionRankingItem + (*ContributionRankingResponse)(nil), // 7: topfans.activity.ContributionRankingResponse + (*MyContribution)(nil), // 8: topfans.activity.MyContribution + (*GetActivityListRequest)(nil), // 9: topfans.activity.GetActivityListRequest + (*GetActivityListResponse)(nil), // 10: topfans.activity.GetActivityListResponse + (*GetProgressRequest)(nil), // 11: topfans.activity.GetProgressRequest + (*GetProgressResponse)(nil), // 12: topfans.activity.GetProgressResponse + (*MintingActivity)(nil), // 13: topfans.activity.MintingActivity + (*GetMintingActivitiesRequest)(nil), // 14: topfans.activity.GetMintingActivitiesRequest + (*GetMintingActivitiesResponse)(nil), // 15: topfans.activity.GetMintingActivitiesResponse + (*common.BaseResponse)(nil), // 16: topfans.common.BaseResponse } var file_activity_proto_depIdxs = []int32{ 1, // 0: topfans.activity.Activity.items:type_name -> topfans.activity.ActivityItem 1, // 1: topfans.activity.ActivityItemsResponse.items:type_name -> topfans.activity.ActivityItem - 13, // 2: topfans.activity.PurchaseItemResponse.base:type_name -> topfans.common.BaseResponse - 13, // 3: topfans.activity.ContributionRankingResponse.base:type_name -> topfans.common.BaseResponse + 16, // 2: topfans.activity.PurchaseItemResponse.base:type_name -> topfans.common.BaseResponse + 16, // 3: topfans.activity.ContributionRankingResponse.base:type_name -> topfans.common.BaseResponse 6, // 4: topfans.activity.ContributionRankingResponse.items:type_name -> topfans.activity.ContributionRankingItem 8, // 5: topfans.activity.ContributionRankingResponse.my_contribution:type_name -> topfans.activity.MyContribution - 13, // 6: topfans.activity.GetActivityListResponse.base:type_name -> topfans.common.BaseResponse + 16, // 6: topfans.activity.GetActivityListResponse.base:type_name -> topfans.common.BaseResponse 0, // 7: topfans.activity.GetActivityListResponse.activities:type_name -> topfans.activity.Activity - 13, // 8: topfans.activity.GetProgressResponse.base:type_name -> topfans.common.BaseResponse - 9, // 9: topfans.activity.ActivityService.GetActivityList:input_type -> topfans.activity.GetActivityListRequest - 11, // 10: topfans.activity.ActivityService.GetActivity:input_type -> topfans.activity.GetProgressRequest - 11, // 11: topfans.activity.ActivityService.GetActivityItems:input_type -> topfans.activity.GetProgressRequest - 11, // 12: topfans.activity.ActivityService.GetProgress:input_type -> topfans.activity.GetProgressRequest - 3, // 13: topfans.activity.ActivityService.PurchaseItem:input_type -> topfans.activity.PurchaseItemRequest - 5, // 14: topfans.activity.ActivityService.GetContributionRanking:input_type -> topfans.activity.ContributionRankingRequest - 10, // 15: topfans.activity.ActivityService.GetActivityList:output_type -> topfans.activity.GetActivityListResponse - 0, // 16: topfans.activity.ActivityService.GetActivity:output_type -> topfans.activity.Activity - 2, // 17: topfans.activity.ActivityService.GetActivityItems:output_type -> topfans.activity.ActivityItemsResponse - 12, // 18: topfans.activity.ActivityService.GetProgress:output_type -> topfans.activity.GetProgressResponse - 4, // 19: topfans.activity.ActivityService.PurchaseItem:output_type -> topfans.activity.PurchaseItemResponse - 7, // 20: topfans.activity.ActivityService.GetContributionRanking:output_type -> topfans.activity.ContributionRankingResponse - 15, // [15:21] is the sub-list for method output_type - 9, // [9:15] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 16, // 8: topfans.activity.GetProgressResponse.base:type_name -> topfans.common.BaseResponse + 16, // 9: topfans.activity.GetMintingActivitiesResponse.base:type_name -> topfans.common.BaseResponse + 13, // 10: topfans.activity.GetMintingActivitiesResponse.activities:type_name -> topfans.activity.MintingActivity + 9, // 11: topfans.activity.ActivityService.GetActivityList:input_type -> topfans.activity.GetActivityListRequest + 11, // 12: topfans.activity.ActivityService.GetActivity:input_type -> topfans.activity.GetProgressRequest + 11, // 13: topfans.activity.ActivityService.GetActivityItems:input_type -> topfans.activity.GetProgressRequest + 11, // 14: topfans.activity.ActivityService.GetProgress:input_type -> topfans.activity.GetProgressRequest + 3, // 15: topfans.activity.ActivityService.PurchaseItem:input_type -> topfans.activity.PurchaseItemRequest + 5, // 16: topfans.activity.ActivityService.GetContributionRanking:input_type -> topfans.activity.ContributionRankingRequest + 14, // 17: topfans.activity.ActivityService.GetMintingActivities:input_type -> topfans.activity.GetMintingActivitiesRequest + 10, // 18: topfans.activity.ActivityService.GetActivityList:output_type -> topfans.activity.GetActivityListResponse + 0, // 19: topfans.activity.ActivityService.GetActivity:output_type -> topfans.activity.Activity + 2, // 20: topfans.activity.ActivityService.GetActivityItems:output_type -> topfans.activity.ActivityItemsResponse + 12, // 21: topfans.activity.ActivityService.GetProgress:output_type -> topfans.activity.GetProgressResponse + 4, // 22: topfans.activity.ActivityService.PurchaseItem:output_type -> topfans.activity.PurchaseItemResponse + 7, // 23: topfans.activity.ActivityService.GetContributionRanking:output_type -> topfans.activity.ContributionRankingResponse + 15, // 24: topfans.activity.ActivityService.GetMintingActivities:output_type -> topfans.activity.GetMintingActivitiesResponse + 18, // [18:25] is the sub-list for method output_type + 11, // [11:18] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_activity_proto_init() } @@ -1285,7 +1565,7 @@ func file_activity_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_activity_proto_rawDesc), len(file_activity_proto_rawDesc)), NumEnums: 0, - NumMessages: 13, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, diff --git a/backend/pkg/proto/activity/activity.triple.go b/backend/pkg/proto/activity/activity.triple.go index 2494376..4093920 100644 --- a/backend/pkg/proto/activity/activity.triple.go +++ b/backend/pkg/proto/activity/activity.triple.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-triple. DO NOT EDIT. // -// Source: proto/activity.proto +// Source: activity.proto package activity import ( @@ -48,6 +48,8 @@ const ( ActivityServicePurchaseItemProcedure = "/topfans.activity.ActivityService/PurchaseItem" // ActivityServiceGetContributionRankingProcedure is the fully-qualified name of the ActivityService's GetContributionRanking RPC. ActivityServiceGetContributionRankingProcedure = "/topfans.activity.ActivityService/GetContributionRanking" + // ActivityServiceGetMintingActivitiesProcedure is the fully-qualified name of the ActivityService's GetMintingActivities RPC. + ActivityServiceGetMintingActivitiesProcedure = "/topfans.activity.ActivityService/GetMintingActivities" ) var ( @@ -62,6 +64,7 @@ type ActivityService interface { GetProgress(ctx context.Context, req *GetProgressRequest, opts ...client.CallOption) (*GetProgressResponse, error) PurchaseItem(ctx context.Context, req *PurchaseItemRequest, opts ...client.CallOption) (*PurchaseItemResponse, error) GetContributionRanking(ctx context.Context, req *ContributionRankingRequest, opts ...client.CallOption) (*ContributionRankingResponse, error) + GetMintingActivities(ctx context.Context, req *GetMintingActivitiesRequest, opts ...client.CallOption) (*GetMintingActivitiesResponse, error) } // NewActivityService constructs a client for the activity.ActivityService service. @@ -132,9 +135,17 @@ func (c *ActivityServiceImpl) GetContributionRanking(ctx context.Context, req *C return resp, nil } +func (c *ActivityServiceImpl) GetMintingActivities(ctx context.Context, req *GetMintingActivitiesRequest, opts ...client.CallOption) (*GetMintingActivitiesResponse, error) { + resp := new(GetMintingActivitiesResponse) + if err := c.conn.CallUnary(ctx, []interface{}{req}, resp, "GetMintingActivities", opts...); err != nil { + return nil, err + } + return resp, nil +} + var ActivityService_ClientInfo = client.ClientInfo{ InterfaceName: "topfans.activity.ActivityService", - MethodNames: []string{"GetActivityList", "GetActivity", "GetActivityItems", "GetProgress", "PurchaseItem", "GetContributionRanking"}, + MethodNames: []string{"GetActivityList", "GetActivity", "GetActivityItems", "GetProgress", "PurchaseItem", "GetContributionRanking", "GetMintingActivities"}, ConnectionInjectFunc: func(dubboCliRaw interface{}, conn *client.Connection) { dubboCli := dubboCliRaw.(*ActivityServiceImpl) dubboCli.conn = conn @@ -149,6 +160,7 @@ type ActivityServiceHandler interface { GetProgress(context.Context, *GetProgressRequest) (*GetProgressResponse, error) PurchaseItem(context.Context, *PurchaseItemRequest) (*PurchaseItemResponse, error) GetContributionRanking(context.Context, *ContributionRankingRequest) (*ContributionRankingResponse, error) + GetMintingActivities(context.Context, *GetMintingActivitiesRequest) (*GetMintingActivitiesResponse, error) } func RegisterActivityServiceHandler(srv *server.Server, hdlr ActivityServiceHandler, opts ...server.ServiceOption) error { @@ -253,5 +265,20 @@ var ActivityService_ServiceInfo = server.ServiceInfo{ return triple_protocol.NewResponse(res), nil }, }, + { + Name: "GetMintingActivities", + Type: constant.CallUnary, + ReqInitFunc: func() interface{} { + return new(GetMintingActivitiesRequest) + }, + MethodFunc: func(ctx context.Context, args []interface{}, handler interface{}) (interface{}, error) { + req := args[0].(*GetMintingActivitiesRequest) + res, err := handler.(ActivityServiceHandler).GetMintingActivities(ctx, req) + if err != nil { + return nil, err + } + return triple_protocol.NewResponse(res), nil + }, + }, }, } diff --git a/backend/pkg/proto/gallery/gallery.pb.go b/backend/pkg/proto/gallery/gallery.pb.go index db5c4cd..2a2370a 100644 --- a/backend/pkg/proto/gallery/gallery.pb.go +++ b/backend/pkg/proto/gallery/gallery.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.36.11 // protoc v7.34.0 -// source: proto/gallery.proto +// source: gallery.proto package gallery @@ -32,7 +32,7 @@ type GetMyGalleryRequest struct { func (x *GetMyGalleryRequest) Reset() { *x = GetMyGalleryRequest{} - mi := &file_proto_gallery_proto_msgTypes[0] + mi := &file_gallery_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -44,7 +44,7 @@ func (x *GetMyGalleryRequest) String() string { func (*GetMyGalleryRequest) ProtoMessage() {} func (x *GetMyGalleryRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[0] + mi := &file_gallery_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -57,7 +57,7 @@ func (x *GetMyGalleryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMyGalleryRequest.ProtoReflect.Descriptor instead. func (*GetMyGalleryRequest) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{0} + return file_gallery_proto_rawDescGZIP(), []int{0} } type GetMyGalleryResponse struct { @@ -70,7 +70,7 @@ type GetMyGalleryResponse struct { func (x *GetMyGalleryResponse) Reset() { *x = GetMyGalleryResponse{} - mi := &file_proto_gallery_proto_msgTypes[1] + mi := &file_gallery_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -82,7 +82,7 @@ func (x *GetMyGalleryResponse) String() string { func (*GetMyGalleryResponse) ProtoMessage() {} func (x *GetMyGalleryResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[1] + mi := &file_gallery_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -95,7 +95,7 @@ func (x *GetMyGalleryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMyGalleryResponse.ProtoReflect.Descriptor instead. func (*GetMyGalleryResponse) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{1} + return file_gallery_proto_rawDescGZIP(), []int{1} } func (x *GetMyGalleryResponse) GetBase() *common.BaseResponse { @@ -121,7 +121,7 @@ type GetUserGalleryRequest struct { func (x *GetUserGalleryRequest) Reset() { *x = GetUserGalleryRequest{} - mi := &file_proto_gallery_proto_msgTypes[2] + mi := &file_gallery_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -133,7 +133,7 @@ func (x *GetUserGalleryRequest) String() string { func (*GetUserGalleryRequest) ProtoMessage() {} func (x *GetUserGalleryRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[2] + mi := &file_gallery_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -146,7 +146,7 @@ func (x *GetUserGalleryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserGalleryRequest.ProtoReflect.Descriptor instead. func (*GetUserGalleryRequest) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{2} + return file_gallery_proto_rawDescGZIP(), []int{2} } func (x *GetUserGalleryRequest) GetTargetUid() int64 { @@ -166,7 +166,7 @@ type GetUserGalleryResponse struct { func (x *GetUserGalleryResponse) Reset() { *x = GetUserGalleryResponse{} - mi := &file_proto_gallery_proto_msgTypes[3] + mi := &file_gallery_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -178,7 +178,7 @@ func (x *GetUserGalleryResponse) String() string { func (*GetUserGalleryResponse) ProtoMessage() {} func (x *GetUserGalleryResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[3] + mi := &file_gallery_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -191,7 +191,7 @@ func (x *GetUserGalleryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserGalleryResponse.ProtoReflect.Descriptor instead. func (*GetUserGalleryResponse) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{3} + return file_gallery_proto_rawDescGZIP(), []int{3} } func (x *GetUserGalleryResponse) GetBase() *common.BaseResponse { @@ -219,7 +219,7 @@ type PlaceAssetRequest struct { func (x *PlaceAssetRequest) Reset() { *x = PlaceAssetRequest{} - mi := &file_proto_gallery_proto_msgTypes[4] + mi := &file_gallery_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -231,7 +231,7 @@ func (x *PlaceAssetRequest) String() string { func (*PlaceAssetRequest) ProtoMessage() {} func (x *PlaceAssetRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[4] + mi := &file_gallery_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -244,7 +244,7 @@ func (x *PlaceAssetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PlaceAssetRequest.ProtoReflect.Descriptor instead. func (*PlaceAssetRequest) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{4} + return file_gallery_proto_rawDescGZIP(), []int{4} } func (x *PlaceAssetRequest) GetAssetId() int64 { @@ -278,7 +278,7 @@ type PlaceAssetResponse struct { func (x *PlaceAssetResponse) Reset() { *x = PlaceAssetResponse{} - mi := &file_proto_gallery_proto_msgTypes[5] + mi := &file_gallery_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -290,7 +290,7 @@ func (x *PlaceAssetResponse) String() string { func (*PlaceAssetResponse) ProtoMessage() {} func (x *PlaceAssetResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[5] + mi := &file_gallery_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -303,7 +303,7 @@ func (x *PlaceAssetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PlaceAssetResponse.ProtoReflect.Descriptor instead. func (*PlaceAssetResponse) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{5} + return file_gallery_proto_rawDescGZIP(), []int{5} } func (x *PlaceAssetResponse) GetBase() *common.BaseResponse { @@ -328,7 +328,7 @@ type UnlockSlotRequest struct { func (x *UnlockSlotRequest) Reset() { *x = UnlockSlotRequest{} - mi := &file_proto_gallery_proto_msgTypes[6] + mi := &file_gallery_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -340,7 +340,7 @@ func (x *UnlockSlotRequest) String() string { func (*UnlockSlotRequest) ProtoMessage() {} func (x *UnlockSlotRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[6] + mi := &file_gallery_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -353,7 +353,7 @@ func (x *UnlockSlotRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UnlockSlotRequest.ProtoReflect.Descriptor instead. func (*UnlockSlotRequest) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{6} + return file_gallery_proto_rawDescGZIP(), []int{6} } type UnlockSlotResponse struct { @@ -366,7 +366,7 @@ type UnlockSlotResponse struct { func (x *UnlockSlotResponse) Reset() { *x = UnlockSlotResponse{} - mi := &file_proto_gallery_proto_msgTypes[7] + mi := &file_gallery_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -378,7 +378,7 @@ func (x *UnlockSlotResponse) String() string { func (*UnlockSlotResponse) ProtoMessage() {} func (x *UnlockSlotResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[7] + mi := &file_gallery_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -391,7 +391,7 @@ func (x *UnlockSlotResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UnlockSlotResponse.ProtoReflect.Descriptor instead. func (*UnlockSlotResponse) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{7} + return file_gallery_proto_rawDescGZIP(), []int{7} } func (x *UnlockSlotResponse) GetBase() *common.BaseResponse { @@ -421,7 +421,7 @@ type GalleryData struct { func (x *GalleryData) Reset() { *x = GalleryData{} - mi := &file_proto_gallery_proto_msgTypes[8] + mi := &file_gallery_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -433,7 +433,7 @@ func (x *GalleryData) String() string { func (*GalleryData) ProtoMessage() {} func (x *GalleryData) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[8] + mi := &file_gallery_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -446,7 +446,7 @@ func (x *GalleryData) ProtoReflect() protoreflect.Message { // Deprecated: Use GalleryData.ProtoReflect.Descriptor instead. func (*GalleryData) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{8} + return file_gallery_proto_rawDescGZIP(), []int{8} } func (x *GalleryData) GetGalleryOwnerId() int64 { @@ -497,7 +497,7 @@ type SlotInfo struct { func (x *SlotInfo) Reset() { *x = SlotInfo{} - mi := &file_proto_gallery_proto_msgTypes[9] + mi := &file_gallery_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -509,7 +509,7 @@ func (x *SlotInfo) String() string { func (*SlotInfo) ProtoMessage() {} func (x *SlotInfo) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[9] + mi := &file_gallery_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -522,7 +522,7 @@ func (x *SlotInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use SlotInfo.ProtoReflect.Descriptor instead. func (*SlotInfo) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{9} + return file_gallery_proto_rawDescGZIP(), []int{9} } func (x *SlotInfo) GetSlotId() int64 { @@ -622,7 +622,7 @@ type AssetInfo struct { func (x *AssetInfo) Reset() { *x = AssetInfo{} - mi := &file_proto_gallery_proto_msgTypes[10] + mi := &file_gallery_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -634,7 +634,7 @@ func (x *AssetInfo) String() string { func (*AssetInfo) ProtoMessage() {} func (x *AssetInfo) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[10] + mi := &file_gallery_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -647,7 +647,7 @@ func (x *AssetInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use AssetInfo.ProtoReflect.Descriptor instead. func (*AssetInfo) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{10} + return file_gallery_proto_rawDescGZIP(), []int{10} } func (x *AssetInfo) GetAssetId() int64 { @@ -695,7 +695,7 @@ type UnlockCondition struct { func (x *UnlockCondition) Reset() { *x = UnlockCondition{} - mi := &file_proto_gallery_proto_msgTypes[11] + mi := &file_gallery_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -707,7 +707,7 @@ func (x *UnlockCondition) String() string { func (*UnlockCondition) ProtoMessage() {} func (x *UnlockCondition) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[11] + mi := &file_gallery_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -720,7 +720,7 @@ func (x *UnlockCondition) ProtoReflect() protoreflect.Message { // Deprecated: Use UnlockCondition.ProtoReflect.Descriptor instead. func (*UnlockCondition) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{11} + return file_gallery_proto_rawDescGZIP(), []int{11} } func (x *UnlockCondition) GetType() string { @@ -748,7 +748,7 @@ type PlaceAssetData struct { func (x *PlaceAssetData) Reset() { *x = PlaceAssetData{} - mi := &file_proto_gallery_proto_msgTypes[12] + mi := &file_gallery_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -760,7 +760,7 @@ func (x *PlaceAssetData) String() string { func (*PlaceAssetData) ProtoMessage() {} func (x *PlaceAssetData) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[12] + mi := &file_gallery_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -773,7 +773,7 @@ func (x *PlaceAssetData) ProtoReflect() protoreflect.Message { // Deprecated: Use PlaceAssetData.ProtoReflect.Descriptor instead. func (*PlaceAssetData) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{12} + return file_gallery_proto_rawDescGZIP(), []int{12} } func (x *PlaceAssetData) GetStatus() string { @@ -807,7 +807,7 @@ type UnlockSlotData struct { func (x *UnlockSlotData) Reset() { *x = UnlockSlotData{} - mi := &file_proto_gallery_proto_msgTypes[13] + mi := &file_gallery_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -819,7 +819,7 @@ func (x *UnlockSlotData) String() string { func (*UnlockSlotData) ProtoMessage() {} func (x *UnlockSlotData) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[13] + mi := &file_gallery_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -832,7 +832,7 @@ func (x *UnlockSlotData) ProtoReflect() protoreflect.Message { // Deprecated: Use UnlockSlotData.ProtoReflect.Descriptor instead. func (*UnlockSlotData) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{13} + return file_gallery_proto_rawDescGZIP(), []int{13} } func (x *UnlockSlotData) GetSlotTotal() int32 { @@ -859,7 +859,7 @@ type RemoveFromSlotRequest struct { func (x *RemoveFromSlotRequest) Reset() { *x = RemoveFromSlotRequest{} - mi := &file_proto_gallery_proto_msgTypes[14] + mi := &file_gallery_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -871,7 +871,7 @@ func (x *RemoveFromSlotRequest) String() string { func (*RemoveFromSlotRequest) ProtoMessage() {} func (x *RemoveFromSlotRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[14] + mi := &file_gallery_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -884,7 +884,7 @@ func (x *RemoveFromSlotRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveFromSlotRequest.ProtoReflect.Descriptor instead. func (*RemoveFromSlotRequest) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{14} + return file_gallery_proto_rawDescGZIP(), []int{14} } func (x *RemoveFromSlotRequest) GetSlotId() int64 { @@ -904,7 +904,7 @@ type RemoveFromSlotResponse struct { func (x *RemoveFromSlotResponse) Reset() { *x = RemoveFromSlotResponse{} - mi := &file_proto_gallery_proto_msgTypes[15] + mi := &file_gallery_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -916,7 +916,7 @@ func (x *RemoveFromSlotResponse) String() string { func (*RemoveFromSlotResponse) ProtoMessage() {} func (x *RemoveFromSlotResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[15] + mi := &file_gallery_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -929,7 +929,7 @@ func (x *RemoveFromSlotResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveFromSlotResponse.ProtoReflect.Descriptor instead. func (*RemoveFromSlotResponse) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{15} + return file_gallery_proto_rawDescGZIP(), []int{15} } func (x *RemoveFromSlotResponse) GetBase() *common.BaseResponse { @@ -950,7 +950,7 @@ type GetMyExhibitedAssetsRequest struct { func (x *GetMyExhibitedAssetsRequest) Reset() { *x = GetMyExhibitedAssetsRequest{} - mi := &file_proto_gallery_proto_msgTypes[16] + mi := &file_gallery_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -962,7 +962,7 @@ func (x *GetMyExhibitedAssetsRequest) String() string { func (*GetMyExhibitedAssetsRequest) ProtoMessage() {} func (x *GetMyExhibitedAssetsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[16] + mi := &file_gallery_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -975,7 +975,7 @@ func (x *GetMyExhibitedAssetsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMyExhibitedAssetsRequest.ProtoReflect.Descriptor instead. func (*GetMyExhibitedAssetsRequest) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{16} + return file_gallery_proto_rawDescGZIP(), []int{16} } func (x *GetMyExhibitedAssetsRequest) GetPage() int32 { @@ -1003,7 +1003,7 @@ type GetMyExhibitedAssetsResponse struct { func (x *GetMyExhibitedAssetsResponse) Reset() { *x = GetMyExhibitedAssetsResponse{} - mi := &file_proto_gallery_proto_msgTypes[17] + mi := &file_gallery_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1015,7 +1015,7 @@ func (x *GetMyExhibitedAssetsResponse) String() string { func (*GetMyExhibitedAssetsResponse) ProtoMessage() {} func (x *GetMyExhibitedAssetsResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[17] + mi := &file_gallery_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1028,7 +1028,7 @@ func (x *GetMyExhibitedAssetsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMyExhibitedAssetsResponse.ProtoReflect.Descriptor instead. func (*GetMyExhibitedAssetsResponse) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{17} + return file_gallery_proto_rawDescGZIP(), []int{17} } func (x *GetMyExhibitedAssetsResponse) GetBase() *common.BaseResponse { @@ -1059,7 +1059,7 @@ type ExhibitedAssetsData struct { func (x *ExhibitedAssetsData) Reset() { *x = ExhibitedAssetsData{} - mi := &file_proto_gallery_proto_msgTypes[18] + mi := &file_gallery_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1071,7 +1071,7 @@ func (x *ExhibitedAssetsData) String() string { func (*ExhibitedAssetsData) ProtoMessage() {} func (x *ExhibitedAssetsData) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[18] + mi := &file_gallery_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1084,7 +1084,7 @@ func (x *ExhibitedAssetsData) ProtoReflect() protoreflect.Message { // Deprecated: Use ExhibitedAssetsData.ProtoReflect.Descriptor instead. func (*ExhibitedAssetsData) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{18} + return file_gallery_proto_rawDescGZIP(), []int{18} } func (x *ExhibitedAssetsData) GetItems() []*ExhibitedAssetItem { @@ -1138,7 +1138,7 @@ type ExhibitedAssetItem struct { func (x *ExhibitedAssetItem) Reset() { *x = ExhibitedAssetItem{} - mi := &file_proto_gallery_proto_msgTypes[19] + mi := &file_gallery_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1150,7 +1150,7 @@ func (x *ExhibitedAssetItem) String() string { func (*ExhibitedAssetItem) ProtoMessage() {} func (x *ExhibitedAssetItem) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[19] + mi := &file_gallery_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1163,7 +1163,7 @@ func (x *ExhibitedAssetItem) ProtoReflect() protoreflect.Message { // Deprecated: Use ExhibitedAssetItem.ProtoReflect.Descriptor instead. func (*ExhibitedAssetItem) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{19} + return file_gallery_proto_rawDescGZIP(), []int{19} } func (x *ExhibitedAssetItem) GetAssetId() int64 { @@ -1229,7 +1229,7 @@ type GetInspirationFlowRequest struct { func (x *GetInspirationFlowRequest) Reset() { *x = GetInspirationFlowRequest{} - mi := &file_proto_gallery_proto_msgTypes[20] + mi := &file_gallery_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1241,7 +1241,7 @@ func (x *GetInspirationFlowRequest) String() string { func (*GetInspirationFlowRequest) ProtoMessage() {} func (x *GetInspirationFlowRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[20] + mi := &file_gallery_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1254,7 +1254,7 @@ func (x *GetInspirationFlowRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetInspirationFlowRequest.ProtoReflect.Descriptor instead. func (*GetInspirationFlowRequest) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{20} + return file_gallery_proto_rawDescGZIP(), []int{20} } func (x *GetInspirationFlowRequest) GetCursor() string { @@ -1303,7 +1303,7 @@ type GetInspirationFlowResponse struct { func (x *GetInspirationFlowResponse) Reset() { *x = GetInspirationFlowResponse{} - mi := &file_proto_gallery_proto_msgTypes[21] + mi := &file_gallery_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1315,7 +1315,7 @@ func (x *GetInspirationFlowResponse) String() string { func (*GetInspirationFlowResponse) ProtoMessage() {} func (x *GetInspirationFlowResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[21] + mi := &file_gallery_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1328,7 +1328,7 @@ func (x *GetInspirationFlowResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetInspirationFlowResponse.ProtoReflect.Descriptor instead. func (*GetInspirationFlowResponse) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{21} + return file_gallery_proto_rawDescGZIP(), []int{21} } func (x *GetInspirationFlowResponse) GetBase() *common.BaseResponse { @@ -1358,7 +1358,7 @@ type InspirationFlowData struct { func (x *InspirationFlowData) Reset() { *x = InspirationFlowData{} - mi := &file_proto_gallery_proto_msgTypes[22] + mi := &file_gallery_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1370,7 +1370,7 @@ func (x *InspirationFlowData) String() string { func (*InspirationFlowData) ProtoMessage() {} func (x *InspirationFlowData) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[22] + mi := &file_gallery_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1383,7 +1383,7 @@ func (x *InspirationFlowData) ProtoReflect() protoreflect.Message { // Deprecated: Use InspirationFlowData.ProtoReflect.Descriptor instead. func (*InspirationFlowData) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{22} + return file_gallery_proto_rawDescGZIP(), []int{22} } func (x *InspirationFlowData) GetItems() []*InspirationFlowItem { @@ -1430,7 +1430,7 @@ type InspirationFlowItem struct { func (x *InspirationFlowItem) Reset() { *x = InspirationFlowItem{} - mi := &file_proto_gallery_proto_msgTypes[23] + mi := &file_gallery_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1442,7 +1442,7 @@ func (x *InspirationFlowItem) String() string { func (*InspirationFlowItem) ProtoMessage() {} func (x *InspirationFlowItem) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[23] + mi := &file_gallery_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1455,7 +1455,7 @@ func (x *InspirationFlowItem) ProtoReflect() protoreflect.Message { // Deprecated: Use InspirationFlowItem.ProtoReflect.Descriptor instead. func (*InspirationFlowItem) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{23} + return file_gallery_proto_rawDescGZIP(), []int{23} } func (x *InspirationFlowItem) GetAssetId() int64 { @@ -1519,7 +1519,7 @@ type GetUserExhibitedAssetsRequest struct { func (x *GetUserExhibitedAssetsRequest) Reset() { *x = GetUserExhibitedAssetsRequest{} - mi := &file_proto_gallery_proto_msgTypes[24] + mi := &file_gallery_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1531,7 +1531,7 @@ func (x *GetUserExhibitedAssetsRequest) String() string { func (*GetUserExhibitedAssetsRequest) ProtoMessage() {} func (x *GetUserExhibitedAssetsRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[24] + mi := &file_gallery_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1544,7 +1544,7 @@ func (x *GetUserExhibitedAssetsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserExhibitedAssetsRequest.ProtoReflect.Descriptor instead. func (*GetUserExhibitedAssetsRequest) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{24} + return file_gallery_proto_rawDescGZIP(), []int{24} } func (x *GetUserExhibitedAssetsRequest) GetUserId() int64 { @@ -1579,7 +1579,7 @@ type GetUserExhibitedAssetsResponse struct { func (x *GetUserExhibitedAssetsResponse) Reset() { *x = GetUserExhibitedAssetsResponse{} - mi := &file_proto_gallery_proto_msgTypes[25] + mi := &file_gallery_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1591,7 +1591,7 @@ func (x *GetUserExhibitedAssetsResponse) String() string { func (*GetUserExhibitedAssetsResponse) ProtoMessage() {} func (x *GetUserExhibitedAssetsResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[25] + mi := &file_gallery_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1604,7 +1604,7 @@ func (x *GetUserExhibitedAssetsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserExhibitedAssetsResponse.ProtoReflect.Descriptor instead. func (*GetUserExhibitedAssetsResponse) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{25} + return file_gallery_proto_rawDescGZIP(), []int{25} } func (x *GetUserExhibitedAssetsResponse) GetBase() *common.BaseResponse { @@ -1621,101 +1621,11 @@ func (x *GetUserExhibitedAssetsResponse) GetData() *ExhibitedAssetsData { return nil } -// 清理无效展示状态请求 -type CleanupDisplayStatusRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} +var File_gallery_proto protoreflect.FileDescriptor -func (x *CleanupDisplayStatusRequest) Reset() { - *x = CleanupDisplayStatusRequest{} - mi := &file_proto_gallery_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CleanupDisplayStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CleanupDisplayStatusRequest) ProtoMessage() {} - -func (x *CleanupDisplayStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[26] - 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 CleanupDisplayStatusRequest.ProtoReflect.Descriptor instead. -func (*CleanupDisplayStatusRequest) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{26} -} - -// 清理无效展示状态响应 -type CleanupDisplayStatusResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Base *common.BaseResponse `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` - CleanedCount int32 `protobuf:"varint,2,opt,name=cleaned_count,json=cleanedCount,proto3" json:"cleaned_count,omitempty"` // 清理的资产数量 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CleanupDisplayStatusResponse) Reset() { - *x = CleanupDisplayStatusResponse{} - mi := &file_proto_gallery_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CleanupDisplayStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CleanupDisplayStatusResponse) ProtoMessage() {} - -func (x *CleanupDisplayStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_proto_gallery_proto_msgTypes[27] - 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 CleanupDisplayStatusResponse.ProtoReflect.Descriptor instead. -func (*CleanupDisplayStatusResponse) Descriptor() ([]byte, []int) { - return file_proto_gallery_proto_rawDescGZIP(), []int{27} -} - -func (x *CleanupDisplayStatusResponse) GetBase() *common.BaseResponse { - if x != nil { - return x.Base - } - return nil -} - -func (x *CleanupDisplayStatusResponse) GetCleanedCount() int32 { - if x != nil { - return x.CleanedCount - } - return 0 -} - -var File_proto_gallery_proto protoreflect.FileDescriptor - -const file_proto_gallery_proto_rawDesc = "" + +const file_gallery_proto_rawDesc = "" + "\n" + - "\x13proto/gallery.proto\x12\x0ftopfans.gallery\x1a\x12proto/common.proto\x1a\x1cgoogle/api/annotations.proto\"\x15\n" + + "\rgallery.proto\x12\x0ftopfans.gallery\x1a\x12proto/common.proto\x1a\x1cgoogle/api/annotations.proto\"\x15\n" + "\x13GetMyGalleryRequest\"z\n" + "\x14GetMyGalleryResponse\x120\n" + "\x04base\x18\x01 \x01(\v2\x1c.topfans.common.BaseResponseR\x04base\x120\n" + @@ -1838,12 +1748,7 @@ const file_proto_gallery_proto_rawDesc = "" + "\tpage_size\x18\x03 \x01(\x05R\bpageSize\"\x8c\x01\n" + "\x1eGetUserExhibitedAssetsResponse\x120\n" + "\x04base\x18\x01 \x01(\v2\x1c.topfans.common.BaseResponseR\x04base\x128\n" + - "\x04data\x18\x02 \x01(\v2$.topfans.gallery.ExhibitedAssetsDataR\x04data\"\x1d\n" + - "\x1bCleanupDisplayStatusRequest\"u\n" + - "\x1cCleanupDisplayStatusResponse\x120\n" + - "\x04base\x18\x01 \x01(\v2\x1c.topfans.common.BaseResponseR\x04base\x12#\n" + - "\rcleaned_count\x18\x02 \x01(\x05R\fcleanedCount2\x9f\n" + - "\n" + + "\x04data\x18\x02 \x01(\v2$.topfans.gallery.ExhibitedAssetsDataR\x04data2\xf4\b\n" + "\x0eGalleryService\x12u\n" + "\fGetMyGallery\x12$.topfans.gallery.GetMyGalleryRequest\x1a%.topfans.gallery.GetMyGalleryResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/api/mygalleries\x12\x86\x01\n" + "\x0eGetUserGallery\x12&.topfans.gallery.GetUserGalleryRequest\x1a'.topfans.gallery.GetUserGalleryResponse\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/api/galleries/{target_uid}\x12v\n" + @@ -1854,23 +1759,22 @@ const file_proto_gallery_proto_rawDesc = "" + "\x0eRemoveFromSlot\x12&.topfans.gallery.RemoveFromSlotRequest\x1a'.topfans.gallery.RemoveFromSlotResponse\",\x82\xd3\xe4\x93\x02&*$/api/galleries/slots/{slot_id}/asset\x12\x98\x01\n" + "\x14GetMyExhibitedAssets\x12,.topfans.gallery.GetMyExhibitedAssetsRequest\x1a-.topfans.gallery.GetMyExhibitedAssetsResponse\"#\x82\xd3\xe4\x93\x02\x1d\x12\x1b/api/v1/me/exhibited-assets\x12\x8f\x01\n" + "\x12GetInspirationFlow\x12*.topfans.gallery.GetInspirationFlowRequest\x1a+.topfans.gallery.GetInspirationFlowResponse\" \x82\xd3\xe4\x93\x02\x1a\x12\x18/api/v1/inspiration-flow\x12\xab\x01\n" + - "\x16GetUserExhibitedAssets\x12..topfans.gallery.GetUserExhibitedAssetsRequest\x1a/.topfans.gallery.GetUserExhibitedAssetsResponse\"0\x82\xd3\xe4\x93\x02*\x12(/api/v1/users/{user_id}/exhibited-assets\x12\xa8\x01\n" + - "\x14CleanupDisplayStatus\x12,.topfans.gallery.CleanupDisplayStatusRequest\x1a-.topfans.gallery.CleanupDisplayStatusResponse\"3\x82\xd3\xe4\x93\x02-:\x01*\"(/api/v1/galleries/cleanup-display-statusB6Z4github.com/topfans/backend/pkg/proto/gallery;galleryb\x06proto3" + "\x16GetUserExhibitedAssets\x12..topfans.gallery.GetUserExhibitedAssetsRequest\x1a/.topfans.gallery.GetUserExhibitedAssetsResponse\"0\x82\xd3\xe4\x93\x02*\x12(/api/v1/users/{user_id}/exhibited-assetsB6Z4github.com/topfans/backend/pkg/proto/gallery;galleryb\x06proto3" var ( - file_proto_gallery_proto_rawDescOnce sync.Once - file_proto_gallery_proto_rawDescData []byte + file_gallery_proto_rawDescOnce sync.Once + file_gallery_proto_rawDescData []byte ) -func file_proto_gallery_proto_rawDescGZIP() []byte { - file_proto_gallery_proto_rawDescOnce.Do(func() { - file_proto_gallery_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_proto_gallery_proto_rawDesc), len(file_proto_gallery_proto_rawDesc))) +func file_gallery_proto_rawDescGZIP() []byte { + file_gallery_proto_rawDescOnce.Do(func() { + file_gallery_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_gallery_proto_rawDesc), len(file_gallery_proto_rawDesc))) }) - return file_proto_gallery_proto_rawDescData + return file_gallery_proto_rawDescData } -var file_proto_gallery_proto_msgTypes = make([]protoimpl.MessageInfo, 28) -var file_proto_gallery_proto_goTypes = []any{ +var file_gallery_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_gallery_proto_goTypes = []any{ (*GetMyGalleryRequest)(nil), // 0: topfans.gallery.GetMyGalleryRequest (*GetMyGalleryResponse)(nil), // 1: topfans.gallery.GetMyGalleryResponse (*GetUserGalleryRequest)(nil), // 2: topfans.gallery.GetUserGalleryRequest @@ -1897,77 +1801,72 @@ var file_proto_gallery_proto_goTypes = []any{ (*InspirationFlowItem)(nil), // 23: topfans.gallery.InspirationFlowItem (*GetUserExhibitedAssetsRequest)(nil), // 24: topfans.gallery.GetUserExhibitedAssetsRequest (*GetUserExhibitedAssetsResponse)(nil), // 25: topfans.gallery.GetUserExhibitedAssetsResponse - (*CleanupDisplayStatusRequest)(nil), // 26: topfans.gallery.CleanupDisplayStatusRequest - (*CleanupDisplayStatusResponse)(nil), // 27: topfans.gallery.CleanupDisplayStatusResponse - (*common.BaseResponse)(nil), // 28: topfans.common.BaseResponse + (*common.BaseResponse)(nil), // 26: topfans.common.BaseResponse } -var file_proto_gallery_proto_depIdxs = []int32{ - 28, // 0: topfans.gallery.GetMyGalleryResponse.base:type_name -> topfans.common.BaseResponse +var file_gallery_proto_depIdxs = []int32{ + 26, // 0: topfans.gallery.GetMyGalleryResponse.base:type_name -> topfans.common.BaseResponse 8, // 1: topfans.gallery.GetMyGalleryResponse.data:type_name -> topfans.gallery.GalleryData - 28, // 2: topfans.gallery.GetUserGalleryResponse.base:type_name -> topfans.common.BaseResponse + 26, // 2: topfans.gallery.GetUserGalleryResponse.base:type_name -> topfans.common.BaseResponse 8, // 3: topfans.gallery.GetUserGalleryResponse.data:type_name -> topfans.gallery.GalleryData - 28, // 4: topfans.gallery.PlaceAssetResponse.base:type_name -> topfans.common.BaseResponse + 26, // 4: topfans.gallery.PlaceAssetResponse.base:type_name -> topfans.common.BaseResponse 12, // 5: topfans.gallery.PlaceAssetResponse.data:type_name -> topfans.gallery.PlaceAssetData - 28, // 6: topfans.gallery.UnlockSlotResponse.base:type_name -> topfans.common.BaseResponse + 26, // 6: topfans.gallery.UnlockSlotResponse.base:type_name -> topfans.common.BaseResponse 13, // 7: topfans.gallery.UnlockSlotResponse.data:type_name -> topfans.gallery.UnlockSlotData 9, // 8: topfans.gallery.GalleryData.slots:type_name -> topfans.gallery.SlotInfo 10, // 9: topfans.gallery.SlotInfo.asset:type_name -> topfans.gallery.AssetInfo 11, // 10: topfans.gallery.SlotInfo.unlock_condition:type_name -> topfans.gallery.UnlockCondition - 28, // 11: topfans.gallery.RemoveFromSlotResponse.base:type_name -> topfans.common.BaseResponse - 28, // 12: topfans.gallery.GetMyExhibitedAssetsResponse.base:type_name -> topfans.common.BaseResponse + 26, // 11: topfans.gallery.RemoveFromSlotResponse.base:type_name -> topfans.common.BaseResponse + 26, // 12: topfans.gallery.GetMyExhibitedAssetsResponse.base:type_name -> topfans.common.BaseResponse 18, // 13: topfans.gallery.GetMyExhibitedAssetsResponse.data:type_name -> topfans.gallery.ExhibitedAssetsData 19, // 14: topfans.gallery.ExhibitedAssetsData.items:type_name -> topfans.gallery.ExhibitedAssetItem - 28, // 15: topfans.gallery.GetInspirationFlowResponse.base:type_name -> topfans.common.BaseResponse + 26, // 15: topfans.gallery.GetInspirationFlowResponse.base:type_name -> topfans.common.BaseResponse 22, // 16: topfans.gallery.GetInspirationFlowResponse.data:type_name -> topfans.gallery.InspirationFlowData 23, // 17: topfans.gallery.InspirationFlowData.items:type_name -> topfans.gallery.InspirationFlowItem - 28, // 18: topfans.gallery.GetUserExhibitedAssetsResponse.base:type_name -> topfans.common.BaseResponse + 26, // 18: topfans.gallery.GetUserExhibitedAssetsResponse.base:type_name -> topfans.common.BaseResponse 18, // 19: topfans.gallery.GetUserExhibitedAssetsResponse.data:type_name -> topfans.gallery.ExhibitedAssetsData - 28, // 20: topfans.gallery.CleanupDisplayStatusResponse.base:type_name -> topfans.common.BaseResponse - 0, // 21: topfans.gallery.GalleryService.GetMyGallery:input_type -> topfans.gallery.GetMyGalleryRequest - 2, // 22: topfans.gallery.GalleryService.GetUserGallery:input_type -> topfans.gallery.GetUserGalleryRequest - 4, // 23: topfans.gallery.GalleryService.PlaceAsset:input_type -> topfans.gallery.PlaceAssetRequest - 6, // 24: topfans.gallery.GalleryService.UnlockSlot:input_type -> topfans.gallery.UnlockSlotRequest - 14, // 25: topfans.gallery.GalleryService.RemoveFromSlot:input_type -> topfans.gallery.RemoveFromSlotRequest - 16, // 26: topfans.gallery.GalleryService.GetMyExhibitedAssets:input_type -> topfans.gallery.GetMyExhibitedAssetsRequest - 20, // 27: topfans.gallery.GalleryService.GetInspirationFlow:input_type -> topfans.gallery.GetInspirationFlowRequest - 24, // 28: topfans.gallery.GalleryService.GetUserExhibitedAssets:input_type -> topfans.gallery.GetUserExhibitedAssetsRequest - 26, // 29: topfans.gallery.GalleryService.CleanupDisplayStatus:input_type -> topfans.gallery.CleanupDisplayStatusRequest - 1, // 30: topfans.gallery.GalleryService.GetMyGallery:output_type -> topfans.gallery.GetMyGalleryResponse - 3, // 31: topfans.gallery.GalleryService.GetUserGallery:output_type -> topfans.gallery.GetUserGalleryResponse - 5, // 32: topfans.gallery.GalleryService.PlaceAsset:output_type -> topfans.gallery.PlaceAssetResponse - 7, // 33: topfans.gallery.GalleryService.UnlockSlot:output_type -> topfans.gallery.UnlockSlotResponse - 15, // 34: topfans.gallery.GalleryService.RemoveFromSlot:output_type -> topfans.gallery.RemoveFromSlotResponse - 17, // 35: topfans.gallery.GalleryService.GetMyExhibitedAssets:output_type -> topfans.gallery.GetMyExhibitedAssetsResponse - 21, // 36: topfans.gallery.GalleryService.GetInspirationFlow:output_type -> topfans.gallery.GetInspirationFlowResponse - 25, // 37: topfans.gallery.GalleryService.GetUserExhibitedAssets:output_type -> topfans.gallery.GetUserExhibitedAssetsResponse - 27, // 38: topfans.gallery.GalleryService.CleanupDisplayStatus:output_type -> topfans.gallery.CleanupDisplayStatusResponse - 30, // [30:39] is the sub-list for method output_type - 21, // [21:30] is the sub-list for method input_type - 21, // [21:21] is the sub-list for extension type_name - 21, // [21:21] is the sub-list for extension extendee - 0, // [0:21] is the sub-list for field type_name + 0, // 20: topfans.gallery.GalleryService.GetMyGallery:input_type -> topfans.gallery.GetMyGalleryRequest + 2, // 21: topfans.gallery.GalleryService.GetUserGallery:input_type -> topfans.gallery.GetUserGalleryRequest + 4, // 22: topfans.gallery.GalleryService.PlaceAsset:input_type -> topfans.gallery.PlaceAssetRequest + 6, // 23: topfans.gallery.GalleryService.UnlockSlot:input_type -> topfans.gallery.UnlockSlotRequest + 14, // 24: topfans.gallery.GalleryService.RemoveFromSlot:input_type -> topfans.gallery.RemoveFromSlotRequest + 16, // 25: topfans.gallery.GalleryService.GetMyExhibitedAssets:input_type -> topfans.gallery.GetMyExhibitedAssetsRequest + 20, // 26: topfans.gallery.GalleryService.GetInspirationFlow:input_type -> topfans.gallery.GetInspirationFlowRequest + 24, // 27: topfans.gallery.GalleryService.GetUserExhibitedAssets:input_type -> topfans.gallery.GetUserExhibitedAssetsRequest + 1, // 28: topfans.gallery.GalleryService.GetMyGallery:output_type -> topfans.gallery.GetMyGalleryResponse + 3, // 29: topfans.gallery.GalleryService.GetUserGallery:output_type -> topfans.gallery.GetUserGalleryResponse + 5, // 30: topfans.gallery.GalleryService.PlaceAsset:output_type -> topfans.gallery.PlaceAssetResponse + 7, // 31: topfans.gallery.GalleryService.UnlockSlot:output_type -> topfans.gallery.UnlockSlotResponse + 15, // 32: topfans.gallery.GalleryService.RemoveFromSlot:output_type -> topfans.gallery.RemoveFromSlotResponse + 17, // 33: topfans.gallery.GalleryService.GetMyExhibitedAssets:output_type -> topfans.gallery.GetMyExhibitedAssetsResponse + 21, // 34: topfans.gallery.GalleryService.GetInspirationFlow:output_type -> topfans.gallery.GetInspirationFlowResponse + 25, // 35: topfans.gallery.GalleryService.GetUserExhibitedAssets:output_type -> topfans.gallery.GetUserExhibitedAssetsResponse + 28, // [28:36] is the sub-list for method output_type + 20, // [20:28] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } -func init() { file_proto_gallery_proto_init() } -func file_proto_gallery_proto_init() { - if File_proto_gallery_proto != nil { +func init() { file_gallery_proto_init() } +func file_gallery_proto_init() { + if File_gallery_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_proto_gallery_proto_rawDesc), len(file_proto_gallery_proto_rawDesc)), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_gallery_proto_rawDesc), len(file_gallery_proto_rawDesc)), NumEnums: 0, - NumMessages: 28, + NumMessages: 26, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_proto_gallery_proto_goTypes, - DependencyIndexes: file_proto_gallery_proto_depIdxs, - MessageInfos: file_proto_gallery_proto_msgTypes, + GoTypes: file_gallery_proto_goTypes, + DependencyIndexes: file_gallery_proto_depIdxs, + MessageInfos: file_gallery_proto_msgTypes, }.Build() - File_proto_gallery_proto = out.File - file_proto_gallery_proto_goTypes = nil - file_proto_gallery_proto_depIdxs = nil + File_gallery_proto = out.File + file_gallery_proto_goTypes = nil + file_gallery_proto_depIdxs = nil } diff --git a/backend/proto/activity.proto b/backend/proto/activity.proto index 56045f0..63b1a41 100644 --- a/backend/proto/activity.proto +++ b/backend/proto/activity.proto @@ -136,6 +136,37 @@ message GetProgressResponse { string status = 7; // pending/active/completed/expired } +// ==================== 铸造活动(MintingActivity)相关消息 ==================== + +// 铸造活动信息(用于运营banner) +message MintingActivity { + int64 id = 1; + string title = 2; + string description = 3; + string cover_image = 4; + int64 star_id = 5; + string route = 6; + bool is_active = 7; + int64 created_at = 8; + int64 updated_at = 9; +} + +// 获取铸造活动列表请求 +message GetMintingActivitiesRequest { + int64 star_id = 1; // 可选,不传则返回所有 + int32 page = 2; + int32 page_size = 3; +} + +// 获取铸造活动列表响应 +message GetMintingActivitiesResponse { + topfans.common.BaseResponse base = 1; + repeated MintingActivity activities = 2; + int32 page = 3; + int32 page_size = 4; + int32 total = 5; +} + // ==================== 活动服务 ==================== service ActivityService { @@ -181,4 +212,11 @@ service ActivityService { get: "/api/v1/activities/{activity_id}/ranking" }; } + + // 获取铸造活动列表(用于运营banner) + rpc GetMintingActivities(GetMintingActivitiesRequest) returns (GetMintingActivitiesResponse) { + option (google.api.http) = { + get: "/api/v1/minting-activities" + }; + } } diff --git a/backend/services/activityService/main.go b/backend/services/activityService/main.go index fd04a85..774fad1 100644 --- a/backend/services/activityService/main.go +++ b/backend/services/activityService/main.go @@ -84,6 +84,7 @@ func main() { // 初始化 Repository activityRepo := repository.NewActivityRepository() + mintingActivityRepo := repository.NewMintingActivityRepository() // 初始化 User RPC Client userRPCClient, err := createUserRPCClient() @@ -92,7 +93,7 @@ func main() { } // 初始化 Service - activityService := service.NewActivityService(activityRepo, userRPCClient) + activityService := service.NewActivityService(activityRepo, mintingActivityRepo, userRPCClient) // 初始化 Provider activityProvider := provider.NewActivityProvider(activityService) @@ -135,6 +136,7 @@ func autoMigrate() error { &models.ActivityItem{}, &models.ActivityContribution{}, &models.ActivityUserStats{}, + &models.MintingActivity{}, } for _, table := range tables { diff --git a/backend/services/activityService/provider/activity_provider.go b/backend/services/activityService/provider/activity_provider.go index 528b150..442d052 100644 --- a/backend/services/activityService/provider/activity_provider.go +++ b/backend/services/activityService/provider/activity_provider.go @@ -190,3 +190,31 @@ func (p *ActivityProvider) GetContributionRanking(ctx context.Context, req *pb.C return resp, nil } + +// GetMintingActivities 获取铸造活动列表(用于运营banner) +func (p *ActivityProvider) GetMintingActivities(ctx context.Context, req *pb.GetMintingActivitiesRequest) (*pb.GetMintingActivitiesResponse, error) { + logger.Logger.Info("Received GetMintingActivities request", + zap.Int64("star_id", req.StarId), + zap.Int32("page", req.Page), + zap.Int32("page_size", req.PageSize), + ) + + // 调用Service层 + resp, err := p.activityService.GetMintingActivities(ctx, req) + if err != nil { + logger.Logger.Error("GetMintingActivities failed", zap.Error(err)) + return &pb.GetMintingActivitiesResponse{ + Base: &pbCommon.BaseResponse{ + Code: appErrors.ToStatusCode(err), + Message: err.Error(), + Timestamp: time.Now().UnixMilli(), + }, + }, err + } + + logger.Logger.Debug("GetMintingActivities successful", + zap.Int("activities_count", len(resp.Activities)), + ) + + return resp, nil +} diff --git a/backend/services/activityService/repository/minting_activity_repository.go b/backend/services/activityService/repository/minting_activity_repository.go new file mode 100644 index 0000000..aa1e48e --- /dev/null +++ b/backend/services/activityService/repository/minting_activity_repository.go @@ -0,0 +1,80 @@ +package repository + +import ( + "errors" + + "github.com/topfans/backend/pkg/database" + "github.com/topfans/backend/pkg/models" + "gorm.io/gorm" +) + +// MintingActivityRepository MintingActivity仓库接口 +type MintingActivityRepository interface { + // GetActiveMintingActivities 获取活跃的铸造活动列表 + GetActiveMintingActivities(starID int64, page, pageSize int) ([]*models.MintingActivity, int64, error) + + // GetMintingActivityByID 根据ID获取铸造活动 + GetMintingActivityByID(id int64) (*models.MintingActivity, error) +} + +// mintingActivityRepository MintingActivity仓库实现 +type mintingActivityRepository struct { + db *gorm.DB +} + +// NewMintingActivityRepository 创建MintingActivity仓库实例 +func NewMintingActivityRepository() MintingActivityRepository { + return &mintingActivityRepository{ + db: database.GetDB(), + } +} + +// GetActiveMintingActivities 获取活跃的铸造活动列表 +func (r *mintingActivityRepository) GetActiveMintingActivities(starID int64, page, pageSize int) ([]*models.MintingActivity, int64, error) { + if page <= 0 { + page = 1 + } + if pageSize <= 0 { + pageSize = 10 + } + + query := r.db.Model(&models.MintingActivity{}).Where("is_active = ?", true) + + if starID > 0 { + query = query.Where("star_id = ?", starID) + } + + var total int64 + if err := query.Count(&total).Error; err != nil { + return nil, 0, err + } + + offset := (page - 1) * pageSize + var activities []*models.MintingActivity + if err := query. + Order("created_at DESC"). + Offset(offset). + Limit(pageSize). + Find(&activities).Error; err != nil { + return nil, 0, err + } + + return activities, total, nil +} + +// GetMintingActivityByID 根据ID获取铸造活动 +func (r *mintingActivityRepository) GetMintingActivityByID(id int64) (*models.MintingActivity, error) { + if id <= 0 { + return nil, errors.New("id must be greater than 0") + } + + var activity models.MintingActivity + if err := r.db.First(&activity, id).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return nil, nil + } + return nil, err + } + + return &activity, nil +} \ No newline at end of file diff --git a/frontend/pages/components/CastloveContent.vue b/frontend/pages/components/CastloveContent.vue index 3daba73..31224be 100644 --- a/frontend/pages/components/CastloveContent.vue +++ b/frontend/pages/components/CastloveContent.vue @@ -86,6 +86,7 @@