feat: 公告按页、身份标签、拼多多订单号、派单与抢单改造

This commit is contained in:
XingQue
2026-06-25 15:35:51 +08:00
parent d1dc65e13b
commit 9575edcfc4
17 changed files with 646 additions and 15 deletions

View File

@@ -133,6 +133,7 @@ class ClubGonggaoView(APIView):
return Response({'code': 403, 'msg': '无权限管理公告'})
notice_type = int(request.data.get('notice_type', 1) or 1)
page_key = normalize_page_key(request.data.get('page_key'), image_type=1)
club_id = resolve_effective_club_id(request, request.user)
content = request.data.get('content')
@@ -140,8 +141,9 @@ class ClubGonggaoView(APIView):
return Response({
'code': 0,
'data': {
'content': get_gonggao_content(request, notice_type=notice_type),
'content': get_gonggao_content(request, notice_type=notice_type, page_key=page_key),
'notice_type': notice_type,
'page_key': page_key,
**list_response_meta(request),
},
})
@@ -152,12 +154,13 @@ class ClubGonggaoView(APIView):
row, _ = Gonggao.query.get_or_create(
club_id=club_id,
NoticeType=notice_type,
defaults={'Content': content},
page_key=page_key,
defaults={'NoticeType': notice_type, 'Content': content},
)
row.Content = content
row.save(update_fields=['Content', 'UpdateTime'])
return Response({'code': 0, 'msg': '保存成功'})
row.NoticeType = notice_type
row.save(update_fields=['Content', 'NoticeType', 'UpdateTime'])
return Response({'code': 0, 'msg': '保存成功', 'data': {'page_key': page_key}})
class ClubTupianListView(APIView):