baseline: 批次A-D 成果 + membership 半成品(测试红)

This commit is contained in:
agent
2026-09-11 23:11:35 +08:00
commit b3f3095d53
311 changed files with 40540 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
from rest_framework import serializers
from apps.core.serializers import AsyncModelSerializer
from .models import Notification, AlertRule
class NotificationSerializer(AsyncModelSerializer):
category_name = serializers.CharField(source="get_category_display", read_only=True)
class Meta:
model = Notification
fields = [
"id", "title", "content", "category", "category_name",
"link", "is_read", "read_at", "extra_data", "created_at",
]
read_only_fields = ["id", "created_at"]
class AlertRuleSerializer(AsyncModelSerializer):
rule_type_name = serializers.CharField(source="get_rule_type_display", read_only=True)
class Meta:
model = AlertRule
fields = [
"id", "code", "name", "rule_type", "rule_type_name",
"threshold", "is_enabled", "channels", "created_at", "updated_at",
]
read_only_fields = ["id", "created_at", "updated_at"]