前段时间和开发搭建了本地 fastdfs,我一直没用过,正好拿来试用一下
cd /home/chen/PycharmProjects/test3
cp /home/chen/.jenkins/workspace/Build_002_Android_2.0/app/build/outputs/apk/release/*.apk 1111.apk
python3 021_fastdfs.py
from fdfs_client.client import *
import requests
import json
import qrcode
client = Fdfs_client()
ret = client.upload_by_filename('/home/chen/PycharmProjects/test3/1111.apk')
a = ret['Remote file_id']
b = 'http://192.168.0.10:8888/'+a
print(b)
img = qrcode.make(b)
img.save("xx.png")
ret = client.upload_by_filename('/home/chen/PycharmProjects/test3/xx.png')
a = ret['Remote file_id']
b = 'http://192.168.0.10:8888/'+a
print(b)
dingdingurl = 'https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
headers = {"Content-Type": "application/json;"}
payload = {
"msgtype": "link",
"link": {
"text":"这个即将发布的新版本",
"title": "2.0_apk",
"picUrl": "",
"messageUrl": b
}
}
r = requests.post(dingdingurl, data=json.dumps(payload), headers=headers)
print(r.text)