当前位置: 首页 > article >正文

golang开发之个微机器人的二次开发

简要描述:

  • 下载消息中的文件

请求URL:

  • http://域名地址/getMsgFile

请求方式:

  • POST

请求头Headers:

  • Content-Type:application/json
  • Authorization:login接口返回

参数:

参数名必选类型说明
wIdstring登录实例标识 包含此参数 所有参数都是从消息回调中取)
msgIdlong消息id
contentstring收到的消息的xml数据

返回数据:

参数名类型说明
codestring1000成功,1001失败
msgstring反馈信息

请求参数示例

<span style="color:#333333"><span style="background-color:#ffffff"><span style="background-color:#f7f8f9"><span style="color:black"><code><span style="color:#999999">{</span>
   <span style="color:#990055">"wId"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"0000016f-a3f4-7ac2-0001-4686486bb6c6"</span><span style="color:#999999">,</span>
   <span style="color:#990055">"msgId"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#990055">1102684150</span><span style="color:#999999">,</span>
   <span style="color:#990055">"content"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"<?xml version=\"1.0\"?><msg><appmsg appid=\"wx6618f1cfc6c132f8\" sdkver=\"0\"><title>下载文件.txt</title><des /><action>view</action><type>6</type><showtype>0</showtype><content /><url /><dataurl /><lowurl /><lowdataurl /><recorditem><![CDATA[]]></recorditem><thumburl /><messageaction /><extinfo /><sourceusername /><sourcedisplayname /><commenturl /><appattach><totallen>6</totallen><attachid>@cdn_304e02010004473045020100020466883f5202032f55f90204260260b402045e1db470042036626464393436656537643431613836623065383665373034396538646566630204010400050201000400_17dd9d048f84c77db909b2161d6dbb09_1</attachid><emoticonmd5></emoticonmd5><fileext>txt</fileext><cdnattachurl>304e02010004473045020100020466883f5202032f55f90204260260b402045e1db470042036626464393436656537643431613836623065383665373034396538646566630204010400050201000400</cdnattachurl><aeskey>17dd9d048f84c77db909b2161d6dbb09</aeskey><encryver>1</encryver></appattach><weappinfo><pagepath /><username /><appid /><appservicetype>0</appservicetype></weappinfo><websearch /><md5>8c8fa3529ee34d4e69a0baafb7069da3</md5></appmsg><fromusername>wxid_lr6j4nononb921</fromusername><scene>0</scene><appinfo><version>7</version><appname>微信电脑版</appname></appinfo><commenturl /></msg>"</span>
<span style="color:#999999">}</span></code></span></span></span></span>

成功返回示例

<span style="color:#333333"><span style="background-color:#ffffff"><span style="background-color:#f7f8f9"><span style="color:black"><code><span style="color:#999999">{</span>
    <span style="color:#990055">"message"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"成功"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"code"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"1000"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"data"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#999999">{</span>
        <span style="color:#990055">"url"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"下载文件.txt"</span>
    <span style="color:#999999">}</span>
<span style="color:#999999">}</span></code></span></span></span></span>

错误返回示例

<span style="color:#333333"><span style="background-color:#ffffff"><span style="background-color:#f7f8f9"><span style="color:black"><code><span style="color:#999999">{</span>
    <span style="color:#990055">"message"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"失败"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"code"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#669900">"1001"</span><span style="color:#999999">,</span>
    <span style="color:#990055">"data"</span><span style="background-color:rgba(255, 255, 255, 0.5)"><span style="color:#9a6e3a">:</span></span> <span style="color:#0077aa">null</span>
<span style="color:#999999">}</span></code></span></span></span></span>

测试地址:https://wkteam.cn/

 


http://www.kler.cn/a/162638.html

相关文章:

  • C++面试基础知识:排序算法 C++实现
  • 半导体企业如何利用 Jira 应对复杂商业变局?
  • 【stable diffusion部署】超强AI绘画Stable Diffusion,本地部署使用教程,完全免费使用
  • 深入解析 OpenHarmony 构建系统-4-OHOSLoader类
  • MyBatisPlus 用法详解
  • 猿创征文|Inscode桌面IDE:打造高效开发新体验
  • 二叉树03-遍历02
  • vuepress-----13、分割config
  • zotero关闭翻译自动创建标签
  • openlayers地图使用---跟随地图比例尺动态标绘大小的一种方式2
  • 身份认证技术
  • leetcode 面试题 02.02. 返回倒数第k个节点
  • 【小布_ORACLE笔记】Part11-6 RMAN Backups
  • 【Flink系列四】Window及Watermark
  • 小白理解GPT的“微调“(fine-tuning)
  • 数据库隔离级别:从并发冲突到数据一致性的演进历程
  • PVE系列-LVM安装MacOS的各个版本及VNC加密隧道访问
  • 二百一十四、Linux——Linux系统时间比电脑时间慢5分钟
  • K8s 入门指南(一):单节点集群环境搭建
  • 【VSCode】自定义配置
  • 元宇宙:重塑游戏行业体验下一个前沿
  • Linux篇之基于Centos的everything镜像搭建yum镜像源
  • 数据库基础概念与范式反范式总结
  • 配置BFD多跳检测示例
  • Remix IDE 快速开始Starknet
  • html之JS