feat: 公告按页、身份标签、拼多多订单号、派单与抢单改造
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user