package v2 import ( "context" "gitee.com/lansexiongdi/ymt/api" "gitee.com/lansexiongdi/ymt/core" "net/http" ) const ( orderMethod = "/openapi/v2/key/order" queryMethod = "/openapi/v2/key/query" ) type Key api.Service func (k *Key) Order(ctx context.Context, request *OrderRequest) (http.Header, *http.Response, *core.Response, error) { h, httpResponse, bodyBytes, err := k.Post(ctx, orderMethod, request) if err != nil { return nil, nil, nil, err } res, err := core.BuildResponse(bodyBytes) if err != nil { return h, httpResponse, nil, err } return h, httpResponse, res, nil } func (k *Key) Query(ctx context.Context, request *QueryRequest) (http.Header, *http.Response, *core.Response, error) { h, httpResponse, bodyBytes, err := k.Post(ctx, queryMethod, request) if err != nil { return nil, nil, nil, err } res, err := core.BuildResponse(bodyBytes) if err != nil { return h, httpResponse, nil, err } return h, httpResponse, res, nil }