wechat

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: Apache-2.0, Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

微信模块,目前是给公司企业号进行的相关处理,要从客户脱离出来 根据业务key发送信息 目前业务代码太重,要重构

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 APIGETTag

func APIGETTag(c *gin.Context)

APIGETTag 获取标签列表 @since 0.0.11

func APIGETTagInfo

func APIGETTagInfo(c *gin.Context)

APIGETTagInfo 获取标签成员 @since 0.0.11

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 APIPOSTAddTagUsers

func APIPOSTAddTagUsers(c *gin.Context)

APIPOSTAddTagUsers 增加标签成员

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

func CheckWechatUser(c *gin.Context)

CheckWechatUser 检查用户状态 删除的用户不能打开页面 @since 0.0.6

func FIndWechatUserByCompanyID

func FIndWechatUserByCompanyID(id string) (string, error)

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

func GETOrder

func GETOrder(c *gin.Context)

GETOrder 我的订单 @since 0.0.4

func GETProfile

func GETProfile(c *gin.Context)

GETProfile 用户资料页 @since 0.0.4

func GETRegister

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 获取 微信需要的标签 这里也要动态配置才可 @since 0.0.8 增加供应商

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 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

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

type TagInfo

type TagInfo struct {
	TagID          int64                      `json:"tagid"`
	UserList       []addresslist.UserBaseInfo `json:"userList"`
	DepartmentList []int64                    `json:"departmentList"`
}

TagInfo API 返回 JSON 结构体

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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