mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-04 12:52:27 +08:00
完善文档
This commit is contained in:
10
wechat.go
10
wechat.go
@@ -44,33 +44,33 @@ func copyConfigToContext(cfg *Config, context *context.Context) {
|
||||
context.SetJsApiTicketLock(new(sync.RWMutex))
|
||||
}
|
||||
|
||||
//GetServer init
|
||||
//GetServer 消息管理
|
||||
func (wc *Wechat) GetServer(req *http.Request, writer http.ResponseWriter) *server.Server {
|
||||
wc.Context.Request = req
|
||||
wc.Context.Writer = writer
|
||||
return server.NewServer(wc.Context)
|
||||
}
|
||||
|
||||
//GetMaterial init
|
||||
//GetMaterial 素材管理
|
||||
func (wc *Wechat) GetMaterial() *material.Material {
|
||||
return material.NewMaterial(wc.Context)
|
||||
}
|
||||
|
||||
//GetOauth init
|
||||
//GetOauth oauth2网页授权
|
||||
func (wc *Wechat) GetOauth(req *http.Request, writer http.ResponseWriter) *oauth.Oauth {
|
||||
wc.Context.Request = req
|
||||
wc.Context.Writer = writer
|
||||
return oauth.NewOauth(wc.Context)
|
||||
}
|
||||
|
||||
//GetJs init
|
||||
//GetJs js-sdk配置
|
||||
func (wc *Wechat) GetJs(req *http.Request, writer http.ResponseWriter) *js.Js {
|
||||
wc.Context.Request = req
|
||||
wc.Context.Writer = writer
|
||||
return js.NewJs(wc.Context)
|
||||
}
|
||||
|
||||
//GetMenu init
|
||||
//GetMenu 菜单管理接口
|
||||
func (wc *Wechat) GetMenu(req *http.Request, writer http.ResponseWriter) *menu.Menu {
|
||||
wc.Context.Request = req
|
||||
wc.Context.Writer = writer
|
||||
|
||||
Reference in New Issue
Block a user