diff --git a/backend/gateway/dto/asset_converter.go b/backend/gateway/dto/asset_converter.go index 9c06ce4..27d5072 100644 --- a/backend/gateway/dto/asset_converter.go +++ b/backend/gateway/dto/asset_converter.go @@ -148,24 +148,89 @@ func ConvertGetMyAssetsResponse(pbResp *pbAsset.GetMyAssetsResponse) *GetMyAsset return nil } - dto := &GetMyAssetsResponseDTO{ - Total: pbResp.Total, - Page: pbResp.Page, - PageSize: pbResp.PageSize, - HasMore: pbResp.HasMore, - Items: make([]AssetListItemDTO, 0, len(pbResp.Items)), - } + dto := &GetMyAssetsResponseDTO{} - // 转换列表项 - for _, item := range pbResp.Items { - if item != nil { - dto.Items = append(dto.Items, ConvertAssetListItem(item)) + if pbResp.Data != nil { + dto.Data = &AssetListDataDTO{ + Total: pbResp.Data.Total, + Page: pbResp.Data.Page, + PageSize: pbResp.Data.PageSize, + HasMore: pbResp.Data.HasMore, + Groups: make([]AssetGroupDTO, 0, len(pbResp.Data.Groups)), + } + + // 转换分组 + for _, group := range pbResp.Data.Groups { + if group != nil { + dto.Data.Groups = append(dto.Data.Groups, ConvertAssetGroup(group)) + } } } return dto } +// ConvertAssetGroup 转换资产分组 +func ConvertAssetGroup(pbGroup *pbAsset.AssetGroup) AssetGroupDTO { + dto := AssetGroupDTO{ + Type: pbGroup.Type, + Category: pbGroup.Category, + CategoryName: pbGroup.CategoryName, + TotalCount: pbGroup.TotalCount, + HasMore: pbGroup.HasMore, + Grades: make([]GradeSectionDTO, 0, len(pbGroup.Grades)), + Items: make([]AssetItemDTO, 0, len(pbGroup.Items)), + } + + // 转换 grades + for _, grade := range pbGroup.Grades { + if grade != nil { + dto.Grades = append(dto.Grades, ConvertGradeSection(grade)) + } + } + + // 转换 items + for _, item := range pbGroup.Items { + if item != nil { + dto.Items = append(dto.Items, ConvertAssetItem(item)) + } + } + + return dto +} + +// ConvertGradeSection 转换等级分组 +func ConvertGradeSection(pbGrade *pbAsset.GradeSection) GradeSectionDTO { + dto := GradeSectionDTO{ + Grade: pbGrade.Grade, + TotalCount: pbGrade.TotalCount, + HasMore: pbGrade.HasMore, + Items: make([]AssetItemDTO, 0, len(pbGrade.Items)), + } + + for _, item := range pbGrade.Items { + if item != nil { + dto.Items = append(dto.Items, ConvertAssetItem(item)) + } + } + + return dto +} + +// ConvertAssetItem 转换资产项 +func ConvertAssetItem(pbItem *pbAsset.AssetItem) AssetItemDTO { + return AssetItemDTO{ + AssetID: pbItem.AssetId, + Name: pbItem.Name, + CoverURLSigned: pbItem.CoverUrlSigned, + LikeCount: pbItem.LikeCount, + CreatedAt: pbItem.CreatedAt, + Category: pbItem.Category, + Grade: pbItem.Grade, + DisplayStatus: pbItem.DisplayStatus, + } +} + // ConvertAssetListItem 转换资产列表项 func ConvertAssetListItem(pbItem *pbAsset.AssetListItem) AssetListItemDTO { dto := AssetListItemDTO{ diff --git a/backend/gateway/dto/asset_dto.go b/backend/gateway/dto/asset_dto.go index 631ee96..1a651a3 100644 --- a/backend/gateway/dto/asset_dto.go +++ b/backend/gateway/dto/asset_dto.go @@ -91,11 +91,47 @@ type OwnerInfoDTO struct { // GetMyAssetsResponseDTO 获取我的藏品列表响应 type GetMyAssetsResponseDTO struct { - Items []AssetListItemDTO `json:"items"` // 资产列表 - Total int64 `json:"total"` // 总数 - Page int32 `json:"page"` // 当前页码 - PageSize int32 `json:"page_size"` // 每页数量 - HasMore bool `json:"has_more"` // 是否有更多 + Data *AssetListDataDTO `json:"data"` // 分组后的藏品数据 +} + +// AssetListDataDTO 藏品列表数据(与星册home一致的结构) +type AssetListDataDTO struct { + Groups []AssetGroupDTO `json:"groups"` // 分组列表 + Total int64 `json:"total"` // 总数 + Page int32 `json:"page"` // 当前页码 + PageSize int32 `json:"page_size"` // 每页数量 + HasMore bool `json:"has_more"` // 是否有更多 +} + +// AssetGroupDTO 资产分组(与星册home一致) +type AssetGroupDTO struct { + Type string `json:"type"` // 'regular' / 'collection' / 'activity' + Category string `json:"category"` // 'castlove'(regular) / collection_category / activity_type + CategoryName string `json:"category_name"` // 分组名称 + Grades []GradeSectionDTO `json:"grades"` // 仅 regular 时有效 + Items []AssetItemDTO `json:"items"` // collection / activity 时有效 + TotalCount int32 `json:"total_count"` // 总数 + HasMore bool `json:"has_more"` // 是否有更多 +} + +// GradeSectionDTO 等级分组(仅 regular 类型使用) +type GradeSectionDTO struct { + Grade int32 `json:"grade"` // 等级:1/2/3/4/5... + Items []AssetItemDTO `json:"items"` // 藏品列表 + TotalCount int32 `json:"total_count"` // 该等级总数 + HasMore bool `json:"has_more"` // 是否有更多 +} + +// AssetItemDTO 资产项(与星册home一致) +type AssetItemDTO struct { + AssetID int64 `json:"asset_id"` // 资产ID + Name string `json:"name"` // 藏品名称 + CoverURLSigned string `json:"cover_url_signed"` // 预签名封面URL + LikeCount int32 `json:"like_count"` // 点赞数 + CreatedAt int64 `json:"created_at"` // 创建时间 + Category string `json:"category"` // 分类 + Grade int32 `json:"grade"` // 等级(仅 regular 时有效) + DisplayStatus int32 `json:"display_status"` // 展示状态:0=待展示, 1=已展示 } // AssetListItemDTO 资产列表项(简化版,用于列表展示) diff --git a/backend/pkg/proto/asset/asset.pb.go b/backend/pkg/proto/asset/asset.pb.go index 5b859f1..9021c43 100644 --- a/backend/pkg/proto/asset/asset.pb.go +++ b/backend/pkg/proto/asset/asset.pb.go @@ -931,11 +931,7 @@ func (x *GetMyAssetsRequest) GetSort() string { type GetMyAssetsResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Base *common.BaseResponse `protobuf:"bytes,1,opt,name=base,proto3" json:"base,omitempty"` - Items []*AssetListItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` // 资产列表 - Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total,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"` // 每页数量 - HasMore bool `protobuf:"varint,6,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty"` // 是否有更多 + Data *AssetListData `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // 分组后的藏品数据 unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -977,42 +973,354 @@ func (x *GetMyAssetsResponse) GetBase() *common.BaseResponse { return nil } -func (x *GetMyAssetsResponse) GetItems() []*AssetListItem { +func (x *GetMyAssetsResponse) GetData() *AssetListData { if x != nil { - return x.Items + return x.Data } return nil } -func (x *GetMyAssetsResponse) GetTotal() int64 { +// 藏品列表数据(与星册home一致的结构) +type AssetListData struct { + state protoimpl.MessageState `protogen:"open.v1"` + Groups []*AssetGroup `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"` // 分组列表 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,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"` // 每页数量 + HasMore bool `protobuf:"varint,5,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty"` // 是否有更多 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AssetListData) Reset() { + *x = AssetListData{} + mi := &file_asset_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AssetListData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AssetListData) ProtoMessage() {} + +func (x *AssetListData) ProtoReflect() protoreflect.Message { + mi := &file_asset_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 AssetListData.ProtoReflect.Descriptor instead. +func (*AssetListData) Descriptor() ([]byte, []int) { + return file_asset_proto_rawDescGZIP(), []int{11} +} + +func (x *AssetListData) GetGroups() []*AssetGroup { + if x != nil { + return x.Groups + } + return nil +} + +func (x *AssetListData) GetTotal() int64 { if x != nil { return x.Total } return 0 } -func (x *GetMyAssetsResponse) GetPage() int32 { +func (x *AssetListData) GetPage() int32 { if x != nil { return x.Page } return 0 } -func (x *GetMyAssetsResponse) GetPageSize() int32 { +func (x *AssetListData) GetPageSize() int32 { if x != nil { return x.PageSize } return 0 } -func (x *GetMyAssetsResponse) GetHasMore() bool { +func (x *AssetListData) GetHasMore() bool { if x != nil { return x.HasMore } return false } -// 资产列表项(简化版,用于列表展示) +// 资产分组(与星册home一致) +type AssetGroup struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // 'regular' / 'collection' / 'activity' + Category string `protobuf:"bytes,2,opt,name=category,proto3" json:"category,omitempty"` // 'castlove'(regular) / collection_category / activity_type + CategoryName string `protobuf:"bytes,3,opt,name=category_name,json=categoryName,proto3" json:"category_name,omitempty"` + Grades []*GradeSection `protobuf:"bytes,4,rep,name=grades,proto3" json:"grades,omitempty"` // 仅 regular 时有效 + Items []*AssetItem `protobuf:"bytes,5,rep,name=items,proto3" json:"items,omitempty"` // collection / activity 时有效 + TotalCount int32 `protobuf:"varint,6,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + HasMore bool `protobuf:"varint,7,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AssetGroup) Reset() { + *x = AssetGroup{} + mi := &file_asset_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AssetGroup) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AssetGroup) ProtoMessage() {} + +func (x *AssetGroup) ProtoReflect() protoreflect.Message { + mi := &file_asset_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 AssetGroup.ProtoReflect.Descriptor instead. +func (*AssetGroup) Descriptor() ([]byte, []int) { + return file_asset_proto_rawDescGZIP(), []int{12} +} + +func (x *AssetGroup) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *AssetGroup) GetCategory() string { + if x != nil { + return x.Category + } + return "" +} + +func (x *AssetGroup) GetCategoryName() string { + if x != nil { + return x.CategoryName + } + return "" +} + +func (x *AssetGroup) GetGrades() []*GradeSection { + if x != nil { + return x.Grades + } + return nil +} + +func (x *AssetGroup) GetItems() []*AssetItem { + if x != nil { + return x.Items + } + return nil +} + +func (x *AssetGroup) GetTotalCount() int32 { + if x != nil { + return x.TotalCount + } + return 0 +} + +func (x *AssetGroup) GetHasMore() bool { + if x != nil { + return x.HasMore + } + return false +} + +// 等级分组(仅 regular 类型使用) +type GradeSection struct { + state protoimpl.MessageState `protogen:"open.v1"` + Grade int32 `protobuf:"varint,1,opt,name=grade,proto3" json:"grade,omitempty"` // 等级:1/2/3/4/5... + Items []*AssetItem `protobuf:"bytes,2,rep,name=items,proto3" json:"items,omitempty"` + TotalCount int32 `protobuf:"varint,3,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` + HasMore bool `protobuf:"varint,4,opt,name=has_more,json=hasMore,proto3" json:"has_more,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GradeSection) Reset() { + *x = GradeSection{} + mi := &file_asset_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GradeSection) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GradeSection) ProtoMessage() {} + +func (x *GradeSection) ProtoReflect() protoreflect.Message { + mi := &file_asset_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 GradeSection.ProtoReflect.Descriptor instead. +func (*GradeSection) Descriptor() ([]byte, []int) { + return file_asset_proto_rawDescGZIP(), []int{13} +} + +func (x *GradeSection) GetGrade() int32 { + if x != nil { + return x.Grade + } + return 0 +} + +func (x *GradeSection) GetItems() []*AssetItem { + if x != nil { + return x.Items + } + return nil +} + +func (x *GradeSection) GetTotalCount() int32 { + if x != nil { + return x.TotalCount + } + return 0 +} + +func (x *GradeSection) GetHasMore() bool { + if x != nil { + return x.HasMore + } + return false +} + +// 资产项(与星册home一致) +type AssetItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + AssetId int64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + CoverUrlSigned string `protobuf:"bytes,3,opt,name=cover_url_signed,json=coverUrlSigned,proto3" json:"cover_url_signed,omitempty"` // 预签名封面URL + LikeCount int32 `protobuf:"varint,4,opt,name=like_count,json=likeCount,proto3" json:"like_count,omitempty"` + CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Category string `protobuf:"bytes,6,opt,name=category,proto3" json:"category,omitempty"` // regular: 'castlove' / collection: category / activity: activity_type + Grade int32 `protobuf:"varint,7,opt,name=grade,proto3" json:"grade,omitempty"` // 仅 regular 时有效(1/2/3...),其他类型为 0 + DisplayStatus int32 `protobuf:"varint,8,opt,name=display_status,json=displayStatus,proto3" json:"display_status,omitempty"` // 展示状态:0=待展示, 1=已展示 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AssetItem) Reset() { + *x = AssetItem{} + mi := &file_asset_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AssetItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AssetItem) ProtoMessage() {} + +func (x *AssetItem) ProtoReflect() protoreflect.Message { + mi := &file_asset_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 AssetItem.ProtoReflect.Descriptor instead. +func (*AssetItem) Descriptor() ([]byte, []int) { + return file_asset_proto_rawDescGZIP(), []int{14} +} + +func (x *AssetItem) GetAssetId() int64 { + if x != nil { + return x.AssetId + } + return 0 +} + +func (x *AssetItem) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AssetItem) GetCoverUrlSigned() string { + if x != nil { + return x.CoverUrlSigned + } + return "" +} + +func (x *AssetItem) GetLikeCount() int32 { + if x != nil { + return x.LikeCount + } + return 0 +} + +func (x *AssetItem) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +func (x *AssetItem) GetCategory() string { + if x != nil { + return x.Category + } + return "" +} + +func (x *AssetItem) GetGrade() int32 { + if x != nil { + return x.Grade + } + return 0 +} + +func (x *AssetItem) GetDisplayStatus() int32 { + if x != nil { + return x.DisplayStatus + } + return 0 +} + +// 资产列表项(简化版,用于列表展示 - 保留兼容) type AssetListItem struct { state protoimpl.MessageState `protogen:"open.v1"` AssetId int64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` // 资产ID @@ -1029,7 +1337,7 @@ type AssetListItem struct { func (x *AssetListItem) Reset() { *x = AssetListItem{} - mi := &file_asset_proto_msgTypes[11] + mi := &file_asset_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1041,7 +1349,7 @@ func (x *AssetListItem) String() string { func (*AssetListItem) ProtoMessage() {} func (x *AssetListItem) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[11] + mi := &file_asset_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1054,7 +1362,7 @@ func (x *AssetListItem) ProtoReflect() protoreflect.Message { // Deprecated: Use AssetListItem.ProtoReflect.Descriptor instead. func (*AssetListItem) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{11} + return file_asset_proto_rawDescGZIP(), []int{15} } func (x *AssetListItem) GetAssetId() int64 { @@ -1123,7 +1431,7 @@ type GetAssetRequest struct { func (x *GetAssetRequest) Reset() { *x = GetAssetRequest{} - mi := &file_asset_proto_msgTypes[12] + mi := &file_asset_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1135,7 +1443,7 @@ func (x *GetAssetRequest) String() string { func (*GetAssetRequest) ProtoMessage() {} func (x *GetAssetRequest) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[12] + mi := &file_asset_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1148,7 +1456,7 @@ func (x *GetAssetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAssetRequest.ProtoReflect.Descriptor instead. func (*GetAssetRequest) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{12} + return file_asset_proto_rawDescGZIP(), []int{16} } func (x *GetAssetRequest) GetAssetId() int64 { @@ -1169,7 +1477,7 @@ type GetAssetResponse struct { func (x *GetAssetResponse) Reset() { *x = GetAssetResponse{} - mi := &file_asset_proto_msgTypes[13] + mi := &file_asset_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1181,7 +1489,7 @@ func (x *GetAssetResponse) String() string { func (*GetAssetResponse) ProtoMessage() {} func (x *GetAssetResponse) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[13] + mi := &file_asset_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1194,7 +1502,7 @@ func (x *GetAssetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAssetResponse.ProtoReflect.Descriptor instead. func (*GetAssetResponse) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{13} + return file_asset_proto_rawDescGZIP(), []int{17} } func (x *GetAssetResponse) GetBase() *common.BaseResponse { @@ -1221,7 +1529,7 @@ type GetAssetStatusRequest struct { func (x *GetAssetStatusRequest) Reset() { *x = GetAssetStatusRequest{} - mi := &file_asset_proto_msgTypes[14] + mi := &file_asset_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1233,7 +1541,7 @@ func (x *GetAssetStatusRequest) String() string { func (*GetAssetStatusRequest) ProtoMessage() {} func (x *GetAssetStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[14] + mi := &file_asset_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1246,7 +1554,7 @@ func (x *GetAssetStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAssetStatusRequest.ProtoReflect.Descriptor instead. func (*GetAssetStatusRequest) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{14} + return file_asset_proto_rawDescGZIP(), []int{18} } func (x *GetAssetStatusRequest) GetAssetId() int64 { @@ -1272,7 +1580,7 @@ type GetAssetStatusResponse struct { func (x *GetAssetStatusResponse) Reset() { *x = GetAssetStatusResponse{} - mi := &file_asset_proto_msgTypes[15] + mi := &file_asset_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1284,7 +1592,7 @@ func (x *GetAssetStatusResponse) String() string { func (*GetAssetStatusResponse) ProtoMessage() {} func (x *GetAssetStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[15] + mi := &file_asset_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1297,7 +1605,7 @@ func (x *GetAssetStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAssetStatusResponse.ProtoReflect.Descriptor instead. func (*GetAssetStatusResponse) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{15} + return file_asset_proto_rawDescGZIP(), []int{19} } func (x *GetAssetStatusResponse) GetBase() *common.BaseResponse { @@ -1359,7 +1667,7 @@ type GetMintOrderRequest struct { func (x *GetMintOrderRequest) Reset() { *x = GetMintOrderRequest{} - mi := &file_asset_proto_msgTypes[16] + mi := &file_asset_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1371,7 +1679,7 @@ func (x *GetMintOrderRequest) String() string { func (*GetMintOrderRequest) ProtoMessage() {} func (x *GetMintOrderRequest) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[16] + mi := &file_asset_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1384,7 +1692,7 @@ func (x *GetMintOrderRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMintOrderRequest.ProtoReflect.Descriptor instead. func (*GetMintOrderRequest) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{16} + return file_asset_proto_rawDescGZIP(), []int{20} } func (x *GetMintOrderRequest) GetOrderId() string { @@ -1406,7 +1714,7 @@ type GetMintOrderResponse struct { func (x *GetMintOrderResponse) Reset() { *x = GetMintOrderResponse{} - mi := &file_asset_proto_msgTypes[17] + mi := &file_asset_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1418,7 +1726,7 @@ func (x *GetMintOrderResponse) String() string { func (*GetMintOrderResponse) ProtoMessage() {} func (x *GetMintOrderResponse) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[17] + mi := &file_asset_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1431,7 +1739,7 @@ func (x *GetMintOrderResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMintOrderResponse.ProtoReflect.Descriptor instead. func (*GetMintOrderResponse) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{17} + return file_asset_proto_rawDescGZIP(), []int{21} } func (x *GetMintOrderResponse) GetBase() *common.BaseResponse { @@ -1465,7 +1773,7 @@ type CancelMintOrderRequest struct { func (x *CancelMintOrderRequest) Reset() { *x = CancelMintOrderRequest{} - mi := &file_asset_proto_msgTypes[18] + mi := &file_asset_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1477,7 +1785,7 @@ func (x *CancelMintOrderRequest) String() string { func (*CancelMintOrderRequest) ProtoMessage() {} func (x *CancelMintOrderRequest) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[18] + mi := &file_asset_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1490,7 +1798,7 @@ func (x *CancelMintOrderRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelMintOrderRequest.ProtoReflect.Descriptor instead. func (*CancelMintOrderRequest) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{18} + return file_asset_proto_rawDescGZIP(), []int{22} } func (x *CancelMintOrderRequest) GetOrderId() string { @@ -1512,7 +1820,7 @@ type CancelMintOrderResponse struct { func (x *CancelMintOrderResponse) Reset() { *x = CancelMintOrderResponse{} - mi := &file_asset_proto_msgTypes[19] + mi := &file_asset_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1524,7 +1832,7 @@ func (x *CancelMintOrderResponse) String() string { func (*CancelMintOrderResponse) ProtoMessage() {} func (x *CancelMintOrderResponse) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[19] + mi := &file_asset_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1537,7 +1845,7 @@ func (x *CancelMintOrderResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CancelMintOrderResponse.ProtoReflect.Descriptor instead. func (*CancelMintOrderResponse) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{19} + return file_asset_proto_rawDescGZIP(), []int{23} } func (x *CancelMintOrderResponse) GetBase() *common.BaseResponse { @@ -1571,7 +1879,7 @@ type LikeAssetRequest struct { func (x *LikeAssetRequest) Reset() { *x = LikeAssetRequest{} - mi := &file_asset_proto_msgTypes[20] + mi := &file_asset_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1583,7 +1891,7 @@ func (x *LikeAssetRequest) String() string { func (*LikeAssetRequest) ProtoMessage() {} func (x *LikeAssetRequest) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[20] + mi := &file_asset_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1596,7 +1904,7 @@ func (x *LikeAssetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LikeAssetRequest.ProtoReflect.Descriptor instead. func (*LikeAssetRequest) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{20} + return file_asset_proto_rawDescGZIP(), []int{24} } func (x *LikeAssetRequest) GetAssetId() int64 { @@ -1617,7 +1925,7 @@ type LikeAssetResponse struct { func (x *LikeAssetResponse) Reset() { *x = LikeAssetResponse{} - mi := &file_asset_proto_msgTypes[21] + mi := &file_asset_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1629,7 +1937,7 @@ func (x *LikeAssetResponse) String() string { func (*LikeAssetResponse) ProtoMessage() {} func (x *LikeAssetResponse) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[21] + mi := &file_asset_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1642,7 +1950,7 @@ func (x *LikeAssetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LikeAssetResponse.ProtoReflect.Descriptor instead. func (*LikeAssetResponse) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{21} + return file_asset_proto_rawDescGZIP(), []int{25} } func (x *LikeAssetResponse) GetBase() *common.BaseResponse { @@ -1669,7 +1977,7 @@ type UnlikeAssetRequest struct { func (x *UnlikeAssetRequest) Reset() { *x = UnlikeAssetRequest{} - mi := &file_asset_proto_msgTypes[22] + mi := &file_asset_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1681,7 +1989,7 @@ func (x *UnlikeAssetRequest) String() string { func (*UnlikeAssetRequest) ProtoMessage() {} func (x *UnlikeAssetRequest) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[22] + mi := &file_asset_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1694,7 +2002,7 @@ func (x *UnlikeAssetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UnlikeAssetRequest.ProtoReflect.Descriptor instead. func (*UnlikeAssetRequest) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{22} + return file_asset_proto_rawDescGZIP(), []int{26} } func (x *UnlikeAssetRequest) GetAssetId() int64 { @@ -1715,7 +2023,7 @@ type UnlikeAssetResponse struct { func (x *UnlikeAssetResponse) Reset() { *x = UnlikeAssetResponse{} - mi := &file_asset_proto_msgTypes[23] + mi := &file_asset_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1727,7 +2035,7 @@ func (x *UnlikeAssetResponse) String() string { func (*UnlikeAssetResponse) ProtoMessage() {} func (x *UnlikeAssetResponse) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[23] + mi := &file_asset_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1740,7 +2048,7 @@ func (x *UnlikeAssetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UnlikeAssetResponse.ProtoReflect.Descriptor instead. func (*UnlikeAssetResponse) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{23} + return file_asset_proto_rawDescGZIP(), []int{27} } func (x *UnlikeAssetResponse) GetBase() *common.BaseResponse { @@ -1767,7 +2075,7 @@ type CheckAssetLikeRequest struct { func (x *CheckAssetLikeRequest) Reset() { *x = CheckAssetLikeRequest{} - mi := &file_asset_proto_msgTypes[24] + mi := &file_asset_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1779,7 +2087,7 @@ func (x *CheckAssetLikeRequest) String() string { func (*CheckAssetLikeRequest) ProtoMessage() {} func (x *CheckAssetLikeRequest) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[24] + mi := &file_asset_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1792,7 +2100,7 @@ func (x *CheckAssetLikeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckAssetLikeRequest.ProtoReflect.Descriptor instead. func (*CheckAssetLikeRequest) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{24} + return file_asset_proto_rawDescGZIP(), []int{28} } func (x *CheckAssetLikeRequest) GetAssetId() int64 { @@ -1813,7 +2121,7 @@ type CheckAssetLikeResponse struct { func (x *CheckAssetLikeResponse) Reset() { *x = CheckAssetLikeResponse{} - mi := &file_asset_proto_msgTypes[25] + mi := &file_asset_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1825,7 +2133,7 @@ func (x *CheckAssetLikeResponse) String() string { func (*CheckAssetLikeResponse) ProtoMessage() {} func (x *CheckAssetLikeResponse) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[25] + mi := &file_asset_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1838,7 +2146,7 @@ func (x *CheckAssetLikeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckAssetLikeResponse.ProtoReflect.Descriptor instead. func (*CheckAssetLikeResponse) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{25} + return file_asset_proto_rawDescGZIP(), []int{29} } func (x *CheckAssetLikeResponse) GetBase() *common.BaseResponse { @@ -1869,7 +2177,7 @@ type AssetLike struct { func (x *AssetLike) Reset() { *x = AssetLike{} - mi := &file_asset_proto_msgTypes[26] + mi := &file_asset_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1881,7 +2189,7 @@ func (x *AssetLike) String() string { func (*AssetLike) ProtoMessage() {} func (x *AssetLike) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[26] + mi := &file_asset_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1894,7 +2202,7 @@ func (x *AssetLike) ProtoReflect() protoreflect.Message { // Deprecated: Use AssetLike.ProtoReflect.Descriptor instead. func (*AssetLike) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{26} + return file_asset_proto_rawDescGZIP(), []int{30} } func (x *AssetLike) GetId() int64 { @@ -1944,7 +2252,7 @@ type GetAssetLikesRequest struct { func (x *GetAssetLikesRequest) Reset() { *x = GetAssetLikesRequest{} - mi := &file_asset_proto_msgTypes[27] + mi := &file_asset_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1956,7 +2264,7 @@ func (x *GetAssetLikesRequest) String() string { func (*GetAssetLikesRequest) ProtoMessage() {} func (x *GetAssetLikesRequest) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[27] + mi := &file_asset_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1969,7 +2277,7 @@ func (x *GetAssetLikesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAssetLikesRequest.ProtoReflect.Descriptor instead. func (*GetAssetLikesRequest) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{27} + return file_asset_proto_rawDescGZIP(), []int{31} } func (x *GetAssetLikesRequest) GetAssetId() int64 { @@ -2008,7 +2316,7 @@ type GetAssetLikesResponse struct { func (x *GetAssetLikesResponse) Reset() { *x = GetAssetLikesResponse{} - mi := &file_asset_proto_msgTypes[28] + mi := &file_asset_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2020,7 +2328,7 @@ func (x *GetAssetLikesResponse) String() string { func (*GetAssetLikesResponse) ProtoMessage() {} func (x *GetAssetLikesResponse) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[28] + mi := &file_asset_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2033,7 +2341,7 @@ func (x *GetAssetLikesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAssetLikesResponse.ProtoReflect.Descriptor instead. func (*GetAssetLikesResponse) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{28} + return file_asset_proto_rawDescGZIP(), []int{32} } func (x *GetAssetLikesResponse) GetBase() *common.BaseResponse { @@ -2088,7 +2396,7 @@ type GetAssetForRPCRequest struct { func (x *GetAssetForRPCRequest) Reset() { *x = GetAssetForRPCRequest{} - mi := &file_asset_proto_msgTypes[29] + mi := &file_asset_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2100,7 +2408,7 @@ func (x *GetAssetForRPCRequest) String() string { func (*GetAssetForRPCRequest) ProtoMessage() {} func (x *GetAssetForRPCRequest) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[29] + mi := &file_asset_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2113,7 +2421,7 @@ func (x *GetAssetForRPCRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAssetForRPCRequest.ProtoReflect.Descriptor instead. func (*GetAssetForRPCRequest) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{29} + return file_asset_proto_rawDescGZIP(), []int{33} } func (x *GetAssetForRPCRequest) GetAssetId() int64 { @@ -2138,7 +2446,7 @@ type GetAssetForRPCResponse struct { func (x *GetAssetForRPCResponse) Reset() { *x = GetAssetForRPCResponse{} - mi := &file_asset_proto_msgTypes[30] + mi := &file_asset_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2150,7 +2458,7 @@ func (x *GetAssetForRPCResponse) String() string { func (*GetAssetForRPCResponse) ProtoMessage() {} func (x *GetAssetForRPCResponse) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[30] + mi := &file_asset_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2163,7 +2471,7 @@ func (x *GetAssetForRPCResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAssetForRPCResponse.ProtoReflect.Descriptor instead. func (*GetAssetForRPCResponse) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{30} + return file_asset_proto_rawDescGZIP(), []int{34} } func (x *GetAssetForRPCResponse) GetBase() *common.BaseResponse { @@ -2218,7 +2526,7 @@ type ClearAssetLikeRecordsRequest struct { func (x *ClearAssetLikeRecordsRequest) Reset() { *x = ClearAssetLikeRecordsRequest{} - mi := &file_asset_proto_msgTypes[31] + mi := &file_asset_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2230,7 +2538,7 @@ func (x *ClearAssetLikeRecordsRequest) String() string { func (*ClearAssetLikeRecordsRequest) ProtoMessage() {} func (x *ClearAssetLikeRecordsRequest) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[31] + mi := &file_asset_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2243,7 +2551,7 @@ func (x *ClearAssetLikeRecordsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ClearAssetLikeRecordsRequest.ProtoReflect.Descriptor instead. func (*ClearAssetLikeRecordsRequest) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{31} + return file_asset_proto_rawDescGZIP(), []int{35} } func (x *ClearAssetLikeRecordsRequest) GetAssetId() int64 { @@ -2263,7 +2571,7 @@ type ClearAssetLikeRecordsResponse struct { func (x *ClearAssetLikeRecordsResponse) Reset() { *x = ClearAssetLikeRecordsResponse{} - mi := &file_asset_proto_msgTypes[32] + mi := &file_asset_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2275,7 +2583,7 @@ func (x *ClearAssetLikeRecordsResponse) String() string { func (*ClearAssetLikeRecordsResponse) ProtoMessage() {} func (x *ClearAssetLikeRecordsResponse) ProtoReflect() protoreflect.Message { - mi := &file_asset_proto_msgTypes[32] + mi := &file_asset_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2288,7 +2596,7 @@ func (x *ClearAssetLikeRecordsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ClearAssetLikeRecordsResponse.ProtoReflect.Descriptor instead. func (*ClearAssetLikeRecordsResponse) Descriptor() ([]byte, []int) { - return file_asset_proto_rawDescGZIP(), []int{32} + return file_asset_proto_rawDescGZIP(), []int{36} } func (x *ClearAssetLikeRecordsResponse) GetBase() *common.BaseResponse { @@ -2389,14 +2697,43 @@ const file_asset_proto_rawDesc = "" + "\tpage_size\x18\x02 \x01(\x05R\bpageSize\x12\x16\n" + "\x06status\x18\x03 \x01(\tR\x06status\x12\x18\n" + "\akeyword\x18\x04 \x01(\tR\akeyword\x12\x12\n" + - "\x04sort\x18\x05 \x01(\tR\x04sort\"\xdd\x01\n" + + "\x04sort\x18\x05 \x01(\tR\x04sort\"y\n" + "\x13GetMyAssetsResponse\x120\n" + - "\x04base\x18\x01 \x01(\v2\x1c.topfans.common.BaseResponseR\x04base\x122\n" + - "\x05items\x18\x02 \x03(\v2\x1c.topfans.asset.AssetListItemR\x05items\x12\x14\n" + - "\x05total\x18\x03 \x01(\x03R\x05total\x12\x12\n" + - "\x04page\x18\x04 \x01(\x05R\x04page\x12\x1b\n" + - "\tpage_size\x18\x05 \x01(\x05R\bpageSize\x12\x19\n" + - "\bhas_more\x18\x06 \x01(\bR\ahasMore\"\xe7\x01\n" + + "\x04base\x18\x01 \x01(\v2\x1c.topfans.common.BaseResponseR\x04base\x120\n" + + "\x04data\x18\x02 \x01(\v2\x1c.topfans.asset.AssetListDataR\x04data\"\xa4\x01\n" + + "\rAssetListData\x121\n" + + "\x06groups\x18\x01 \x03(\v2\x19.topfans.asset.AssetGroupR\x06groups\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\x12\x12\n" + + "\x04page\x18\x03 \x01(\x05R\x04page\x12\x1b\n" + + "\tpage_size\x18\x04 \x01(\x05R\bpageSize\x12\x19\n" + + "\bhas_more\x18\x05 \x01(\bR\ahasMore\"\x82\x02\n" + + "\n" + + "AssetGroup\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12\x1a\n" + + "\bcategory\x18\x02 \x01(\tR\bcategory\x12#\n" + + "\rcategory_name\x18\x03 \x01(\tR\fcategoryName\x123\n" + + "\x06grades\x18\x04 \x03(\v2\x1b.topfans.asset.GradeSectionR\x06grades\x12.\n" + + "\x05items\x18\x05 \x03(\v2\x18.topfans.asset.AssetItemR\x05items\x12\x1f\n" + + "\vtotal_count\x18\x06 \x01(\x05R\n" + + "totalCount\x12\x19\n" + + "\bhas_more\x18\a \x01(\bR\ahasMore\"\x90\x01\n" + + "\fGradeSection\x12\x14\n" + + "\x05grade\x18\x01 \x01(\x05R\x05grade\x12.\n" + + "\x05items\x18\x02 \x03(\v2\x18.topfans.asset.AssetItemR\x05items\x12\x1f\n" + + "\vtotal_count\x18\x03 \x01(\x05R\n" + + "totalCount\x12\x19\n" + + "\bhas_more\x18\x04 \x01(\bR\ahasMore\"\xfb\x01\n" + + "\tAssetItem\x12\x19\n" + + "\basset_id\x18\x01 \x01(\x03R\aassetId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12(\n" + + "\x10cover_url_signed\x18\x03 \x01(\tR\x0ecoverUrlSigned\x12\x1d\n" + + "\n" + + "like_count\x18\x04 \x01(\x05R\tlikeCount\x12\x1d\n" + + "\n" + + "created_at\x18\x05 \x01(\x03R\tcreatedAt\x12\x1a\n" + + "\bcategory\x18\x06 \x01(\tR\bcategory\x12\x14\n" + + "\x05grade\x18\a \x01(\x05R\x05grade\x12%\n" + + "\x0edisplay_status\x18\b \x01(\x05R\rdisplayStatus\"\xe7\x01\n" + "\rAssetListItem\x12\x19\n" + "\basset_id\x18\x01 \x01(\x03R\aassetId\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1b\n" + @@ -2511,7 +2848,7 @@ func file_asset_proto_rawDescGZIP() []byte { return file_asset_proto_rawDescData } -var file_asset_proto_msgTypes = make([]protoimpl.MessageInfo, 33) +var file_asset_proto_msgTypes = make([]protoimpl.MessageInfo, 37) var file_asset_proto_goTypes = []any{ (*Asset)(nil), // 0: topfans.asset.Asset (*OwnerInfo)(nil), // 1: topfans.asset.OwnerInfo @@ -2524,88 +2861,96 @@ var file_asset_proto_goTypes = []any{ (*CreateMintOrderResponse)(nil), // 8: topfans.asset.CreateMintOrderResponse (*GetMyAssetsRequest)(nil), // 9: topfans.asset.GetMyAssetsRequest (*GetMyAssetsResponse)(nil), // 10: topfans.asset.GetMyAssetsResponse - (*AssetListItem)(nil), // 11: topfans.asset.AssetListItem - (*GetAssetRequest)(nil), // 12: topfans.asset.GetAssetRequest - (*GetAssetResponse)(nil), // 13: topfans.asset.GetAssetResponse - (*GetAssetStatusRequest)(nil), // 14: topfans.asset.GetAssetStatusRequest - (*GetAssetStatusResponse)(nil), // 15: topfans.asset.GetAssetStatusResponse - (*GetMintOrderRequest)(nil), // 16: topfans.asset.GetMintOrderRequest - (*GetMintOrderResponse)(nil), // 17: topfans.asset.GetMintOrderResponse - (*CancelMintOrderRequest)(nil), // 18: topfans.asset.CancelMintOrderRequest - (*CancelMintOrderResponse)(nil), // 19: topfans.asset.CancelMintOrderResponse - (*LikeAssetRequest)(nil), // 20: topfans.asset.LikeAssetRequest - (*LikeAssetResponse)(nil), // 21: topfans.asset.LikeAssetResponse - (*UnlikeAssetRequest)(nil), // 22: topfans.asset.UnlikeAssetRequest - (*UnlikeAssetResponse)(nil), // 23: topfans.asset.UnlikeAssetResponse - (*CheckAssetLikeRequest)(nil), // 24: topfans.asset.CheckAssetLikeRequest - (*CheckAssetLikeResponse)(nil), // 25: topfans.asset.CheckAssetLikeResponse - (*AssetLike)(nil), // 26: topfans.asset.AssetLike - (*GetAssetLikesRequest)(nil), // 27: topfans.asset.GetAssetLikesRequest - (*GetAssetLikesResponse)(nil), // 28: topfans.asset.GetAssetLikesResponse - (*GetAssetForRPCRequest)(nil), // 29: topfans.asset.GetAssetForRPCRequest - (*GetAssetForRPCResponse)(nil), // 30: topfans.asset.GetAssetForRPCResponse - (*ClearAssetLikeRecordsRequest)(nil), // 31: topfans.asset.ClearAssetLikeRecordsRequest - (*ClearAssetLikeRecordsResponse)(nil), // 32: topfans.asset.ClearAssetLikeRecordsResponse - (*common.BaseResponse)(nil), // 33: topfans.common.BaseResponse + (*AssetListData)(nil), // 11: topfans.asset.AssetListData + (*AssetGroup)(nil), // 12: topfans.asset.AssetGroup + (*GradeSection)(nil), // 13: topfans.asset.GradeSection + (*AssetItem)(nil), // 14: topfans.asset.AssetItem + (*AssetListItem)(nil), // 15: topfans.asset.AssetListItem + (*GetAssetRequest)(nil), // 16: topfans.asset.GetAssetRequest + (*GetAssetResponse)(nil), // 17: topfans.asset.GetAssetResponse + (*GetAssetStatusRequest)(nil), // 18: topfans.asset.GetAssetStatusRequest + (*GetAssetStatusResponse)(nil), // 19: topfans.asset.GetAssetStatusResponse + (*GetMintOrderRequest)(nil), // 20: topfans.asset.GetMintOrderRequest + (*GetMintOrderResponse)(nil), // 21: topfans.asset.GetMintOrderResponse + (*CancelMintOrderRequest)(nil), // 22: topfans.asset.CancelMintOrderRequest + (*CancelMintOrderResponse)(nil), // 23: topfans.asset.CancelMintOrderResponse + (*LikeAssetRequest)(nil), // 24: topfans.asset.LikeAssetRequest + (*LikeAssetResponse)(nil), // 25: topfans.asset.LikeAssetResponse + (*UnlikeAssetRequest)(nil), // 26: topfans.asset.UnlikeAssetRequest + (*UnlikeAssetResponse)(nil), // 27: topfans.asset.UnlikeAssetResponse + (*CheckAssetLikeRequest)(nil), // 28: topfans.asset.CheckAssetLikeRequest + (*CheckAssetLikeResponse)(nil), // 29: topfans.asset.CheckAssetLikeResponse + (*AssetLike)(nil), // 30: topfans.asset.AssetLike + (*GetAssetLikesRequest)(nil), // 31: topfans.asset.GetAssetLikesRequest + (*GetAssetLikesResponse)(nil), // 32: topfans.asset.GetAssetLikesResponse + (*GetAssetForRPCRequest)(nil), // 33: topfans.asset.GetAssetForRPCRequest + (*GetAssetForRPCResponse)(nil), // 34: topfans.asset.GetAssetForRPCResponse + (*ClearAssetLikeRecordsRequest)(nil), // 35: topfans.asset.ClearAssetLikeRecordsRequest + (*ClearAssetLikeRecordsResponse)(nil), // 36: topfans.asset.ClearAssetLikeRecordsResponse + (*common.BaseResponse)(nil), // 37: topfans.common.BaseResponse } var file_asset_proto_depIdxs = []int32{ 1, // 0: topfans.asset.Asset.owner:type_name -> topfans.asset.OwnerInfo - 33, // 1: topfans.asset.InitMintOrderResponse.base:type_name -> topfans.common.BaseResponse + 37, // 1: topfans.asset.InitMintOrderResponse.base:type_name -> topfans.common.BaseResponse 2, // 2: topfans.asset.InitMintOrderResponse.order:type_name -> topfans.asset.MintOrder - 33, // 3: topfans.asset.PreCreateMintOrderResponse.base:type_name -> topfans.common.BaseResponse + 37, // 3: topfans.asset.PreCreateMintOrderResponse.base:type_name -> topfans.common.BaseResponse 2, // 4: topfans.asset.PreCreateMintOrderResponse.order:type_name -> topfans.asset.MintOrder - 33, // 5: topfans.asset.CreateMintOrderResponse.base:type_name -> topfans.common.BaseResponse + 37, // 5: topfans.asset.CreateMintOrderResponse.base:type_name -> topfans.common.BaseResponse 2, // 6: topfans.asset.CreateMintOrderResponse.order:type_name -> topfans.asset.MintOrder 0, // 7: topfans.asset.CreateMintOrderResponse.asset:type_name -> topfans.asset.Asset - 33, // 8: topfans.asset.GetMyAssetsResponse.base:type_name -> topfans.common.BaseResponse - 11, // 9: topfans.asset.GetMyAssetsResponse.items:type_name -> topfans.asset.AssetListItem - 33, // 10: topfans.asset.GetAssetResponse.base:type_name -> topfans.common.BaseResponse - 0, // 11: topfans.asset.GetAssetResponse.asset:type_name -> topfans.asset.Asset - 33, // 12: topfans.asset.GetAssetStatusResponse.base:type_name -> topfans.common.BaseResponse - 33, // 13: topfans.asset.GetMintOrderResponse.base:type_name -> topfans.common.BaseResponse - 2, // 14: topfans.asset.GetMintOrderResponse.order:type_name -> topfans.asset.MintOrder - 0, // 15: topfans.asset.GetMintOrderResponse.asset:type_name -> topfans.asset.Asset - 33, // 16: topfans.asset.CancelMintOrderResponse.base:type_name -> topfans.common.BaseResponse - 33, // 17: topfans.asset.LikeAssetResponse.base:type_name -> topfans.common.BaseResponse - 33, // 18: topfans.asset.UnlikeAssetResponse.base:type_name -> topfans.common.BaseResponse - 33, // 19: topfans.asset.CheckAssetLikeResponse.base:type_name -> topfans.common.BaseResponse - 33, // 20: topfans.asset.GetAssetLikesResponse.base:type_name -> topfans.common.BaseResponse - 26, // 21: topfans.asset.GetAssetLikesResponse.likes:type_name -> topfans.asset.AssetLike - 33, // 22: topfans.asset.GetAssetForRPCResponse.base:type_name -> topfans.common.BaseResponse - 33, // 23: topfans.asset.ClearAssetLikeRecordsResponse.base:type_name -> topfans.common.BaseResponse - 3, // 24: topfans.asset.AssetService.InitMintOrder:input_type -> topfans.asset.InitMintOrderRequest - 6, // 25: topfans.asset.AssetService.PreCreateMintOrder:input_type -> topfans.asset.PreCreateMintOrderRequest - 5, // 26: topfans.asset.AssetService.CreateMintOrder:input_type -> topfans.asset.CreateMintOrderRequest - 9, // 27: topfans.asset.AssetService.GetMyAssets:input_type -> topfans.asset.GetMyAssetsRequest - 12, // 28: topfans.asset.AssetService.GetAsset:input_type -> topfans.asset.GetAssetRequest - 14, // 29: topfans.asset.AssetService.GetAssetStatus:input_type -> topfans.asset.GetAssetStatusRequest - 16, // 30: topfans.asset.AssetService.GetMintOrder:input_type -> topfans.asset.GetMintOrderRequest - 18, // 31: topfans.asset.AssetService.CancelMintOrder:input_type -> topfans.asset.CancelMintOrderRequest - 29, // 32: topfans.asset.AssetService.GetAssetForRPC:input_type -> topfans.asset.GetAssetForRPCRequest - 20, // 33: topfans.asset.AssetService.LikeAsset:input_type -> topfans.asset.LikeAssetRequest - 22, // 34: topfans.asset.AssetService.UnlikeAsset:input_type -> topfans.asset.UnlikeAssetRequest - 24, // 35: topfans.asset.AssetService.CheckAssetLike:input_type -> topfans.asset.CheckAssetLikeRequest - 27, // 36: topfans.asset.AssetService.GetAssetLikes:input_type -> topfans.asset.GetAssetLikesRequest - 31, // 37: topfans.asset.AssetService.ClearAssetLikeRecords:input_type -> topfans.asset.ClearAssetLikeRecordsRequest - 4, // 38: topfans.asset.AssetService.InitMintOrder:output_type -> topfans.asset.InitMintOrderResponse - 7, // 39: topfans.asset.AssetService.PreCreateMintOrder:output_type -> topfans.asset.PreCreateMintOrderResponse - 8, // 40: topfans.asset.AssetService.CreateMintOrder:output_type -> topfans.asset.CreateMintOrderResponse - 10, // 41: topfans.asset.AssetService.GetMyAssets:output_type -> topfans.asset.GetMyAssetsResponse - 13, // 42: topfans.asset.AssetService.GetAsset:output_type -> topfans.asset.GetAssetResponse - 15, // 43: topfans.asset.AssetService.GetAssetStatus:output_type -> topfans.asset.GetAssetStatusResponse - 17, // 44: topfans.asset.AssetService.GetMintOrder:output_type -> topfans.asset.GetMintOrderResponse - 19, // 45: topfans.asset.AssetService.CancelMintOrder:output_type -> topfans.asset.CancelMintOrderResponse - 30, // 46: topfans.asset.AssetService.GetAssetForRPC:output_type -> topfans.asset.GetAssetForRPCResponse - 21, // 47: topfans.asset.AssetService.LikeAsset:output_type -> topfans.asset.LikeAssetResponse - 23, // 48: topfans.asset.AssetService.UnlikeAsset:output_type -> topfans.asset.UnlikeAssetResponse - 25, // 49: topfans.asset.AssetService.CheckAssetLike:output_type -> topfans.asset.CheckAssetLikeResponse - 28, // 50: topfans.asset.AssetService.GetAssetLikes:output_type -> topfans.asset.GetAssetLikesResponse - 32, // 51: topfans.asset.AssetService.ClearAssetLikeRecords:output_type -> topfans.asset.ClearAssetLikeRecordsResponse - 38, // [38:52] is the sub-list for method output_type - 24, // [24:38] is the sub-list for method input_type - 24, // [24:24] is the sub-list for extension type_name - 24, // [24:24] is the sub-list for extension extendee - 0, // [0:24] is the sub-list for field type_name + 37, // 8: topfans.asset.GetMyAssetsResponse.base:type_name -> topfans.common.BaseResponse + 11, // 9: topfans.asset.GetMyAssetsResponse.data:type_name -> topfans.asset.AssetListData + 12, // 10: topfans.asset.AssetListData.groups:type_name -> topfans.asset.AssetGroup + 13, // 11: topfans.asset.AssetGroup.grades:type_name -> topfans.asset.GradeSection + 14, // 12: topfans.asset.AssetGroup.items:type_name -> topfans.asset.AssetItem + 14, // 13: topfans.asset.GradeSection.items:type_name -> topfans.asset.AssetItem + 37, // 14: topfans.asset.GetAssetResponse.base:type_name -> topfans.common.BaseResponse + 0, // 15: topfans.asset.GetAssetResponse.asset:type_name -> topfans.asset.Asset + 37, // 16: topfans.asset.GetAssetStatusResponse.base:type_name -> topfans.common.BaseResponse + 37, // 17: topfans.asset.GetMintOrderResponse.base:type_name -> topfans.common.BaseResponse + 2, // 18: topfans.asset.GetMintOrderResponse.order:type_name -> topfans.asset.MintOrder + 0, // 19: topfans.asset.GetMintOrderResponse.asset:type_name -> topfans.asset.Asset + 37, // 20: topfans.asset.CancelMintOrderResponse.base:type_name -> topfans.common.BaseResponse + 37, // 21: topfans.asset.LikeAssetResponse.base:type_name -> topfans.common.BaseResponse + 37, // 22: topfans.asset.UnlikeAssetResponse.base:type_name -> topfans.common.BaseResponse + 37, // 23: topfans.asset.CheckAssetLikeResponse.base:type_name -> topfans.common.BaseResponse + 37, // 24: topfans.asset.GetAssetLikesResponse.base:type_name -> topfans.common.BaseResponse + 30, // 25: topfans.asset.GetAssetLikesResponse.likes:type_name -> topfans.asset.AssetLike + 37, // 26: topfans.asset.GetAssetForRPCResponse.base:type_name -> topfans.common.BaseResponse + 37, // 27: topfans.asset.ClearAssetLikeRecordsResponse.base:type_name -> topfans.common.BaseResponse + 3, // 28: topfans.asset.AssetService.InitMintOrder:input_type -> topfans.asset.InitMintOrderRequest + 6, // 29: topfans.asset.AssetService.PreCreateMintOrder:input_type -> topfans.asset.PreCreateMintOrderRequest + 5, // 30: topfans.asset.AssetService.CreateMintOrder:input_type -> topfans.asset.CreateMintOrderRequest + 9, // 31: topfans.asset.AssetService.GetMyAssets:input_type -> topfans.asset.GetMyAssetsRequest + 16, // 32: topfans.asset.AssetService.GetAsset:input_type -> topfans.asset.GetAssetRequest + 18, // 33: topfans.asset.AssetService.GetAssetStatus:input_type -> topfans.asset.GetAssetStatusRequest + 20, // 34: topfans.asset.AssetService.GetMintOrder:input_type -> topfans.asset.GetMintOrderRequest + 22, // 35: topfans.asset.AssetService.CancelMintOrder:input_type -> topfans.asset.CancelMintOrderRequest + 33, // 36: topfans.asset.AssetService.GetAssetForRPC:input_type -> topfans.asset.GetAssetForRPCRequest + 24, // 37: topfans.asset.AssetService.LikeAsset:input_type -> topfans.asset.LikeAssetRequest + 26, // 38: topfans.asset.AssetService.UnlikeAsset:input_type -> topfans.asset.UnlikeAssetRequest + 28, // 39: topfans.asset.AssetService.CheckAssetLike:input_type -> topfans.asset.CheckAssetLikeRequest + 31, // 40: topfans.asset.AssetService.GetAssetLikes:input_type -> topfans.asset.GetAssetLikesRequest + 35, // 41: topfans.asset.AssetService.ClearAssetLikeRecords:input_type -> topfans.asset.ClearAssetLikeRecordsRequest + 4, // 42: topfans.asset.AssetService.InitMintOrder:output_type -> topfans.asset.InitMintOrderResponse + 7, // 43: topfans.asset.AssetService.PreCreateMintOrder:output_type -> topfans.asset.PreCreateMintOrderResponse + 8, // 44: topfans.asset.AssetService.CreateMintOrder:output_type -> topfans.asset.CreateMintOrderResponse + 10, // 45: topfans.asset.AssetService.GetMyAssets:output_type -> topfans.asset.GetMyAssetsResponse + 17, // 46: topfans.asset.AssetService.GetAsset:output_type -> topfans.asset.GetAssetResponse + 19, // 47: topfans.asset.AssetService.GetAssetStatus:output_type -> topfans.asset.GetAssetStatusResponse + 21, // 48: topfans.asset.AssetService.GetMintOrder:output_type -> topfans.asset.GetMintOrderResponse + 23, // 49: topfans.asset.AssetService.CancelMintOrder:output_type -> topfans.asset.CancelMintOrderResponse + 34, // 50: topfans.asset.AssetService.GetAssetForRPC:output_type -> topfans.asset.GetAssetForRPCResponse + 25, // 51: topfans.asset.AssetService.LikeAsset:output_type -> topfans.asset.LikeAssetResponse + 27, // 52: topfans.asset.AssetService.UnlikeAsset:output_type -> topfans.asset.UnlikeAssetResponse + 29, // 53: topfans.asset.AssetService.CheckAssetLike:output_type -> topfans.asset.CheckAssetLikeResponse + 32, // 54: topfans.asset.AssetService.GetAssetLikes:output_type -> topfans.asset.GetAssetLikesResponse + 36, // 55: topfans.asset.AssetService.ClearAssetLikeRecords:output_type -> topfans.asset.ClearAssetLikeRecordsResponse + 42, // [42:56] is the sub-list for method output_type + 28, // [28:42] is the sub-list for method input_type + 28, // [28:28] is the sub-list for extension type_name + 28, // [28:28] is the sub-list for extension extendee + 0, // [0:28] is the sub-list for field type_name } func init() { file_asset_proto_init() } @@ -2619,7 +2964,7 @@ func file_asset_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_asset_proto_rawDesc), len(file_asset_proto_rawDesc)), NumEnums: 0, - NumMessages: 33, + NumMessages: 37, NumExtensions: 0, NumServices: 1, }, diff --git a/backend/proto/asset.proto b/backend/proto/asset.proto index fdb51d4..45244e4 100644 --- a/backend/proto/asset.proto +++ b/backend/proto/asset.proto @@ -125,14 +125,50 @@ message GetMyAssetsRequest { // 获取我的藏品列表响应 message GetMyAssetsResponse { topfans.common.BaseResponse base = 1; - repeated AssetListItem items = 2; // 资产列表 - int64 total = 3; // 总数 - int32 page = 4; // 当前页码 - int32 page_size = 5; // 每页数量 - bool has_more = 6; // 是否有更多 + AssetListData data = 2; // 分组后的藏品数据 } -// 资产列表项(简化版,用于列表展示) +// 藏品列表数据(与星册home一致的结构) +message AssetListData { + repeated AssetGroup groups = 1; // 分组列表 + int64 total = 2; // 总数 + int32 page = 3; // 当前页码 + int32 page_size = 4; // 每页数量 + bool has_more = 5; // 是否有更多 +} + +// 资产分组(与星册home一致) +message AssetGroup { + string type = 1; // 'regular' / 'collection' / 'activity' + string category = 2; // 'castlove'(regular) / collection_category / activity_type + string category_name = 3; + repeated GradeSection grades = 4; // 仅 regular 时有效 + repeated AssetItem items = 5; // collection / activity 时有效 + int32 total_count = 6; + bool has_more = 7; +} + +// 等级分组(仅 regular 类型使用) +message GradeSection { + int32 grade = 1; // 等级:1/2/3/4/5... + repeated AssetItem items = 2; + int32 total_count = 3; + bool has_more = 4; +} + +// 资产项(与星册home一致) +message AssetItem { + int64 asset_id = 1; + string name = 2; + string cover_url_signed = 3; // 预签名封面URL + int32 like_count = 4; + int64 created_at = 5; + string category = 6; // regular: 'castlove' / collection: category / activity: activity_type + int32 grade = 7; // 仅 regular 时有效(1/2/3...),其他类型为 0 + int32 display_status = 8; // 展示状态:0=待展示, 1=已展示 +} + +// 资产列表项(简化版,用于列表展示 - 保留兼容) message AssetListItem { int64 asset_id = 1; // 资产ID string name = 2; // 藏品名称 diff --git a/backend/services/assetService/main.go b/backend/services/assetService/main.go index 18549bb..99fb79a 100644 --- a/backend/services/assetService/main.go +++ b/backend/services/assetService/main.go @@ -129,8 +129,8 @@ func main() { logger.Logger.Info("User Service RPC client initialized") // 创建 Service 层实例 - assetService := service.NewAssetService(assetRepo, mintOrderRepo, assetLikeRepo, userClient, database.GetDB()) registryRepo := starbookRepo.NewAssetRegistryRepository(database.GetDB()) + assetService := service.NewAssetService(assetRepo, mintOrderRepo, assetLikeRepo, userClient, database.GetDB(), registryRepo) mintService := service.NewMintService(assetRepo, mintOrderRepo, userClient, database.GetDB(), config.GlobalAssetConfig, registryRepo) assetLikeService := service.NewAssetLikeService(assetRepo, assetLikeRepo, database.GetDB()) rankingService := service.NewRankingService(rankingRepo, userClient) diff --git a/backend/services/assetService/provider/asset_provider.go b/backend/services/assetService/provider/asset_provider.go index b48a71a..1c2688b 100644 --- a/backend/services/assetService/provider/asset_provider.go +++ b/backend/services/assetService/provider/asset_provider.go @@ -212,7 +212,7 @@ func (p *AssetProvider) GetMyAssets(ctx context.Context, req *pb.GetMyAssetsRequ logger.Logger.Debug("GetMyAssets successful", zap.Int64("user_id", userID), zap.Int64("star_id", starID), - zap.Int("count", len(resp.Items)), + zap.Int("count", len(resp.Data.Groups)), ) return resp, nil diff --git a/frontend/pages/exhibition/exhibition.vue b/frontend/pages/exhibition/exhibition.vue index afa1680..7a9bd29 100644 --- a/frontend/pages/exhibition/exhibition.vue +++ b/frontend/pages/exhibition/exhibition.vue @@ -136,18 +136,18 @@ - - + - - + 选择要展出的藏品 - - - - + + - + 原创 + + + 典藏 + + + 活动 + + + + 加载中... + + + + + 暂无藏品 + + + + + + + + + + + + + + + @@ -332,7 +442,54 @@ export default { const selectedSlotIndex = ref(null); const showPlaceConfirmModal = ref(false); const selectedAssetForPlace = ref(null); - const myAssetsList = ref([]); + const myAssetsGroups = ref([]); // 分组后的藏品数据 + const modalLoading = ref(false); // 弹窗内藏品加载状态 + const modalCurrentType = ref('regular'); // 当前选中的类型 + + // 计算当前类型是否有数据 + const modalHasData = computed(() => { + const groups = myAssetsGroups.value; + if (modalCurrentType.value === 'regular') { + const group = groups.find(g => g.type === 'regular'); + return group && group.grades && group.grades.some(g => g.items && g.items.length > 0); + } else if (modalCurrentType.value === 'collection') { + const group = groups.find(g => g.type === 'collection'); + return group && group.items && group.items.length > 0; + } else if (modalCurrentType.value === 'activity') { + const group = groups.find(g => g.type === 'activity'); + return group && group.items && group.items.length > 0; + } + return false; + }); + + // 获取原创藏品的等级分组 + const modalRegularGrades = computed(() => { + const group = myAssetsGroups.value.find(g => g.type === 'regular'); + return group && group.grades ? group.grades : []; + }); + + // 获取典藏藏品列表 + const modalCollectionItems = computed(() => { + const group = myAssetsGroups.value.find(g => g.type === 'collection'); + return group && group.items ? group.items : []; + }); + + // 获取活动藏品列表 + const modalActivityItems = computed(() => { + const group = myAssetsGroups.value.find(g => g.type === 'activity'); + return group && group.items ? group.items : []; + }); + + // grade 中文转换 + const gradeMap = { 1: '一', 2: '二', 3: '三', 4: '四', 5: '五' }; + const formatModalGrade = (grade) => { + return `等级${gradeMap[grade] || grade}`; + }; + + // 切换弹窗内类型 + const switchModalType = (type) => { + modalCurrentType.value = type; + }; // 下架藏品相关状态 const showRemoveConfirmModal = ref(false); @@ -820,28 +977,84 @@ export default { selectedSlotId.value = slot.slot_id; selectedSlotIndex.value = slot.slot_index; - + // 获取用户藏品列表 + modalLoading.value = true; try { const response = await getMyAssetsApi(1, 20); - if (response.code === 200 && response.data && response.data.items) { - const assetsPromises = response.data.items.map(async item => { - const realCoverUrl = await getAssetCoverRealUrl(item.cover_url); - return { - asset_id: item.asset_id, - name: item.name, - image: realCoverUrl, - cover_url: item.cover_url || '/static/nft/collection.png' - }; - }); - myAssetsList.value = await Promise.all(assetsPromises); - - // 显示藏品选择弹窗 + if (response.code === 200 && response.data && response.data.data.groups) { + // 先展示弹窗,再异步处理图片 showAssetSelectModal.value = true; - // 延迟触发动画 setTimeout(() => { assetSelectModalAnimated.value = true; }, 50); + + // 收集所有需要处理的藏品项 + const allItems = []; + const itemRefs = []; + + // 处理分组数据,收集 items 稍后并行处理 + const processedGroups = []; + for (const group of response.data.data.groups) { + const processedGroup = { + type: group.type, + category: group.category, + category_name: group.category_name, + total_count: group.total_count, + has_more: group.has_more, + grades: [], + items: [] + }; + + // 处理 grades + if (group.grades) { + for (const grade of group.grades) { + const processedGrade = { + grade: grade.grade, + total_count: grade.total_count, + has_more: grade.has_more, + items: [] + }; + for (const item of grade.items || []) { + allItems.push(item); + itemRefs.push({ type: 'grade', parent: processedGrade, grade: item.grade, category: null }); + } + processedGroup.grades.push(processedGrade); + } + } + + // 处理 items + if (group.items) { + for (const item of group.items) { + allItems.push(item); + itemRefs.push({ type: 'item', parent: processedGroup, grade: null, category: item.category }); + } + } + + processedGroups.push(processedGroup); + } + + // 并行处理所有封面URL + const coverUrlPromises = allItems.map(item => getAssetCoverRealUrl(item.cover_url_signed)); + const coverUrls = await Promise.all(coverUrlPromises); + + // 将处理好的封面URL填回数据结构 + for (let i = 0; i < allItems.length; i++) { + const item = allItems[i]; + const ref = itemRefs[i]; + const processedItem = { + asset_id: item.asset_id, + name: item.name, + coverUrl: coverUrls[i], + display_status: item.display_status || 0, + like_count: item.like_count, + grade: ref.grade, + category: ref.category + }; + ref.parent.items.push(processedItem); + } + + myAssetsGroups.value = processedGroups; } } catch (error) { console.error('获取藏品列表失败:', error); @@ -850,6 +1063,8 @@ export default { icon: 'none', duration: 2000 }); + } finally { + modalLoading.value = false; } }; @@ -860,7 +1075,7 @@ export default { // 等待动画结束后再隐藏弹窗 setTimeout(() => { showAssetSelectModal.value = false; - myAssetsList.value = []; + myAssetsGroups.value = []; // 重置替换模式状态 if (isReplaceMode.value) { isReplaceMode.value = false; @@ -964,7 +1179,7 @@ export default { assetSelectModalAnimated.value = false; setTimeout(() => { showAssetSelectModal.value = false; - myAssetsList.value = []; + myAssetsGroups.value = []; }, 300); // 清空选中状态 @@ -1100,26 +1315,82 @@ export default { selectedSlotId.value = asset.slot_id; // 获取用户藏品列表 + modalLoading.value = true; try { const response = await getMyAssetsApi(1, 20); - if (response.code === 200 && response.data && response.data.items) { - const assetsPromises = response.data.items.map(async item => { - const realCoverUrl = await getAssetCoverRealUrl(item.cover_url); - return { - asset_id: item.asset_id, - name: item.name, - image: realCoverUrl, - cover_url: item.cover_url || '/static/nft/collection.png' - }; - }); - myAssetsList.value = await Promise.all(assetsPromises); - - // 显示藏品选择弹窗 + if (response.code === 200 && response.data && response.data.data.groups) { + // 先展示弹窗,再异步处理图片 showAssetSelectModal.value = true; - // 延迟触发动画 setTimeout(() => { assetSelectModalAnimated.value = true; }, 50); + + // 收集所有需要处理的藏品项 + const allItems = []; + const itemRefs = []; + + // 处理分组数据,收集 items 稍后并行处理 + const processedGroups = []; + for (const group of response.data.data.groups) { + const processedGroup = { + type: group.type, + category: group.category, + category_name: group.category_name, + total_count: group.total_count, + has_more: group.has_more, + grades: [], + items: [] + }; + + // 处理 grades + if (group.grades) { + for (const grade of group.grades) { + const processedGrade = { + grade: grade.grade, + total_count: grade.total_count, + has_more: grade.has_more, + items: [] + }; + for (const item of grade.items || []) { + allItems.push(item); + itemRefs.push({ type: 'grade', parent: processedGrade, grade: item.grade, category: null }); + } + processedGroup.grades.push(processedGrade); + } + } + + // 处理 items + if (group.items) { + for (const item of group.items) { + allItems.push(item); + itemRefs.push({ type: 'item', parent: processedGroup, grade: null, category: item.category }); + } + } + + processedGroups.push(processedGroup); + } + + // 并行处理所有封面URL + const coverUrlPromises = allItems.map(item => getAssetCoverRealUrl(item.cover_url_signed)); + const coverUrls = await Promise.all(coverUrlPromises); + + // 将处理好的封面URL填回数据结构 + for (let i = 0; i < allItems.length; i++) { + const item = allItems[i]; + const ref = itemRefs[i]; + const processedItem = { + asset_id: item.asset_id, + name: item.name, + coverUrl: coverUrls[i], + display_status: item.display_status || 0, + like_count: item.like_count, + grade: ref.grade, + category: ref.category + }; + ref.parent.items.push(processedItem); + } + + myAssetsGroups.value = processedGroups; } } catch (error) { console.error('获取藏品列表失败:', error); @@ -1131,6 +1402,8 @@ export default { // 重置状态 isReplaceMode.value = false; selectedAssetForRemove.value = null; + } finally { + modalLoading.value = false; } }; @@ -1539,28 +1812,198 @@ export default { flex-shrink: 0; } -/* 藏品网格容器 */ -.modal-nft-grid-container { - flex: 1; - overflow-y: auto; - overflow-x: hidden; - display: grid; - grid-template-columns: repeat(3, 1fr); - column-gap: 15rpx; - row-gap: 10rpx; - align-items: start; - align-content: start; - width: 100%; - max-width: 100%; +/* 弹窗内类型Tab */ +.modal-type-tabs { + display: flex; + justify-content: center; + gap: 40rpx; + padding: 20rpx 30rpx; + z-index: 100; } +.modal-tab-item { + padding: 12rpx 30rpx; + font-size: 28rpx; + color: rgba(255, 255, 255, 0.6); + border-bottom: 4rpx solid transparent; + transition: all 0.3s ease; +} + +.modal-tab-item.active { + color: #ffffff; + border-bottom-color: #ffffff; +} + +/* 弹窗内加载中 */ +.modal-loading-container { + display: flex; + justify-content: center; + align-items: center; + padding-top: 200rpx; +} + +.modal-loading-text { + color: rgba(255, 255, 255, 0.6); + font-size: 28rpx; +} + +/* 弹窗内空状态 */ +.modal-empty-container { + display: flex; + justify-content: center; + align-items: center; + padding-top: 200rpx; +} + +.modal-empty-text { + color: rgba(255, 255, 255, 0.6); + font-size: 28rpx; +} + +/* 弹窗内可滚动区域 */ +.modal-nft-scroll-view { + height: calc(80vh - 200rpx); +} + +/* 隐藏滚动条 */ +.modal-nft-scroll-view::-webkit-scrollbar { + display: none; +} +.modal-nft-scroll-view { + scrollbar-width: none; + -ms-overflow-style: none; +} + +/* 弹窗内藏品列表容器 */ +.modal-nft-list-container { + width: 100%; +} + +/* 弹窗内藏品分组 */ +.modal-nft-group { + margin-bottom: 30rpx; +} + +/* 弹窗内等级区块 */ +.modal-grade-section { + background: rgba(255, 255, 255, 0.03); + border-radius: 16rpx; + padding: 20rpx; +} + +/* 弹窗内分组标题 */ +.modal-group-header { + margin-bottom: 16rpx; + padding-bottom: 10rpx; + border-bottom: 1rpx solid rgba(255, 255, 255, 0.1); +} + +.modal-group-title { + font-size: 26rpx; + color: rgba(255, 255, 255, 0.8); +} + +/* 弹窗内藏品行 - 水平滚动 */ +.modal-nft-row { + width: 100%; + height: 288rpx; + white-space: nowrap; +} + +/* 弹窗内藏品行内容容器 */ +.modal-nft-row-content { + display: inline-block; + white-space: nowrap; + padding-left: 24rpx; + height: 100%; + width: 192rpx; +} + +/* 隐藏滚动条 */ +.modal-nft-row::-webkit-scrollbar { + display: none; +} +.modal-nft-row { + scrollbar-width: none; + -ms-overflow-style: none; +} + +/* 弹窗内藏品网格项 */ .modal-nft-grid-item { position: relative; - width: 100%; - padding-top: 133.33%; + display: inline-block; + vertical-align: top; + margin-right: 32rpx; + height: 100%; +} + +/* 弹窗内NFT图片 */ +.modal-nft-image { + width: 192rpx; + height: 224rpx; + border-radius: 16rpx; + background: rgba(255, 255, 255, 0.05); display: block; } +/* 弹窗内更多项 */ +.modal-nft-grid-item.modal-more-item { + cursor: pointer; +} + +/* 弹窗内藏品信息 */ +.modal-nft-info { + padding: 12rpx 0; + text-align: center; +} + +/* 弹窗内展示状态标签 */ +.modal-status-badge { + position: absolute; + top: 8rpx; + right: 8rpx; + border-radius: 8rpx; + padding: 4rpx 8rpx; + z-index: 1; +} +.modal-status-badge-active { + background: linear-gradient(135deg, #FFD700, #FFA500); + box-shadow: 0 0 12rpx rgba(255, 215, 0, 0.6); +} +.modal-status-badge-pending { + background: rgba(0, 0, 0, 0.6); +} +.modal-status-text { + font-size: 18rpx; + color: #fff; + font-weight: bold; +} + +.modal-nft-name { + display: block; + font-size: 22rpx; + color: rgba(255, 255, 255, 0.9); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +/* 弹窗内更多覆盖层 */ +.modal-more-overlay { + width: 192rpx; + height: 224rpx; + display: flex; + align-items: center; + justify-content: center; + background: rgba(0, 0, 0, 0.5); + border-radius: 16rpx; +} + +.modal-more-text { + font-size: 26rpx; + color: #ffffff; +} + /* 上架确认弹窗遮罩 */ .place-confirm-modal-mask { position: fixed;