1 Star 0 Fork 0

h79/gothird

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
text.go 750 Bytes
一键复制 编辑 原始数据 按行查看 历史
huqiuyun 提交于 2023-07-28 16:16 . 还是把 token 放在这里
package security
import (
"encoding/json"
"fmt"
"gitee.com/h79/gothird/token"
"gitee.com/h79/gothird/weixin/consts"
"gitee.com/h79/gothird/weixin/response"
"gitee.com/h79/goutils/common/http"
)
//POST https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN
func Text(api *token.Api, txt string) error {
uri := fmt.Sprintf("%s/wxa/msg_sec_check?", consts.ApiPrefixUrl)
type content struct {
Content string `json:"content"`
}
c := content{Content: txt}
bu, err := json.Marshal(&c)
if err != nil {
return err
}
res := response.Response{}
return api.Request("POST", uri, bu, func(hp *http.Http, body []byte) error {
if er := json.Unmarshal(body, &res); er != nil {
return er
}
return res.ReturnIf(api)
})
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/h79/gothird.git
git@gitee.com:h79/gothird.git
h79
gothird
gothird
v1.8.52

搜索帮助