Skip to content

Commit

Permalink
feat: 规则审计-联表管理-后端接口 --story=121324647
Browse files Browse the repository at this point in the history
1. 联表详情增加标签返回
  • Loading branch information
0RAJA committed Dec 26, 2024
1 parent 0667dbf commit af7fc51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/backend/services/web/strategy_v2/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 4 additions & 0 deletions src/backend/services/web/strategy_v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__"
Expand Down

0 comments on commit af7fc51

Please sign in to comment.