wechat

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: Apache-2.0, Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseURL = "http://wx.sinopharmgroup.net"

BaseURL 基础网址 TODO 改到系统配置项里 var BaseURL = "http://grwechat.cloudtui.com"

Functions

func APICallBack

func APICallBack(c *gin.Context)

APICallBack 微信获取个人id接口回调 @since 0.0.1

func APIJsAPITicket

func APIJsAPITicket(c *gin.Context)

APIJsAPITicket 签名算法

noncestr(随机字符串),
jsapi_ticket,
timestamp(时间戳),
url(当前网页的URL, 不包含#及其后面部分)

@since 0.0.1

func APIMessageSend

func APIMessageSend(c *gin.Context)

APIMessageSend 发送消息 @since 0.0.1

func APITokenGet

func APITokenGet(c *gin.Context)

APITokenGet 获取 access_token @since 0.0.1

func CheckCorpidSecret

func CheckCorpidSecret(corpid string, secret string) bool

CheckCorpidSecret 检查 corpid 和 secret 是否正确对应

func CheckJWT

func CheckJWT(c *gin.Context)

CheckJWT 检查安全提取 CorpID @since 0.0.1

func CheckUserID

func CheckUserID(c *gin.Context)

CheckUserID 检查 OAuth 登录 @since 0.0.1

func CheckWechatUser added in v0.0.6

func CheckWechatUser(c *gin.Context)

func FIndWechatUserByCompanyID

func FIndWechatUserByCompanyID(id string) (string, error)

FIndWechatUserByCompanyID 通过公司ID获取推送人列表 维护麻烦 用tag

func GETOrder added in v0.0.5

func GETOrder(c *gin.Context)

GETOrder 我的订单 @since 0.0.4

func GETProfile added in v0.0.5

func GETProfile(c *gin.Context)

GETProfile 用户资料页 @since 0.0.4

func GETRegister added in v0.0.5

func GETRegister(c *gin.Context)

GETRegister 微信注册页面 填写用户信息 @since 0.0.4

func GetDomainOwnershipVerifyInfo

func GetDomainOwnershipVerifyInfo(c *gin.Context)

GetDomainOwnershipVerifyInfo 域名所有权验证 @since 0.0.1

func GetHome

func GetHome(c *gin.Context)

GetHome 微信应用首页 @since 0.0.1

func GetHomeHTML

func GetHomeHTML(c *gin.Context)

GetHomeHTML html 页 @since 0.0.1

func GetHomeHTML2

func GetHomeHTML2(c *gin.Context)

GetHomeHTML2 html 页 @since 0.0.1

func GetSettings

func GetSettings(c *gin.Context)

GetSettings 设置页面 @since 0.0.1

func GetToTag

func GetToTag(str string) string

GetToTag 获取 微信需要的标签 这里也要动态配置才可

func NewJWT

func NewJWT(corpid string) (string, error)

NewJWT 创建token @since 0.0.1

func PostSettings

func PostSettings(c *gin.Context)

PostSettings 保存微信设置 @since 0.0.1

func Register

func Register()

Register 注册路由 @since 0.0.1

func RegisterServerClient

func RegisterServerClient()

RegisterServerClient 初始化微信接口使用到的所有 Server 和 Client @since 0.0.1

func SetRelativePath

func SetRelativePath()

SetRelativePath 设置路由 @since 0.0.1

Types

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

type JSONAccessToken struct {
	g.JSONErr
	AccessToken string
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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