plugin wx rename weixin
This commit is contained in:
parent
19f043b68e
commit
cb09456240
|
@ -0,0 +1,30 @@
|
||||||
|
package internal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/proto"
|
||||||
|
"context"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 插件通信信息,若不对应则会报错panic
|
||||||
|
const (
|
||||||
|
Tag = "wx_pay_cpn"
|
||||||
|
Version = 1
|
||||||
|
CookieKey = "wx_pay_cpn"
|
||||||
|
CookieValue = "wx_pay_cpn"
|
||||||
|
)
|
||||||
|
|
||||||
|
type WeiXinCpnService struct {
|
||||||
|
AppId string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *WeiXinCpnService) Order(ctx context.Context, request *proto.OrderRequest) (*proto.OrderResponse, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *WeiXinCpnService) Query(ctx context.Context, request *proto.QueryRequest) (*proto.QueryResponse, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *WeiXinCpnService) Notify(_ context.Context, request *proto.NotifyRequest) (*proto.NotifyResponse, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
var server = &WxCpnService{}
|
var server = &WeiXinCpnService{}
|
||||||
|
|
||||||
func config() []byte {
|
func config() []byte {
|
||||||
c := &Config{
|
c := &Config{
|
|
@ -9,7 +9,7 @@ import (
|
||||||
func main() {
|
func main() {
|
||||||
plugin.Serve(&plugin.ServeConfig{
|
plugin.Serve(&plugin.ServeConfig{
|
||||||
HandshakeConfig: shared.HandshakeConfig(internal.Version, internal.CookieKey, internal.CookieValue),
|
HandshakeConfig: shared.HandshakeConfig(internal.Version, internal.CookieKey, internal.CookieValue),
|
||||||
Plugins: shared.PluginSet(shared.NewPlugin(&internal.WxCpnService{}, internal.Tag)),
|
Plugins: shared.PluginSet(shared.NewPlugin(&internal.WeiXinCpnService{}, internal.Tag)),
|
||||||
GRPCServer: plugin.DefaultGRPCServer,
|
GRPCServer: plugin.DefaultGRPCServer,
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
package internal
|
|
||||||
|
|
||||||
import (
|
|
||||||
"codeup.aliyun.com/6552e56cc3b2728a4557fc18/plugin/proto"
|
|
||||||
"context"
|
|
||||||
)
|
|
||||||
|
|
||||||
// 插件通信信息,若不对应则会报错panic
|
|
||||||
const (
|
|
||||||
Tag = "wx_pay_cpn"
|
|
||||||
Version = 1
|
|
||||||
CookieKey = "wx_pay_cpn"
|
|
||||||
CookieValue = "wx_pay_cpn"
|
|
||||||
)
|
|
||||||
|
|
||||||
type WxCpnService struct {
|
|
||||||
AppId string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *WxCpnService) Order(ctx context.Context, request *proto.OrderRequest) (*proto.OrderResponse, error) {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *WxCpnService) Query(ctx context.Context, request *proto.QueryRequest) (*proto.QueryResponse, error) {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *WxCpnService) Notify(_ context.Context, request *proto.NotifyRequest) (*proto.NotifyResponse, error) {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
Loading…
Reference in New Issue