diff --git a/src/backend/services/web/strategy_v2/resources.py b/src/backend/services/web/strategy_v2/resources.py index eda40718..2ec56ad3 100644 --- a/src/backend/services/web/strategy_v2/resources.py +++ b/src/backend/services/web/strategy_v2/resources.py @@ -877,6 +877,8 @@ def perform_request(self, validated_request_data): link_table = LinkTable.last_version_link_table(uid) if not link_table: raise Http404(gettext("LinkTable not found: %s") % uid) + # 填充标签 + setattr(link_table, "tags", LinkTableTag.objects.filter(link_table_uid=uid).values_list("tag_id", flat=True)) return link_table diff --git a/src/backend/services/web/strategy_v2/serializers.py b/src/backend/services/web/strategy_v2/serializers.py index 4d489b57..e2e0c130 100644 --- a/src/backend/services/web/strategy_v2/serializers.py +++ b/src/backend/services/web/strategy_v2/serializers.py @@ -707,6 +707,10 @@ class GetLinkTableRequestSerializer(serializers.Serializer): class GetLinkTableResponseSerializer(serializers.ModelSerializer): + tags = serializers.ListField( + label=gettext_lazy("Tags"), child=serializers.IntegerField(label=gettext_lazy("Tag ID")) + ) + class Meta: model = LinkTable fields = "__all__"