Răsfoiți Sursa

获取订阅关键词、修改用户订阅设置(超级订阅用户)

liuyali@topnet.net.cn 1 săptămână în urmă
părinte
comite
ab2f6fb65f

+ 14 - 0
cases/pc/登录功能/订阅/getkey_member.py

@@ -0,0 +1,14 @@
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '获取超级订阅订阅关键词'
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.getkey_member()
+        actual = res.json()
+        error_code = actual["error_code"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查获取超级订阅订阅关键词是否正常',error_code == 0)

+ 26 - 0
cases/pc/登录功能/订阅/subscription_setting_update.py

@@ -0,0 +1,26 @@
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    name = '修改用户订阅设置'
+    def setup(self):
+        INFO('切换用户身份到个人身份下')
+        apimgr.Identity_list(8)
+        apimgr.Identity_switch()
+
+    def teardown(self):
+        INFO('将用户切回到闫培珠新版商机管理企业')
+        apimgr.Identity_list(1)
+        apimgr.Identity_switch()
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1, '第一步调用函数')
+        res = apimgr.subscription_setting_update()
+        actual = res.json()
+        INFO(actual)
+        error_code = actual["error_code"]
+        status = actual["data"]["status"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('检查修改用户订阅设置是否正常',error_code == 0 and status == 1)
+
+

+ 91 - 0
lib/webapi.py

@@ -2046,6 +2046,97 @@ class APIMgr():
         }
         response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/setUser", headers=headers, json=json)
         return response
+    #获取订阅关键词-超级订阅用户
+    def getkey_member(self):
+        headers = GSTORE['headers']
+        data = {
+            "isEnt": "false",
+            "ent_buy_member": 0,
+            "ent_buy_vip": 0,
+            "powerSource": 0,
+            "userPower": 0
+        }
+        response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/vType/getKey", headers=headers, data=data)
+        return response
+    #修改用户订阅设置-超级订阅用户
+    def subscription_setting_update(self, area_data=None):
+        # 设置默认的地区数据
+        if area_data is None:
+            #area_data = {"河南": ["郑州市","开封市"]}
+            area_data = {"河南": []}
+        headers = GSTORE['headers']
+        json = {
+    "area": area_data,
+    "buyerclass": [
+        "财政"
+    ],
+    "infotype": [
+        "预告"
+    ],
+    "items": [
+        {
+            "a_key": [
+                {
+                    "key": [
+                        "交通设施"
+                    ],
+                    "matchway": 1,
+                    "updatetime": 1741260363
+                },
+                {
+                    "key": [
+                        "外工程"
+                    ],
+                    "matchway": 1,
+                    "updatetime": 1741260363
+                },
+                {
+                    "key": [
+                        "化工用品包装材料"
+                    ],
+                    "matchway": 1,
+                    "updatetime": 1741260363
+                },
+                {
+                    "key": [
+                        "机电设备"
+                    ],
+                    "matchway": 1,
+                    "updatetime": 1741260363
+                },
+                {
+                    "key": [
+                        "广告传媒"
+                    ],
+                    "matchway": 1,
+                    "updatetime": 1741260363
+                },
+                {
+                    "key": [
+                        "餐饮服务"
+                    ],
+                    "matchway": 1,
+                    "updatetime": 1741260363
+                }
+            ],
+            "opened": "true",
+            "s_item": "未分类",
+            "updatetime": 1741260363
+        }
+    ],
+    "ratemode": "1",
+    "projectmatch": "1",
+    "matchway": "1",
+    "apppush": "1",
+    "mailpush": "0",
+    "mail": "1@qq.com",
+    "amount": "0-10",
+    "matchmode": "title",
+    "iSwitch": 1
+}
+        response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/vType/update", headers=headers, json=json)
+        return response
+