Documentation ¶
Index ¶
- Constants
- Variables
- func BuildRedirectUrl(corpid string, agentid int, redirectURI, level, state string) string
- func CreateAuthCorpContext(suit *WxCorpSuite, corpId string) *wxAuthCorpcontext
- func GetCurrTs() int64
- func HTTPGet(uri string) ([]byte, error)
- func MakeSignatureForJs(token string, timestamp, nonce string) string
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(plantText []byte, blockSize int) []byte
- func PostToWx(theUrl string, data interface{}, result interface{}) error
- func RandomStr(length int) string
- func Signature(params ...string) string
- type AES
- type ApprovalNotify
- type AuthInfo
- type Config
- type CorpAccessToken
- type CorpAccessTokenQuery
- type CorpAdminInfo
- type CorpAgentInfo
- type CorpApplicationHandle
- type CorpAuthInfo
- type CorpAuthInfoResult
- type CorpAuthMsg
- type CorpChangeContact
- type CorpChangeDepart
- type CorpChangeMsg
- type CorpChangeTag
- type CorpContactItem
- type CorpDataStage
- type CorpEncrypt
- func (this *CorpEncrypt) DecryptInputMsg(msg_signature, timestamp, nonce string, postdata CorpInputputMessage) (int, string)
- func (this *CorpEncrypt) DecryptMsg(msg_signature, timestamp, nonce, postdata string) (int, string)
- func (this *CorpEncrypt) EncryptMsg(replyMsg, nonce, timestamp string) (int, string)
- func (this *CorpEncrypt) Init(token, corpid, suiteid, aeskey string)
- func (this *CorpEncrypt) VerifyURL(msg_signature, timestamp, nonce, echostr string) (int, string)
- type CorpInputputMessage
- type CorpOrgChangeHandle
- type CorpOutputMessage
- type CorpPermanentAuth
- type CorpPermanentCodeQuery
- type CorpPrivateAccessToken
- type CorpTickMsg
- type Js
- type LoginInfo
- type MessageReplyHandle
- type ReplyMessage
- type ResAccessToken
- type SuiteAccessToken
- type SuitePreAuthCode
- type SuiteSessionInfo
- type SuiteTokenQuery
- type ToAddress
- type WXMsgType
- type WxApproval
- type WxApprovalApi
- type WxAuthCorpApi
- type WxBaseApplicationHold
- func (this *WxBaseApplicationHold) GetCheckInAPI() *WxCheckInApi
- func (this *WxBaseApplicationHold) GetMessageApi() *WxSendMessageApi
- func (this *WxBaseApplicationHold) Init(corp, checkInSecret, approvalSecret, messageSecret string)
- func (this *WxBaseApplicationHold) Run(second int64, notify ApprovalNotify)
- type WxCheckInApi
- type WxContactApi
- type WxCorpConfig
- type WxCorpSuite
- func (this *WxCorpSuite) GetAuthCorpApi() WxAuthCorpApi
- func (this *WxCorpSuite) GetAuthCorpContext(corpid string) *wxAuthCorpcontext
- func (this *WxCorpSuite) GetCorpAccessToken(corpId, permanentCode string) CorpAccessToken
- func (this *WxCorpSuite) GetLoginInfo(code string) *LoginInfo
- func (this *WxCorpSuite) GetPermanentCode(authCode string) bool
- func (this *WxCorpSuite) HandleInputMessage(p interface{}) (interface{}, mvc.BingoError)
- func (this *WxCorpSuite) HandleValidateMessage(p interface{}) (interface{}, mvc.BingoError)
- func (this *WxCorpSuite) Init(config *WxCorpConfig, stage CorpDataStage)
- func (this *WxCorpSuite) RefreshPreAuthCode()
- func (this *WxCorpSuite) RefreshSuiteToken()
- func (this *WxCorpSuite) SetHandle(app CorpApplicationHandle, contact CorpOrgChangeHandle)
- func (this *WxCorpSuite) SetReplyHandle(handle MessageReplyHandle)
- func (this *WxCorpSuite) SetSessionInfo(apps []string, authType int) bool
- type WxDepart
- type WxMediaManager
- type WxPayApi
- type WxRedirectParamter
- type WxSendMessageApi
- type WxSuitInputMsg
- type WxTag
- type WxUser
- type WxUserDetail
- type WxValidateRequest
- type WxcheckinItem
Constants ¶
const ( CONTACT_DEPARTMENT_API = "https://qyapi.weixin.qq.com/cgi-bin/department/%s?access_token=%s&id=%s" CONTACT_DEPARTMENT_USERLIST_API = "https://qyapi.weixin.qq.com/cgi-bin/user/list?access_token=%s&department_id=%d&fetch_child=%d" )
* 通讯录组织机构管理
const ( WXAPI_HEADER = "https://qyapi.weixin.qq.com/cgi-bin/service/" CATALOG_PERMANENT = "PermanentCode" )
const ( Block_size = 32 BASE_STRING = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" )
* 40001 签名验证错误 40002 xml解析失败 40003 sha加密生成签名失败 40004 AESKey 非法 40005 corpid 校验错误 40006 AES 加密失败 40007 AES 解密失败 40008 解密后得到的buffer非法
const ( SEND_MSG_API = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s" MSG_TO_ALL = 0 MSG_TO_USER = 1 MSG_TO_PARTY = 2 MSG_TO_TAG = 3 )
const ( CORP_ACCESSTOKEN_API = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s" APPROVAL_API = "https://qyapi.weixin.qq.com/cgi-bin/corp/getapprovaldata?access_token=%s" CHECKIN_API = "https://qyapi.weixin.qq.com/cgi-bin/checkin/getcheckindata?access_token=%s" )
const ( OAUTH_SERVICE_API = "" /* 140-byte string literal not displayed */ USER_DETAIL_API = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserdetail?access_token=%s" USER_INFO_API = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=%s&code=%s" /* 应用授权作用域。 snsapi_base:静默授权,可获取成员的基础信息; snsapi_userinfo:静默授权,可获取成员的详细信息,但不包含手机、邮箱; snsapi_privateinfo:手动授权,可获取成员的详细信息,包含手机、邮箱。 */ OAUTH_LEVEL_BASE = "snsapi_base" OAUTH_LEVEL_INFO = "snsapi_userinfo" OAUTH_LEVEL_DETAIL = "snsapi_privateinfo" )
const ( OPEN_USER_API = "https://qyapi.weixin.qq.com/cgi-bin/user/convert_to_userid?access_token=%s" USER_OPEN_API = " https://qyapi.weixin.qq.com/cgi-bin/user/convert_to_openid?access_token=%s" )
const ( UPLOAD_MEDIA_API = "https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=%s&type=%s" DOWNLOAD_MEDIA_API = "https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=%s&media_id=%s" )
上传下载临时素材
const AccessTokenURL = "https://api.weixin.qq.com/cgi-bin/token"
Variables ¶
var (
CHARS []byte = []byte("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
)
Functions ¶
func BuildRedirectUrl ¶
func CreateAuthCorpContext ¶
func CreateAuthCorpContext(suit *WxCorpSuite, corpId string) *wxAuthCorpcontext
func MakeSignatureForJs ¶
func PKCS7Padding ¶
---------------------------PKCS7-----------------------------//
func PKCS7UnPadding ¶
Types ¶
type ApprovalNotify ¶
type ApprovalNotify interface {
NotifyApproval(approval *WxApproval) //单据通知
}
申请单通知接口
type AuthInfo ¶
type AuthInfo struct {
Agents []CorpAgentInfo `json:"agent"` //授权的应用信息
}
type Config ¶
type Config struct { AppID string `json:"appId"` Timestamp int64 `json:"timestamp"` NonceStr string `json:"nonceStr"` Signature string `json:"signature"` }
Config 返回给用户jssdk配置信息
type CorpAccessToken ¶
type CorpAccessTokenQuery ¶
type CorpAdminInfo ¶
type CorpAdminInfo struct { Email string `json:"email"` //授权管理员的邮箱,可能为空(外部管理员一定有,不可更改) Mobile string `json:"mobile"` //授权管理员的手机号,可能为空(内部管理员一定有,可更改) Userid string `json:"userid"` //授权管理员的userid,可能为空(内部管理员一定有,不可更改) Name string `json:"name"` //授权管理员的name,可能为空(内部管理员一定有,不可更改) Avatar string `json:"avatar"` //授权管理员的头像url }
授权管理员的信息
type CorpAgentInfo ¶
type CorpAgentInfo struct { Agentid string `json:"agentid"` //授权方应用id Name string `json:"name"` //授权方应用名字 SquareLogo string `json:"square_logo_url"` //授权方应用方形头像 Appid string `json:"appid"` //服务商套件中的对应应用id Privilege string `json:"privilege"` //应用对应的权限 AllowParty []string `json:"allow_party"` //应用可见范围(部门) AllowTag []string `json:"allow_tag"` //应用可见范围(标签) AllowUser []string `json:"allow_user"` //应用可见范围(成员) ExtraParty []string `json:"extra_party"` //额外通讯录(部门) ExtraUser []string `json:"extra_user"` //额外通讯录(成员) ExtraTag []string `json:"extra_tag"` //额外通讯录(标签) Level int `json:"email"` //权限等级。1:通讯录基本信息只读2:通讯录全部信息只读3:通讯录全部信息读写4:单个基本信息只读5:通讯录全部信息只写 // contains filtered or unexported fields }
type CorpApplicationHandle ¶
type CorpApplicationHandle interface { //新授权应用 NewCorp(corp CorpAuthInfo, agents []CorpAgentInfo, admin CorpAdminInfo) //更新授权 UpdateAuth(corp CorpAuthInfo, agents []CorpAgentInfo) //删除授权 DeleteAuth(corpid string) }
应用授权的handle
type CorpAuthInfo ¶
type CorpAuthInfo struct { Id string `json:"corpid"` //授权方企业微信id Name string `json:"corp_name"` // 授权方企业微信名称 Type string `json:"corp_type"` // 授权方企业微信类型,认证号:verified, 注册号:unverified Logo string `json:"corp_square_logo_url"` //授权方企业微信方形头像 UserMax int `json:"corp_user_max"` //授权方企业微信用户规模 AgentMax int `json:"corp_agent_max"` FullName string `json:"corp_full_name"` //所绑定的企业微信主体名称 SubjectType int `json:"subject_type"` //企业类型,1. 企业; 2. 政府以及事业单位; 3. 其他组织, 4.团队号 Wxqrcode string `json:"corp_wxqrcode"` //授权方企业微信二维码 VerifiedEndTime time.Duration `json:"verified_end_time"` //认证到期时间 }
授权企业信息
type CorpAuthInfoResult ¶
type CorpAuthInfoResult struct { Corpinfo CorpAuthInfo `json:"auth_corp_info"` //授权方企业信息 Agents AuthInfo `json:"auth_info"` //授权的应用信息 }
type CorpAuthMsg ¶
type CorpAuthMsg struct { XMLName xml.Name `xml:"xml"` AuthCode string `xml:"AuthCode"` // contains filtered or unexported fields }
授权成功通知
type CorpChangeContact ¶
type CorpChangeContact struct { XMLName xml.Name `xml:"xml"` CorpChangeMsg UserID string NewUserID string Name string Department string Mobile string Position string Gender int Email string Status int Avatar string EnglishName string IsLeader int Telephone string ExtAttr []CorpContactItem `xml:"ExtAttr>Item"` }
通讯录员工变更事件
type CorpChangeDepart ¶
type CorpChangeDepart struct { XMLName xml.Name `xml:"xml"` CorpChangeMsg DepartId int64 `xml:"Id"` DepartName string `xml:"Name"` DepartParent int64 `xml:"ParentId"` DepartOrder int64 `xml:"Order"` }
变更部门信息
type CorpChangeMsg ¶
type CorpChangeMsg struct { XMLName xml.Name `xml:"xml"` ChangeType string CorpId string `xml:"AuthCorpId"` // 授权方的corpid // contains filtered or unexported fields }
变更授权通知:包括取消授权type:cancel_auth取消授权change_auth授权变更
type CorpChangeTag ¶
type CorpChangeTag struct { XMLName xml.Name `xml:"xml"` CorpChangeMsg TagId string //标签Id AddUserItems []string // 标签中新增的成员userid列表,用逗号分隔 DelUserItems []string // 标签中删除的成员userid列表,用逗号分隔 AddPartyItems []string // 标签中新增的部门id列表,用逗号分隔 DelPartyItems []string // 标签中删除的部门id列表,用逗号分隔 }
标签变更事件
type CorpContactItem ¶
type CorpDataStage ¶
type CorpDataStage interface { SaveCode(catalog, corpId, code string) //保存code GetCode(catalog, corpId string) string //获取保存的Code }
企业token等信息存储
type CorpEncrypt ¶
type CorpEncrypt struct {
// contains filtered or unexported fields
}
func (*CorpEncrypt) DecryptInputMsg ¶
func (this *CorpEncrypt) DecryptInputMsg(msg_signature, timestamp, nonce string, postdata CorpInputputMessage) (int, string)
func (*CorpEncrypt) DecryptMsg ¶
func (this *CorpEncrypt) DecryptMsg(msg_signature, timestamp, nonce, postdata string) (int, string)
func (*CorpEncrypt) EncryptMsg ¶
func (this *CorpEncrypt) EncryptMsg(replyMsg, nonce, timestamp string) (int, string)
func (*CorpEncrypt) Init ¶
func (this *CorpEncrypt) Init(token, corpid, suiteid, aeskey string)
func (*CorpEncrypt) VerifyURL ¶
func (this *CorpEncrypt) VerifyURL(msg_signature, timestamp, nonce, echostr string) (int, string)
*
#验证URL #@param sMsgSignature: 签名串,对应URL参数的msg_signature #@param sTimeStamp: 时间戳,对应URL参数的timestamp #@param sNonce: 随机串,对应URL参数的nonce #@param sEchoStr: 随机串,对应URL参数的echostr #@param sReplyEchoStr: 解密之后的echostr,当return返回0时有效 #@return:成功0,失败返回对应的错误码
type CorpInputputMessage ¶
type CorpInputputMessage struct { XMLName xml.Name `xml:"xml"` ToUserName string AgentID string Encrypt string }
接收到企业微信服务端的消息
type CorpOrgChangeHandle ¶
type CorpOrgChangeHandle interface { //新增部门 AddDepart(corpid string, depart WxDepart) //更新部门 UpdateDepart(corpid string, depart WxDepart) //删除部门 DeleteDepart(corpid string, depart int64) //更新标签 UpdateTag(corpid string, tag WxTag) //新增员工 AddEmployee(corpid string, user WxUser) //更新员工 UpdateEmployee(corpid string, user WxUser) //删除员工 DeleteEmployee(corpid string, userId string) }
组织通讯录表换授权
type CorpOutputMessage ¶
type CorpOutputMessage struct { XMLName xml.Name `xml:"xml"` Encrypt string MsgSignature string TimeStamp string Nonce string }
输出给企业微信服务端的消息
type CorpPermanentAuth ¶
type CorpPermanentAuth struct { AccessToken string `json:"access_token"` //授权方(企业)access_token,最长为512字节 Expires int `json:"expires_in"` //授权方(企业)access_token超时时间 PermanentCode string `json:"permanent_code"` //企业微信永久授权码,最长为512字节 Corpinfo CorpAuthInfo `json:"auth_corp_info"` //授权方企业信息 Agents AuthInfo `json:"auth_info"` //授权的应用信息 Admin CorpAdminInfo `json:"auth_user_info"` //授权管理员的信息 }
企业永久授权码
type CorpPermanentCodeQuery ¶
type CorpPermanentCodeQuery struct { AuthCode string `json:"auth_code"` // contains filtered or unexported fields }
永久授权码查询
type CorpPrivateAccessToken ¶
type CorpPrivateAccessToken struct { UpdateTime time.Time CorpAccessToken }
企业自身使用的accesstoken
type CorpTickMsg ¶
type CorpTickMsg struct { XMLName xml.Name `xml:"xml"` Ticket string `xml:"SuiteTicket"` // contains filtered or unexported fields }
推送suite_ticket
type Js ¶
Js struct
func (*Js) GetAccessToken ¶
func (*Js) GetAccessTokenFromServer ¶
func (js *Js) GetAccessTokenFromServer() (resAccessToken ResAccessToken, err error)
GetAccessTokenFromServer 强制从微信服务器获取token
type LoginInfo ¶
type LoginInfo struct { UserType int64 `json:"usertype"` User WxUserDetail `json:"user_info"` Corp corpInfo `json:"corp_info"` Auth authInfo `json:"auth_info"` Agent []agentInfo `json:"agent"` // contains filtered or unexported fields }
type MessageReplyHandle ¶
type MessageReplyHandle interface {
ReplyMsg(t WXMsgType, content string, url string, ext string) *ReplyMessage
}
被动消息处理的handle
type ReplyMessage ¶
type ResAccessToken ¶
type ResAccessToken struct { AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` // contains filtered or unexported fields }
ResAccessToken struct
type SuiteAccessToken ¶
type SuiteAccessToken struct { AccessToken string `json:"suite_access_token"` // contains filtered or unexported fields }
type SuitePreAuthCode ¶
type SuitePreAuthCode struct { AuthCode string `json:"pre_auth_code"` // contains filtered or unexported fields }
type SuiteSessionInfo ¶
type SuiteSessionInfo struct { AuthCode string `json:"pre_auth_code"` Info sessionInfo }
type SuiteTokenQuery ¶
type ToAddress ¶
type ToAddress struct { ToAll bool //是否给所有人发送 ToUser []string //接收人 ToParty []string //接收部分 ToTag []string //接收的tag }
微信目的地址
type WxApproval ¶
type WxApproval struct { SpName string `json:"spname"` //单据名称 ApplyName string `json:"apply_name"` //申请人姓名 ApplyOrg string `json:"apply_org"` //申请人部门 ApprovalNames []string `json:"approval_name"` //审批人姓名 NotifyNames []string `json:"notify_name"` //抄送人姓名 SpStatus int `json:"sp_status"` //审批状态:1审批中;2 已通过;3已驳回;4已取消 SpId int64 `json:"sp_num"` //审批单号 ApplyTime int64 `json:"apply_time"` //审批单提交时间 ApplyUser string `json:"apply_user_id"` //审批单提交者的userid Leave wxLeave `json:"leave"` //请假 Expense wxExpense `json:"expense"` //报销 Comm wxApprovalCustom `json:"comm"` //审批模板信息 Medias []string `json:"mediaids"` //审批的附件media_id,可使用media/get获取附件 }
type WxApprovalApi ¶
type WxApprovalApi struct { Notify ApprovalNotify //监听通知 // contains filtered or unexported fields }
func (*WxApprovalApi) Run ¶
func (this *WxApprovalApi) Run(second int64)
type WxAuthCorpApi ¶
type WxAuthCorpApi interface { WxOauthGetUser(app string, corp string, agent int, p WxRedirectParamter) WxUserDetail WxInitContact(corp string) }
type WxBaseApplicationHold ¶
type WxBaseApplicationHold struct {
// contains filtered or unexported fields
}
-------------------------------------------------------------
用于hold用户企业的sercret
--------------------------------------------------------------
func (*WxBaseApplicationHold) GetCheckInAPI ¶
func (this *WxBaseApplicationHold) GetCheckInAPI() *WxCheckInApi
func (*WxBaseApplicationHold) GetMessageApi ¶
func (this *WxBaseApplicationHold) GetMessageApi() *WxSendMessageApi
func (*WxBaseApplicationHold) Init ¶
func (this *WxBaseApplicationHold) Init(corp, checkInSecret, approvalSecret, messageSecret string)
func (*WxBaseApplicationHold) Run ¶
func (this *WxBaseApplicationHold) Run(second int64, notify ApprovalNotify)
type WxCheckInApi ¶
type WxCheckInApi struct {
// contains filtered or unexported fields
}
获取打卡记录
func (*WxCheckInApi) QueryCheckInByAll ¶
func (this *WxCheckInApi) QueryCheckInByAll(start, end int64, users []string) []WxcheckinItem
func (*WxCheckInApi) QueryCheckInByOut ¶
func (this *WxCheckInApi) QueryCheckInByOut(start, end int64, users []string) []WxcheckinItem
func (*WxCheckInApi) QueryCheckInByWork ¶
func (this *WxCheckInApi) QueryCheckInByWork(start, end int64, users []string) []WxcheckinItem
type WxContactApi ¶
type WxContactApi struct {
// contains filtered or unexported fields
}
func (*WxContactApi) GetDepartmentList ¶
func (this *WxContactApi) GetDepartmentList() contactDepartList
获取权限下的所有部门列表
func (*WxContactApi) GetDepartmentUserList ¶
func (this *WxContactApi) GetDepartmentUserList(depid int64) contactUserList
取某部门下的员工详情列表,不递归取部门下的子部门成员
type WxCorpConfig ¶
type WxCorpSuite ¶
type WxCorpSuite struct {
// contains filtered or unexported fields
}
*
访问获取token时候返回的消息
func (*WxCorpSuite) GetAuthCorpApi ¶
func (this *WxCorpSuite) GetAuthCorpApi() WxAuthCorpApi
func (*WxCorpSuite) GetAuthCorpContext ¶
func (this *WxCorpSuite) GetAuthCorpContext(corpid string) *wxAuthCorpcontext
func (*WxCorpSuite) GetCorpAccessToken ¶
func (this *WxCorpSuite) GetCorpAccessToken(corpId, permanentCode string) CorpAccessToken
获取授权企业的访问token
func (*WxCorpSuite) GetLoginInfo ¶
func (this *WxCorpSuite) GetLoginInfo(code string) *LoginInfo
根据auth code 获取登录信息
func (*WxCorpSuite) GetPermanentCode ¶
func (this *WxCorpSuite) GetPermanentCode(authCode string) bool
func (*WxCorpSuite) HandleInputMessage ¶
func (this *WxCorpSuite) HandleInputMessage(p interface{}) (interface{}, mvc.BingoError)
正常的访问消息处理
func (*WxCorpSuite) HandleValidateMessage ¶
func (this *WxCorpSuite) HandleValidateMessage(p interface{}) (interface{}, mvc.BingoError)
func (*WxCorpSuite) Init ¶
func (this *WxCorpSuite) Init(config *WxCorpConfig, stage CorpDataStage)
func (*WxCorpSuite) RefreshPreAuthCode ¶
func (this *WxCorpSuite) RefreshPreAuthCode()
func (*WxCorpSuite) RefreshSuiteToken ¶
func (this *WxCorpSuite) RefreshSuiteToken()
func (*WxCorpSuite) SetHandle ¶
func (this *WxCorpSuite) SetHandle(app CorpApplicationHandle, contact CorpOrgChangeHandle)
func (*WxCorpSuite) SetReplyHandle ¶
func (this *WxCorpSuite) SetReplyHandle(handle MessageReplyHandle)
func (*WxCorpSuite) SetSessionInfo ¶
func (this *WxCorpSuite) SetSessionInfo(apps []string, authType int) bool
type WxMediaManager ¶
type WxMediaManager struct { }
type WxPayApi ¶
type WxPayApi struct {
// contains filtered or unexported fields
}
func (*WxPayApi) ConvertOpenIdToUserId ¶
openid 转为userid
type WxRedirectParamter ¶
微信回调参数
type WxSendMessageApi ¶
type WxSendMessageApi struct {
// contains filtered or unexported fields
}
func (*WxSendMessageApi) SendTextMessage ¶
func (this *WxSendMessageApi) SendTextMessage(group int, whos []string, content string)
发送消息
type WxSuitInputMsg ¶
type WxSuitInputMsg struct { Timestamp string `Field:"timestamp"` Nonce string `Field:"nonce"` Signature string `Field:"msg_signature"` // contains filtered or unexported fields }
func (*WxSuitInputMsg) GetData ¶
func (this *WxSuitInputMsg) GetData() interface{}
func (*WxSuitInputMsg) GetDataType ¶
func (this *WxSuitInputMsg) GetDataType() string
func (*WxSuitInputMsg) GetInput ¶
func (this *WxSuitInputMsg) GetInput() CorpInputputMessage
type WxTag ¶
type WxTag struct { Id string //标签Id AddUserItems []string // 标签中新增的成员userid列表,用逗号分隔 DelUserItems []string // 标签中删除的成员userid列表,用逗号分隔 AddPartyItems []string // 标签中新增的部门id列表,用逗号分隔 DelPartyItems []string // 标签中删除的部门id列表,用逗号分隔 }
标签
type WxUser ¶
type WxUser struct { Id string NewId string //新的UserID,变更时推送(userid由系统生成时可更改一次) Name string //成员名称 Avatar string //头像 Departments string //所属部门 Mobile string //手机 Position string //职位 Gender int //性别,变更时推送。1表示男性,2表示女性 Email string //邮箱,变更时推送 ,仅通讯录套件可获取 Status int //激活状态:1=已激活 2=已禁用 EnglishName string //英文名 IsLeader int //是否主管 标识是否为上级。0表示普通成员,1表示上级 Telephone string //座机,仅通讯录套件可获取 ExtAttr map[string]string //扩展属性,变更时推送,仅通讯录套件可获取 }
用户
type WxUserDetail ¶
type WxUserDetail struct { Id string `json:"userid"` //成员UserID Name string `json:"name"` //成员姓名 Departments []int `json:"department"` //成员所属部门 Position string `json:"position"` //职位信息 Mobile string `json:"mobile"` //成员手机号,仅在用户同意snsapi_privateinfo授权时返回 Gender int `json:"gender"` //性别。0表示未定义,1表示男性,2表示女性 Email string `json:"email"` //成员邮箱,仅在用户同意snsapi_privateinfo授权时返回 Avatar string `json:"avatar"` //头像url。例如:"http://shp.qpic.cn/bizmp/xxxxxxxxxxx/0" 注:如果要获取小图将url最后的”/0”改成”/100”即可 }
type WxValidateRequest ¶
type WxcheckinItem ¶
type WxcheckinItem struct { User string `json:"userid"` //用户id Group string `json:"groupname"` //打卡规则名称 Type string `json:"checkin_type"` //打卡类型 Exception string `json:"exception_type"` //异常类型,如果有多个异常,以分号间隔 Time int64 `json:"checkin_time"` //打卡时间。Unix时间戳 Location string `json:"location_title"` //打卡地点title Detail string `json:"location_detail"` //打卡地点详情 Wifi string `json:"wifiname"` //打卡wifi名称 WifiMac string `json:"wifimac"` //打卡的MAC地址/bssid Notes string `json:"notes"` //打卡备注 Medias []string `json:"mediaids"` //打卡的附件media_id,可使用media/get获取附件 }