Skip to content

Commit

Permalink
feat: 规则审计-联表管理-后端接口 --story=121324647
Browse files Browse the repository at this point in the history
1. 获取联表列表修改 tags 参数校验逻辑
2. 升级依赖包版本 apigw-manager==2.0.0
  • Loading branch information
0RAJA committed Dec 26, 2024
1 parent 33b4f41 commit b494ca7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/backend/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dependencies = [
"opentelemetry-instrumentation-logging==0.41b0",
"django-prometheus==2.2.0",
"numpy==1.24.2",
"apigw-manager==1.1.5",
"apigw-manager==2.0.0",
"openpyxl==3.1.2",
"elasticsearch==7.17.9",
"pypinyin==0.49.0",
Expand Down
2 changes: 1 addition & 1 deletion src/backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is @generated by PDM.
# Please do not edit it manually.

apigw-manager==1.1.5
apigw-manager==2.0.0
arrow==1.2.2
bk-audit[opentelemetry]==1.2.2b0
bk-crypto-python-sdk==1.1.1
Expand Down
12 changes: 8 additions & 4 deletions src/backend/services/web/strategy_v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,14 @@ class Meta:
]


class ListLinkTableRequestSerializer(OrderSerializer):
class TagsReqSerializer(serializers.Serializer):
tags = serializers.CharField(label=gettext_lazy("Tags"), required=False, help_text=gettext_lazy("逗号分隔的标签ID列表"))

def validate_tags(self, tags: str) -> List[int]:
return [int(tag) for tag in tags.split(",") if tag] if tags else []


class ListLinkTableRequestSerializer(OrderSerializer, TagsReqSerializer):
order_field = serializers.ChoiceField(
label=gettext_lazy("排序字段"),
required=False,
Expand All @@ -678,9 +685,6 @@ class ListLinkTableRequestSerializer(OrderSerializer):
name__contains = serializers.CharField(label=gettext_lazy("Link Table Name"), required=False)
updated_by = serializers.CharField(label=gettext_lazy("Updated By"), required=False)
no_tag = serializers.BooleanField(label=gettext_lazy("No Tag"), default=False)
tags = serializers.ListField(
label=gettext_lazy("Tags"), child=serializers.IntegerField(label=gettext_lazy("Tag ID")), required=False
)
uid = serializers.CharField(label=gettext_lazy("Link Table UID"), required=False)


Expand Down

0 comments on commit b494ca7

Please sign in to comment.