go-laoji / wecom-go-sdk Goto Github PK
View Code? Open in Web Editor NEW企业微信第三方应用|自建代开发|自建应用 三合一 sdk golang版;支持服务商应用运营体系
License: Apache License 2.0
企业微信第三方应用|自建代开发|自建应用 三合一 sdk golang版;支持服务商应用运营体系
License: Apache License 2.0
企业微信API文档:https://developer.work.weixin.qq.com/document/path/90254
最主要的是没返回文件类型,基本上没发用
大佬,MessageSend方法中的corpId参数是什么呀?怎么获取?
Lines 129 to 136 in 026bef1
callbackGroup := e.Group("/callback")
{
callbackGroup.GET("/data", callback.DataGetHandler)
callbackGroup.POST("/data", callback.DataPostHandler)
callbackGroup.GET("/cmd", callback.CmdGetHandler)
callbackGroup.POST("/cmd", callback.CmdPostHandler)
callbackGroup.GET("/customized", callback.CustomizedGetHandler)
callbackGroup.POST("/customized", callback.CustomizedPostHandler)
}
suite := e.Group("/suite")
{
suite.GET("/install", install.SuiteInstall)
suite.GET("/install/auth", install.SuiteInstallAuth)
}
这个回调事件:https://developer.work.weixin.qq.com/document/path/90642
我在用源码里面的例子运行会报下面的错误
badger 2024/04/22 11:15:21 INFO: All 0 tables opened in 0s badger 2024/04/22 11:15:21 INFO: Discard stats nextEmptySlot: 0 badger 2024/04/22 11:15:21 INFO: Set nextTxnTs to 0 badger 2024/04/22 11:15:21 INFO: Deleting empty file: ./cache.db/000006.vlog [GIN-debug] GET /callback/data --> github.com/go-laoji/wecom-go-sdk/v2/pkg/svr/callback.DataGetHandler (4 handlers) [GIN-debug] POST /callback/data --> github.com/go-laoji/wecom-go-sdk/v2/pkg/svr/callback.DataPostHandler (4 handlers) [GIN-debug] GET /callback/cmd --> github.com/go-laoji/wecom-go-sdk/v2/pkg/svr/callback.CmdGetHandler (4 handlers) [GIN-debug] POST /callback/cmd --> github.com/go-laoji/wecom-go-sdk/v2/pkg/svr/callback.CmdPostHandler (4 handlers) [GIN-debug] GET /callback/customized --> github.com/go-laoji/wecom-go-sdk/v2/pkg/svr/callback.CustomizedGetHandler (4 handlers) [GIN-debug] POST /callback/customized --> github.com/go-laoji/wecom-go-sdk/v2/pkg/svr/callback.CustomizedPostHandler (4 handlers) [GIN-debug] GET /suite/install --> github.com/go-laoji/wecom-go-sdk/v2/pkg/svr/install.SuiteInstall (4 handlers) [GIN-debug] GET /suite/install/auth --> github.com/go-laoji/wecom-go-sdk/v2/pkg/svr/install.SuiteInstallAuth (4 handlers) [GIN-debug] GET /api/demo/user --> github.com/go-laoji/wecom-go-sdk/v2/pkg/demo.UserGet (4 handlers) [GIN-debug] GET /api/demo/usersimplelist --> github.com/go-laoji/wecom-go-sdk/v2/pkg/demo.UserSimpleList (4 handlers) [GIN-debug] GET /api/demo/userlist --> github.com/go-laoji/wecom-go-sdk/v2/pkg/demo.UserList (4 handlers) [GIN-debug] GET /api/demo/userid2openid --> github.com/go-laoji/wecom-go-sdk/v2/pkg/demo.UserId2OpenId (4 handlers) [GIN-debug] GET /api/demo/openid2userid --> github.com/go-laoji/wecom-go-sdk/v2/pkg/demo.OpenId2UserId (4 handlers) [GIN-debug] GET /api/demo/listmemberauth --> github.com/go-laoji/wecom-go-sdk/v2/pkg/demo.ListMemberAuth (4 handlers) [GIN-debug] GET / --> main.main.func1 (4 handlers)
wget http://127.0.0.1:8080/api/demo/user?userid=4974
github.com/go-laoji/wecom-go-sdk/[email protected]/suite.go:221 record not found [1.142ms] [rows:0] SELECT * FROM
ts_suite_corp_agentWHERE
ts_suite_corp_agent.
fi_corp_auth_id= 1 ORDER BY
ts_suite_corp_agent.
fi_corp_access_token_idLIMIT 1 2024-04-22T11:17:54.157+0800 ERROR [email protected]/suite.go:34 suite ticket 未推送
2024-04-22T11:17:54.157+0800 ERROR [email protected]/suite.go:68 suite ticket 未推送
ListenAndReceiveWecomMsg.go
package wecom_sdk
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/go-laoji/wecom-go-sdk/pkg/svr/callback"
"github.com/go-laoji/wecom-go-sdk/v2/pkg/svr/middleware"
)
func InjectWecomMsgRouter(e *gin.Engine) {
callbackGroup := e.Group("/wecom")
{
callbackGroup.GET("/receive", callback.CustomizedGetHandler)
callbackGroup.POST("/receive", callback.CustomizedPostHandler)
}
}
func ListenAndReceiveWecomMsg() {
router := gin.Default()
router.Use(middleware.InjectSdk(WecomSdk))
InjectWecomMsgRouter(router)
ListenAddr := fmt.Sprintf("%s:%s", BindHost, BindPort)
router.Run(ListenAddr)
}
ListenAndReceiveWecomMsg_test.go
package wecom_sdk
import (
"testing"
)
func TestListenAndReceiveWecomMsg(t *testing.T) {
ListenAndReceiveWecomMsg()
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.