Documentation ¶
Overview ¶
微信模块,目前是给公司企业号进行的相关处理,要从客户脱离出来 根据业务key发送信息 目前业务代码太重,要重构
Index ¶
- Variables
- func APICallBack(c *gin.Context)
- func APIGETTag(c *gin.Context)
- func APIGETTagInfo(c *gin.Context)
- func APIJsAPITicket(c *gin.Context)
- func APIMessageSend(c *gin.Context)
- func APIPOSTAddTagUsers(c *gin.Context)
- func APITokenGet(c *gin.Context)
- func CheckCorpidSecret(corpid string, secret string) bool
- func CheckJWT(c *gin.Context)
- func CheckUserID(c *gin.Context)
- func CheckWechatUser(c *gin.Context)
- func FIndWechatUserByCompanyID(id string) (string, error)
- func GETOrder(c *gin.Context)
- func GETProfile(c *gin.Context)
- func GETRegister(c *gin.Context)
- func GetDomainOwnershipVerifyInfo(c *gin.Context)
- func GetHome(c *gin.Context)
- func GetHomeHTML(c *gin.Context)
- func GetHomeHTML2(c *gin.Context)
- func GetSettings(c *gin.Context)
- func GetToTag(str string) string
- func NewJWT(corpid string) (string, error)
- func PostSettings(c *gin.Context)
- func Register()
- func RegisterServerClient()
- func SetRelativePath()
- type APIGETTagInfoForm
- type APIPOSTAddTagUsersForm
- type Claims
- type FormAPIMessageSend
- type FormAPITokenGet
- type FormJsAPITicket
- type FormPostSettings
- type JSONAccessToken
- type MessageHeader
- type TagInfo
Constants ¶
This section is empty.
Variables ¶
var BaseURL = "http://wx.sinopharmgroup.net"
BaseURL 基础网址 TODO 改到系统配置项里 var BaseURL = "http://grwechat.cloudtui.com"
Functions ¶
func APIJsAPITicket ¶
APIJsAPITicket 签名算法
noncestr(随机字符串), jsapi_ticket, timestamp(时间戳), url(当前网页的URL, 不包含#及其后面部分)
@since 0.0.1
func CheckCorpidSecret ¶
CheckCorpidSecret 检查 corpid 和 secret 是否正确对应
func CheckWechatUser ¶
CheckWechatUser 检查用户状态 删除的用户不能打开页面 @since 0.0.6
func FIndWechatUserByCompanyID ¶
FIndWechatUserByCompanyID 通过公司ID获取推送人列表 维护麻烦 用tag
func GetDomainOwnershipVerifyInfo ¶
GetDomainOwnershipVerifyInfo 域名所有权验证 @since 0.0.1
func RegisterServerClient ¶
func RegisterServerClient()
RegisterServerClient 初始化微信接口使用到的所有 Server 和 Client @since 0.0.1
Types ¶
type APIGETTagInfoForm ¶
type APIGETTagInfoForm struct {
ID int64 `form:"id" json:"id" binding:"required"`
}
type APIPOSTAddTagUsersForm ¶
type APIPOSTAddTagUsersForm struct { Tagid int64 `form:"tagid" json:"tagid" binding:"required"` Userlist []string `form:"userlist" json:"userlist" binding:"required"` }
APIPOSTAddTagUsersForm 添加标签成员表单
type Claims ¶
type Claims struct { CorpID string `json:"corpid"` jwt.StandardClaims }
Claims 这里现在是微信认证用的 后面看看再提出来 @since 0.0.1
type FormAPIMessageSend ¶
type FormAPIMessageSend struct { MessageHeader KV struct { OrderIDS []string `json:"orderids"` CompanyID string `json:"companyid"` CompanyName string `json:"companyname"` } `json:"kv"` Key string `json:"key"` Text struct { Content string `json:"content"` } `json:"text"` }
FormAPIMessageSend 提交表单 @since 0.0.1
type FormAPITokenGet ¶
type FormAPITokenGet struct { Corpid string `form:"corpid" binding:"required"` Secret string `form:"secret" binding:"required"` }
FormAPITokenGet Post 表单 @since 0.0.1
type FormJsAPITicket ¶
type FormJsAPITicket struct { Noncestr string `form:"noncestr" binding:"required"` Timestamp string `form:"timestamp" binding:"required"` URL string `form:"url" binding:"required"` }
FormJsAPITicket 签名算法表单 @since 0.0.1
type FormPostSettings ¶
type FormPostSettings struct { DomainURL string `form:"domain_url"` VerifyValue string `form:"verify_value"` }
FormPostSettings 微信设置表单 @since 0.0.1
type JSONAccessToken ¶
JSONAccessToken token 结构 @since 0.0.1 BUG TODO 这里的 accessToken 应该放在JSONErr 的 data 字段中
type MessageHeader ¶
type MessageHeader struct { MsgType string `json:"msgtype"` // 必须; 消息类型 AgentID int64 `json:"agentid"` // 必须; 企业应用的id, 整型 }
MessageHeader 通用的消息头 @since 0.0.1
type TagInfo ¶
type TagInfo struct { TagID int64 `json:"tagid"` UserList []addresslist.UserBaseInfo `json:"userList"` DepartmentList []int64 `json:"departmentList"` }
TagInfo API 返回 JSON 结构体