|
@@ -1,6 +1,9 @@
|
|
|
package openplatform
|
|
package openplatform
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
|
|
+ "net/http"
|
|
|
|
|
+
|
|
|
|
|
+ "github.com/silenceper/wechat/v2/officialaccount/server"
|
|
|
"github.com/silenceper/wechat/v2/openplatform/account"
|
|
"github.com/silenceper/wechat/v2/openplatform/account"
|
|
|
"github.com/silenceper/wechat/v2/openplatform/config"
|
|
"github.com/silenceper/wechat/v2/openplatform/config"
|
|
|
"github.com/silenceper/wechat/v2/openplatform/context"
|
|
"github.com/silenceper/wechat/v2/openplatform/context"
|
|
@@ -24,6 +27,12 @@ func NewOpenPlatform(cfg *config.Config) *OpenPlatform {
|
|
|
return &OpenPlatform{ctx}
|
|
return &OpenPlatform{ctx}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+//GetServer get server
|
|
|
|
|
+func (openPlatform *OpenPlatform) GetServer(req *http.Request, writer http.ResponseWriter) *server.Server {
|
|
|
|
|
+ off := officialaccount.NewOfficialAccount(openPlatform.Context, "")
|
|
|
|
|
+ return off.GetServer(req, writer)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
//GetOfficialAccount 公众号代处理
|
|
//GetOfficialAccount 公众号代处理
|
|
|
func (openPlatform *OpenPlatform) GetOfficialAccount(appID string) *officialaccount.OfficialAccount {
|
|
func (openPlatform *OpenPlatform) GetOfficialAccount(appID string) *officialaccount.OfficialAccount {
|
|
|
return officialaccount.NewOfficialAccount(openPlatform.Context, appID)
|
|
return officialaccount.NewOfficialAccount(openPlatform.Context, appID)
|