feat: 点单商品审核展示模式可在后台配置

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-06-27 02:53:51 +08:00
parent c26ddfa8d8
commit dd418146dc
5 changed files with 54 additions and 13 deletions

View File

@@ -113,6 +113,7 @@ class XcxSysPeizhiQueryView(APIView):
'weixin_cert_path': row.weixin_cert_path if row else wx_cfg.WEIXIN_CERT_PATH,
'weixin_key_path': row.weixin_key_path if row else wx_cfg.WEIXIN_KEY_PATH,
'notify_base_url': row.notify_base_url if row else wx_cfg.NOTIFY_BASE_URL,
'shangpin_shenhe_mode': row.shangpin_shenhe_mode if row else wx_cfg.SHANGPIN_SHENHE_MODE,
'from_database': bool(row),
}
return Response({'code': 0, 'msg': 'success', 'data': data})
@@ -129,7 +130,7 @@ class XcxSysPeizhiUpdateView(APIView):
'weixin_official_token', 'weixin_official_encoding_aes_key', 'weixin_template_id',
'weixin_template_max_per_minute', 'weixin_template_batch_size', 'weixin_broadcast_enabled',
'weixin_broadcast_workers', 'weixin_mchid', 'weixin_shanghu_miyao', 'weixin_notify_url',
'weixin_cert_path', 'weixin_key_path', 'notify_base_url',
'weixin_cert_path', 'weixin_key_path', 'notify_base_url', 'shangpin_shenhe_mode',
})
def post(self, request):
@@ -149,6 +150,11 @@ class XcxSysPeizhiUpdateView(APIView):
row.weixin_broadcast_enabled = bool(val)
elif key in ('weixin_template_max_per_minute', 'weixin_template_batch_size', 'weixin_broadcast_workers'):
row.__setattr__(key, int(val))
elif key == 'shangpin_shenhe_mode':
mode = int(val)
if mode not in (1, 2):
continue
row.shangpin_shenhe_mode = mode
else:
row.__setattr__(key, str(val).strip())
row.save()