msg

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBusinessError

func NewBusinessError(err error) error

NewBusinessError 创建业务异常

func NewError

func NewError(code int, err error) error

NewError 根据业务码创建错误实体

func NewSDKError

func NewSDKError(err error) error

NewSDKError 创建SDK异常

Types

type CreateQrcodeResult

type CreateQrcodeResult struct {
	Expires  int    `json:"expires"`
	Code     string `json:"code"`
	ShortUrl string `json:"shortUrl"`
	Url      string `json:"url"`
	Extra    string `json:"extra"`
}

CreateQrcodeResult 创建二维码返回参数

type Error

type Error struct {
	Code  int
	Title string
	Cause error
}

Error 错误实体

func (Error) Error

func (err Error) Error() string

type Message

type Message struct {
	AppToken    string   `json:"appToken"`
	Content     string   `json:"content"`
	Summary     string   `json:"summary"`
	ContentType int      `json:"contentType"`
	TopicIds    []int    `json:"topicIds"`
	UIds        []string `json:"uids"`
	Url         string   `json:"url"`
}

Message 消息

ContentType: 1-文字 2-html

func NewMessage

func NewMessage(appToken string) *Message

NewMessage 使用AppToken创建消息

func (*Message) AddTopicId

func (m *Message) AddTopicId(id int, more ...int) *Message

AddTopicId 添加主题

func (*Message) AddUId

func (m *Message) AddUId(id string, more ...string) *Message

func (Message) Check

func (m Message) Check() error

Check 本地校验消息的正确性

func (*Message) SetContent

func (m *Message) SetContent(content string) *Message

func (*Message) SetContentType

func (m *Message) SetContentType(ct int) *Message

func (*Message) SetSummary

func (m *Message) SetSummary(summary string) *Message

func (*Message) SetUrl

func (m *Message) SetUrl(url string) *Message

type Qrcode

type Qrcode struct {
	AppToken  string `json:"appToken"`
	Extra     string `json:"extra"`
	ValidTime int    `json:"validTime"`
}

Qrcode 生成二维码参数

func (*Qrcode) Check

func (q *Qrcode) Check() error

Check参数校验

type QueryWxUserResult

type QueryWxUserResult struct {
	Total    int      `json:"total"`
	Page     int      `json:"page"`
	PageSize int      `json:"pageSize"`
	Records  []WxUser `json:"records"`
}

QueryWxUserResult 分页查询微信用户返回结果

type Result

type Result struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

Result 接口返回结果

func (*Result) Success

func (r *Result) Success() bool

Success 是否为正确结果

type SendMsgResult

type SendMsgResult struct {
	Uid       string `json:"uid"`
	TopicId   int    `json:"topicId"`
	MessageId int    `json:"messageId"`
	Code      int    `json:"code"`
	Status    string `json:"status"`
}

SendMsgResult 发送消息接口的响应结果

type WxUser

type WxUser struct {
	UId        string `json:"uid"`
	Enable     bool   `json:"enable"`
	CreateTime int64  `json:"createTime"`
	NickName   string `json:"nickName"`
	HeadImg    string `json:"headImg"`
}

WxUser 微信用户

Jump to

Keyboard shortcuts

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