Skip to content

Commit 7fcc340

Browse files
committed
♻️ 重构(message.py):改进变量命名,从bastUrl改为bast_url,以符合Python的PEP8命名规范
1 parent fac507e commit 7fcc340

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

dailycheckin/utils/message.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,20 @@ def message2qywxrobot(qywx_key, content):
123123

124124

125125
def message2qywxapp(
126-
qywx_corpid, qywx_agentid, qywx_corpsecret, qywx_touser, qywx_media_id, qywx_origin, content
126+
qywx_corpid,
127+
qywx_agentid,
128+
qywx_corpsecret,
129+
qywx_touser,
130+
qywx_media_id,
131+
qywx_origin,
132+
content,
127133
):
128134
print("企业微信应用消息推送开始")
129-
bastUrl = "https://qyapi.weixin.qq.com"
135+
bast_url = "https://qyapi.weixin.qq.com"
130136
if qywx_origin:
131-
bastUrl = qywx_origin;
137+
bast_url = qywx_origin
132138
res = requests.get(
133-
f"{bastUrl}/cgi-bin/gettoken?corpid={qywx_corpid}&corpsecret={qywx_corpsecret}"
139+
f"{bast_url}/cgi-bin/gettoken?corpid={qywx_corpid}&corpsecret={qywx_corpsecret}"
134140
)
135141
token = res.json().get("access_token", False)
136142
if qywx_media_id:
@@ -164,7 +170,7 @@ def message2qywxapp(
164170
},
165171
}
166172
requests.post(
167-
url=f"{bastUrl}/cgi-bin/message/send?access_token={token}",
173+
url=f"{bast_url}/cgi-bin/message/send?access_token={token}",
168174
data=json.dumps(data),
169175
)
170176
return

0 commit comments

Comments
 (0)