crop

package
v0.0.0-...-9117acc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2022 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONPost

func JSONPost(url string, data interface{}) ([]byte, error)

JSONPost Post请求json数据

Types

type AccessToken

type AccessToken struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	Err
	ExpiresInTime time.Time
}

AccessToken 微信企业号请求Token

type Client

type Client struct {
	CropID      string
	AgentID     int
	AgentSecret string
	Token       AccessToken
}

Client 微信企业号应用配置信息

func New

func New(cropID string, agentID int, AgentSecret string) *Client

New 实例化微信企业号应用

func (*Client) GetAccessToken

func (c *Client) GetAccessToken()

GetAccessToken 获取回话token

func (*Client) Send

func (c *Client) Send(msg Message) error

Send 发送信息

type Content

type Content struct {
	Content string `json:"content"`
}

Content 文本消息内容

type Err

type Err struct {
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

Err 微信返回错误

type Message

type Message struct {
	ToUser  string  `json:"touser"`
	ToParty string  `json:"toparty"`
	ToTag   string  `json:"totag"`
	MsgType string  `json:"msgtype"`
	AgentID int     `json:"agentid"`
	Text    Content `json:"text"`
}

Message 消息主体参数

type Result

type Result struct {
	Err
	InvalidUser  string `json:"invaliduser"`
	InvalidParty string `json:"infvalidparty"`
	InvalidTag   string `json:"invalidtag"`
}

Result 发送消息返回结果

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL