uchatlib

package module
v2.0.0-...-4db9f04 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UchatApiPrefix    string = "http://skyagent.shequnguanjia.com/Merchant.asmx"
	UchatTimeZone     string = "Asia/Shanghai"
	UchatTimeLocation *time.Location
)

Functions

func ApplyRobotAddUser

func ApplyRobotAddUser(robotSerialNo, userWexinId string, client *UchatClient) error

func ConvertUchatMessageToMsgpack

func ConvertUchatMessageToMsgpack(b []byte) ([][]byte, error)

转换Uchat Message数据为Msgpack格式

func SetChatRoomCloseGetMessage

func SetChatRoomCloseGetMessage(chatRoomSerialNo string, client *UchatClient) error

群内时时消息关闭设置

func SetChatRoomOpenGetMessage

func SetChatRoomOpenGetMessage(chatRoomSerialNo string, client *UchatClient) error

群内时时消息开启设置

func SetChatRoomOver

func SetChatRoomOver(chatRoomSerialNo, comment string, client *UchatClient) error

关群调用

Types

type UchatClient

type UchatClient struct {
	MarchantNo     string
	MarchantSecret string
	Error          error
	DefaultTimeout time.Duration
}

小U机器客户端

func NewClient

func NewClient(marchantNo, marchantSecret string) *UchatClient

初始化一个新的实例

func (*UchatClient) ApplyCodeList

func (c *UchatClient) ApplyCodeList(ctx map[string]string) ([]map[string]string, error)

获取验证码

func (*UchatClient) ChatRoomCloseGetMessages

func (c *UchatClient) ChatRoomCloseGetMessages(ctx map[string]string) error

关闭时时群信息

func (*UchatClient) ChatRoomList

func (c *UchatClient) ChatRoomList(ctx map[string]string) ([]map[string]string, error)

获取设备群列表

func (*UchatClient) ChatRoomOpenGetMessages

func (c *UchatClient) ChatRoomOpenGetMessages(ctx map[string]string) error

开启时时群信息

func (*UchatClient) ChatRoomOver

func (c *UchatClient) ChatRoomOver(ctx map[string]string) error

关闭群

func (*UchatClient) ChatRoomStatus

func (c *UchatClient) ChatRoomStatus(ctx map[string]string) (map[string]string, error)

查询群状态接口

func (*UchatClient) ChatRoomUserInfo

func (c *UchatClient) ChatRoomUserInfo(ctx map[string]string) error

发起群会员列表回调

func (*UchatClient) Do

func (c *UchatClient) Do(action string, ctx interface{}) ([]byte, error)

发送请求

func (*UchatClient) RobotAddUser

func (c *UchatClient) RobotAddUser(ctx map[string]string) error

机器人添加用户好友

func (*UchatClient) RobotList

func (c *UchatClient) RobotList() ([]map[string]string, error)

获取设备列表

func (*UchatClient) ScanGlobalResultList

func (c *UchatClient) ScanGlobalResultList(key string, data []byte, err error) ([]map[string]string, error)

全局

func (*UchatClient) SendMessage

func (c *UchatClient) SendMessage(ctx map[string]interface{}) error

群推送消息

func (*UchatClient) Sign

func (c *UchatClient) Sign(strCtx string) string

签名信息

type UchatClientGlobalResultList

type UchatClientGlobalResultList map[string]interface{}

type UchatClientResult

type UchatClientResult struct {
	Result string        `json:"nResult"`
	Error  string        `json:"vcResult"`
	Data   []interface{} `json:"data"`
}

小U机器接口返回格式

type UchatKeyword

type UchatKeyword struct {
	LogSerialNo        string
	ChatRoomSerialNo   string
	FromWxUserSerialNo string
	ToWxUserSerialNo   string
	Content            string
	ExtraData          interface{} //补充数据,并非接口返回
}

keyword msgpack

func ConvertUchatKeyword

func ConvertUchatKeyword(b []byte) ([]*UchatKeyword, error)

type UchatMessage

type UchatMessage struct {
	MerchantNo       string
	LogSerialNo      string
	ChatRoomSerialNo string
	WxUserSerialNo   string
	MsgTime          time.Time
	MsgType          int32
	Content          string
	VoiceTime        int32
	ShareTitle       string
	ShareDesc        string
	ShareUrl         string
	ExtraData        interface{} //补充数据,并非接口返回
}

func ConvertUchatMessage

func ConvertUchatMessage(b []byte) ([]*UchatMessage, error)

Jump to

Keyboard shortcuts

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