func TransBaseFromQuery(qs url.Values) *TransBase {
	return NewTransBase(qs.Get("gid"), qs.Get("trans_type"), qs.Get("dtm"), qs.Get("branch_id"))
}
TransBaseFromQuery construct transaction info from request
package dtmcli
import (
	"errors"
	"fmt"
	"net/url"
)
type M = map[string]interface{}
type MS = map[string]string
func MustGenGid(server string) string {
	res := MS{}
	resp, err := RestyClient.R().SetResult(&res).Get(server + "/newGid")
	if err != nil || res["gid"] == "" {
		panic(fmt.Errorf("newGid error: %v, resp: %s", err, resp))
	}
	return res["gid"]
}
type IDGenerator struct {
	parentID string
	branchID int
}
func (g *IDGenerator) NewBranchID() string {
	if g.branchID >= 99 {
		panic(fmt.Errorf("branch id is larger than 99"))
	}
	if len(g.parentID) >= 20 {
		panic(fmt.Errorf("total branch id is longer than 20"))
	}
	g.branchID = g.branchID + 1
	return g.CurrentBranchID()
}
func (g *IDGenerator) CurrentBranchID() string {
	return g.parentID + fmt.Sprintf("%02d", g.branchID)
}
type TransResult struct {
	DtmResult string `json:"dtm_result"`
	Message   string
}
type TransBase struct {
	Gid       string `json:"gid"`
	TransType string `json:"trans_type"`
	IDGenerator
	Dtm string
	WaitResult bool
}
func NewTransBase(gid string, transType string, dtm string, parentID string) *TransBase {
	return &TransBase{
		Gid:         gid,
		TransType:   transType,
		IDGenerator: IDGenerator{parentID: parentID},
		Dtm:         dtm,
	}
}