Versions in this module Expand all Collapse all v0 v0.0.1 Apr 21, 2021 Changes in this version + const CorpAPI + const CorpAPIAddTagUsers + const CorpAPICheckInGet + const CorpAPIDelTagUsers + const CorpAPIDeptAdd + const CorpAPIDeptDel + const CorpAPIDeptList + const CorpAPIDeptUpdate + const CorpAPIGetApproval + const CorpAPIGetUserOauth + const CorpAPIJsapi + const CorpAPIJscode2session + const CorpAPIMsg + const CorpAPITagAdd + const CorpAPITagDel + const CorpAPITagList + const CorpAPITagUpdate + const CorpAPITagUsers + const CorpAPIToken + const CorpAPIUserAdd + const CorpAPIUserDel + const CorpAPIUserGet + const CorpAPIUserList + const CorpAPIUserSimpleList + const CorpAPIUserUpdate + const CorpApprovalAgentID + const CorpCheckInAgentID + const MPTemplateAdd + const MPTemplateDel + const MPTemplateGetAll + const MPTemplateSendMsg + const MPUserBatchGet + const MPUserGetList + const MPUserInfo + const ParamsQrcode + const PayRoot + const PayUnifiedOrderUrl + const PayUrl + const TypeFile + const TypeImage + const TypeMarkDown + const TypeMpNews + const TypeMusic + const TypeNews + const TypeTaskCard + const TypeText + const TypeTextcard + const TypeVideo + const TypeVoice + const TypeWxCard + const WXAPI + const WXAPIJsapi + const WXAPIJscode2session + const WXAPIMediaGet + const WXAPIMediaGetJssdk + const WXAPIMediaUpload + const WXAPIMenuAdd + const WXAPIMenuDel + const WXAPIMenuGet + const WXAPIMsg + const WXAPIOauth2 + const WXAPIToken + var Debug bool = false + var FetchDelay time.Duration = 5 * time.Minute + var UserServerMap = make(map[string]*Server) + func GetGender(s string) string + func GetOauth2Url(corpId, host string) string + func Printf(s string, v ...interface{}) + func Println(v ...interface{}) + func SetLog(l io.Writer) + type AccessToken struct + AccessToken string + ExpiresIn int64 + type Article struct + Description CDATA + PicUrl CDATA + Title CDATA + Url CDATA + func NewArticle(title, desc, picUrl, url string) Article + type Button struct + AppId string + Key string + Name string + PagePath string + SubButton []struct{ ... } + Type string + Url string + type CDATA string + func (c CDATA) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type Context struct + Msg *WxMsg + Nonce string + Request *http.Request + Resp interface{} + Timestamp string + Writer http.ResponseWriter + func (c *Context) Id() string + func (c *Context) NewFile(mediaId string) *Context + func (c *Context) NewImage(mediaId string) *Context + func (c *Context) NewMpNews(mediaId string) *Context + func (c *Context) NewMusic(mediaId, title, desc, musicUrl, hqMusicUrl string) *Context + func (c *Context) NewNews(arts ...Article) *Context + func (c *Context) NewText(text ...string) *Context + func (c *Context) NewTextcard(title, description, url string) *Context + func (c *Context) NewVideo(mediaId, title, desc string) *Context + func (c *Context) NewVoice(mediaId string) *Context + func (c *Context) Reply() (err error) + func (c *Context) Send() *Context + type Department struct + Id int + Name string + Order1 int64 + ParentId int + type DeptList struct + Department []Department + type DkData struct + CheckinTime int64 + CheckinType string + ExceptionType string + GroupName string + LocationDetail string + LocationTitle string + Notes string + Userid string + WifiMac string + WifiName string + type DkDataRet struct + Result []DkData + type Extattr struct + Name string + Value interface{} + type File struct + File media + type Image struct + Image media + type JsConfig struct + App int + AppId string + Beta bool + Debug bool + JsApiList []string + Nonsestr string + Signature string + Timestamp int64 + Url string + type MarkDown struct + MarkDown struct{ ... } + type Media struct + CreatedAt interface{} + MediaID string + ThumbMediaId string + Type string + type Menu struct + Button []Button + Menu struct{ ... } + type MpArticle struct + Author string + Content string + Digest string + ThumbMediaId string + Title string + Url string + func NewMpArticle(title, mediaId, author, url, content, digest string) MpArticle + type MpNews struct + MpNews struct{ ... } + type MpNewsId struct + MpNews struct{ ... } + type MpTemplate struct + Content string + DeputyIndustry string + Example string + PrimaryIndustry string + TemplateId string + Title string + type MpUser struct + Count int + Data struct{ ... } + NextOpenId string + Total int + type MpUserInfo struct + City string + Country string + GroupId int + HeadImgUrl string + Language string + NickName string + OpenId string + Province string + Remark string + Sex int + Subscribe int + SubscribeTime int + TagIdList []int + UnionId string + type MpUserInfoList struct + MpUserInfoList []MpUserInfo + type MpUserListReq struct + UserList interface{} + type Music struct + Music music + type MyField struct + DateHourValue int64 + Title string + Type string + Value interface{} + type News struct + ArticleCount int + Articles struct{ ... } + type QrcodeParamsReq struct + ActionInfo string + ActionName string + ExpireSeconds int + SceneId string + SceneStr string + type QrcodeParamsResp struct + ExpireSeconds int + Ticket string + Url string + type Server struct + AesKey []byte + AgentId int + AppId string + AppName string + AppType int + DeptList DeptList + EncodingAESKey string + EntMode bool + ExternalTokenHandler func(appId string, appName ...string) *AccessToken + JsApi string + MchId string + MsgQueue chan interface{} + MsgUrl string + RootUrl string + Safe int + SafeMode bool + Secret string + TagList TagList + Token string + TokenUrl string + UserList userList + func New(wc *WxConfig) *Server + func Set(wc *WxConfig) *Server + func (s *Server) AddMenu(m *Menu) (err error) + func (s *Server) AddMsg(v interface{}) + func (s *Server) AddTagUsers(id int, userlist []string, partylist []int) error + func (s *Server) AddTemplate(IdShort string) (id string, err error) + func (s *Server) BatchGet(ul []string) (ui []MpUserInfo, err error) + func (s *Server) BatchGetAll() (ui []MpUserInfo, err error) + func (s *Server) CheckDeptAcl(userid, acl string) bool + func (s *Server) CheckTagAcl(userid, acl string) bool + func (s *Server) CheckUserAcl(userid, acl string) bool + func (s *Server) CreateQrcodeParams(v QrcodeParamsReq) (m QrcodeParamsResp, err error) + func (s *Server) DecryptMsg(msg string) (string, error) + func (s *Server) DelMenu() (err error) + func (s *Server) DelTagUsers(id int, userlist []string) error + func (s *Server) DelTemplate(id string) (err error) + func (s *Server) DeptAdd(dept *Department) (err error) + func (s *Server) DeptDelete(Id int) (err error) + func (s *Server) DeptUpdate(dept *Department) (err error) + func (s *Server) EncryptMsg(msg []byte, timeStamp, nonce string) (re *wxRespEnc, err error) + func (s *Server) FetchUserList() + func (s *Server) GetAccessToken() string + func (s *Server) GetAllCheckIn(opType, start, end int64) (dkdata []DkData, err error) + func (s *Server) GetAllMpUserList() (ul []string, err error) + func (s *Server) GetAllTemplate() (templist []MpTemplate, err error) + func (s *Server) GetApproval(start, end, nextNum int64) (sdr *SpDataRet, err error) + func (s *Server) GetCheckIn(opType, start, end int64, Namelist []string) (dkdata []DkData, err error) + func (s *Server) GetDeptIdList() (deptIdlist []int) + func (s *Server) GetDeptList() (dl DeptList, err error) + func (s *Server) GetDeptName(id int) string + func (s *Server) GetJsConfig(Url string) *JsConfig + func (s *Server) GetJsMedia(filename, mediaId string) error + func (s *Server) GetJsMediaBytes(mediaId string) ([]byte, error) + func (s *Server) GetMedia(filename, mediaId string) error + func (s *Server) GetMediaBytes(mediaId string) ([]byte, error) + func (s *Server) GetMenu() (m *Menu, err error) + func (s *Server) GetMpUserInfo(openid string, lang ...string) (user *MpUserInfo, err error) + func (s *Server) GetMpUserList(openid ...string) (ul *MpUser, err error) + func (s *Server) GetTagId(name string) int + func (s *Server) GetTagIdList() (tagIdlist []int) + func (s *Server) GetTagList() (l TagList, err error) + func (s *Server) GetTagName(id int) string + func (s *Server) GetTagUsers(id int) (tu *TagUsers, err error) + func (s *Server) GetTicket() string + func (s *Server) GetToParty(acl interface{}) string + func (s *Server) GetToTag(acl interface{}) string + func (s *Server) GetToUser(acl interface{}) string + func (s *Server) GetUnifedOrderUrl(desc, tradeNo, fee, ip, callback, tradetype, productid string) string + func (s *Server) GetUser(userid string) *UserInfo + func (s *Server) GetUserAccessToken() string + func (s *Server) GetUserIdList() (userlist []string) + func (s *Server) GetUserInfo(userId string) (user UserInfo, err error) + func (s *Server) GetUserList() (u userList, err error) + func (s *Server) GetUserName(userid string) string + func (s *Server) GetUserOauth(code string) (o UserOauth, err error) + func (s *Server) GetUserSimpleList() (u userList, err error) + func (s *Server) Jscode2Session(code string) (ws *WxSession, err error) + func (s *Server) Jscode2SessionEnt(code string) (ws *WxSession, err error) + func (s *Server) MediaUpload(mediaType string, filename string) (media Media, err error) + func (s *Server) NewFile(to, mediaId string) File + func (s *Server) NewImage(to, mediaId string) Image + func (s *Server) NewMarkDown(to, content string) (md MarkDown) + func (s *Server) NewMpNews(to string, arts ...MpArticle) (news MpNews) + func (s *Server) NewMpNewsId(to string, mediaId string) (news MpNewsId) + func (s *Server) NewMusic(to, mediaId, title, desc, musicUrl, qhMusicUrl string) Music + func (s *Server) NewNews(to string, arts ...Article) (news News) + func (s *Server) NewTaskCard(to, Title, Desc, Url, TaskId, Btn string) (tc TaskCard) + func (s *Server) NewText(to string, msg ...string) Text + func (s *Server) NewTextcard(to, title, description, url string) Textcard + func (s *Server) NewVideo(to, mediaId, title, desc string) Video + func (s *Server) NewVoice(to, mediaId string) Voice + func (s *Server) NewWxCard(to, cardId string) (c WxCard) + func (s *Server) PayOrderScan(mchId, ProductId string) string + func (s *Server) SafeClose() + func (s *Server) SafeOpen() + func (s *Server) SendFile(to string, mediaId string) *WxErr + func (s *Server) SendImage(to string, mediaId string) *WxErr + func (s *Server) SendMarkDown(to string, content string) *WxErr + func (s *Server) SendMpNews(to string, arts ...MpArticle) *WxErr + func (s *Server) SendMpNewsId(to string, mediaId string) *WxErr + func (s *Server) SendMsg(v interface{}) *WxErr + func (s *Server) SendMusic(to string, mediaId, title, desc, musicUrl, qhMusicUrl string) *WxErr + func (s *Server) SendNews(to string, arts ...Article) *WxErr + func (s *Server) SendTaskCard(to string, Title, Desc, Url, TaskId, Btn string) *WxErr + func (s *Server) SendTemplate(to, id, url, appid, pagepath string, data interface{}) *WxErr + func (s *Server) SendText(to, msg string) (e *WxErr) + func (s *Server) SendTextcard(to string, title, desc, url string) *WxErr + func (s *Server) SendVideo(to string, mediaId, title, desc string) *WxErr + func (s *Server) SendVoice(to string, mediaId string) *WxErr + func (s *Server) SyncDeptList() (err error) + func (s *Server) SyncTagList() (err error) + func (s *Server) SyncUserList() (err error) + func (s *Server) TagAdd(Tag *Tag) (err error) + func (s *Server) TagDelete(TagId int) (err error) + func (s *Server) TagUpdate(Tag *Tag) (err error) + func (s *Server) UserAdd(user *UserInfo) (err error) + func (s *Server) UserDelete(user string) (err error) + func (s *Server) UserUpdate(user *UserInfo) (err error) + func (s *Server) VerifyURL(w http.ResponseWriter, r *http.Request) (ctx *Context) + type SpDataRet struct + Count int64 + Data []struct{ ... } + NextSpnum int64 + Total int64 + type Tag struct + TagId int + TagName string + type TagErr struct + InvalidList string + InvalidParty []int + type TagList struct + Taglist []Tag + type TagUserBody struct + PartyList []int + TagId int + UserList []string + type TagUsers struct + PartyList []int + TagId int + TagName string + UserList []UserInfo + type TaskCard struct + TaskCard struct{ ... } + type Text struct + type Textcard struct + Textcard textcard + type Ticket struct + ExpiresIn int64 + Ticket string + type UnifiedOrderReq struct + Appid string + Attach string + Body string + Detail CDATA + DeviceInfo string + FeeType string + GoodsTag string + LimitPay string + MchId string + NonceStr string + NotifyUrl string + Openid string + OutTradeNo string + ProductId string + SceneInfo string + Sign string + SignType string + SpbillCreateIp string + TimeExpire string + TimeStart string + TotalFee string + TradeType string + type UnifiedOrderRet struct + Appid string + CodeUrl string + DeviceInfo string + ErrCode string + ErrCodeDes string + GoodsTag string + LimitPay string + MchId string + NonceStr string + NotifyUrl string + Openid string + PrepayId string + ProductId string + ResultCode string + ReturnCode string + ReturnMsg string + SceneInfo string + Sign string + TimeExpire string + TradeType string + type UserInfo struct + AavatarMediaid string + Alias string + Avatar string + Department []int + Dept int + DeptName string + Email string + Enable int + ExtAttr struct{ ... } + Gender string + IsLeader int + IsLeaderInDept []int + Mobile string + Name string + Order []int + Position string + Status int + Telephone string + ToInvite bool + UserId string + WeixinId string + type UserOauth struct + DeviceId string + OpenId string + UserId string + type Video struct + Video video + type Voice struct + Voice media + type WxCard struct + WxCard struct{ ... } + type WxConfig struct + AgentId int + AppId string + AppName string + AppType int + EncodingAESKey string + ExternalTokenHandler func(string, ...string) *AccessToken + MchId string + Secret string + Token string + type WxErr struct + ErrCode int + ErrMsg string + func (w *WxErr) Error() error + type WxMsg struct + AgentID int + Content string + CreateTime int64 + Description string + Event string + EventKey string + FileKey string + FileMd5 string + FileTotalLen string + Format string + FromUserName string + Label string + LocationX float32 + LocationY float32 + MediaId string + MsgId int64 + MsgType string + PicUrl string + Precision float32 + Recognition string + Scale int + ScanCodeInfo struct{ ... } + SessionFrom string + TaskId string + ThumbMediaId string + Ticket string + Title string + ToUserName string + Url string + XMLName xml.Name + type WxMsgEnc struct + AgentID int + AgentType string + Encrypt string + ToUserName string + XMLName xml.Name + type WxSession struct + CorpId string + OpenId string + SessionKey string + UnionId string + UserId string