From aef42d59aa29dd6309a0e52ad3037ba6a85ef5f6 Mon Sep 17 00:00:00 2001 From: yedongfu Date: Thu, 8 Jul 2021 14:31:29 +0800 Subject: [PATCH] tcc branch call added --- dtmcli/tcc.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dtmcli/tcc.go b/dtmcli/tcc.go index daed4f3..92549ca 100644 --- a/dtmcli/tcc.go +++ b/dtmcli/tcc.go @@ -49,7 +49,7 @@ func TccFromReq(c *gin.Context) (*Tcc, error) { } func (t *Tcc) CallBranch(body interface{}, tryUrl string, confirmUrl string, cancelUrl string) (*resty.Response, error) { - return common.RestyClient.R(). + resp, err := common.RestyClient.R(). SetBody(&M{ "gid": t.Gid, "branch_id": common.GenGid(), @@ -61,4 +61,10 @@ func (t *Tcc) CallBranch(body interface{}, tryUrl string, confirmUrl string, can "cancel": cancelUrl, }). Post(t.Dtm + "/registerTccBranch") + if err != nil { + return resp, err + } + return common.RestyClient.R(). + SetBody(body). + Post(tryUrl) }