plugin/instance/instance.go

32 lines
767 B
Go

package instance
import (
"context"
"gitea.cdlsxd.cn/BaseSystem/plugin/manage"
"gitea.cdlsxd.cn/BaseSystem/plugin/proto"
)
func Order(ctx context.Context, tag string, request *proto.OrderRequest) (*proto.OrderResponse, error) {
srv, err := manage.Get(tag)
if err != nil {
return nil, err
}
return srv.Impl.Order(ctx, request)
}
func Query(ctx context.Context, tag string, request *proto.QueryRequest) (*proto.QueryResponse, error) {
srv, err := manage.Get(tag)
if err != nil {
return nil, err
}
return srv.Impl.Query(ctx, request)
}
func Notify(ctx context.Context, tag string, request *proto.NotifyRequest) (*proto.NotifyResponse, error) {
srv, err := manage.Get(tag)
if err != nil {
return nil, err
}
return srv.Impl.Notify(ctx, request)
}