update coverage

This commit is contained in:
yedongfu 2021-07-16 18:34:26 +08:00
parent a920fbadc3
commit 8eb0e0fc3c
4 changed files with 4 additions and 8 deletions

View File

@ -31,7 +31,8 @@ func main() {
} }
// quick_start 比较独立,单独作为一个例子运行,方便新人上手 // quick_start 比较独立,单独作为一个例子运行,方便新人上手
if len(os.Args) > 1 && (os.Args[1] == "quick_start" || os.Args[1] == "qs") { if len(os.Args) > 1 && (os.Args[1] == "quick_start" || os.Args[1] == "qs") {
examples.QuickStarMain() examples.QsStartSvr()
examples.QsFireRequest()
wait() wait()
} }

View File

@ -75,6 +75,7 @@ func (t *Tcc) CallBranch(body interface{}, tryURL string, confirmURL string, can
return common.RestyClient.R(). return common.RestyClient.R().
SetBody(body). SetBody(body).
SetQueryParams(common.MS{ SetQueryParams(common.MS{
"dtm": t.Dtm,
"gid": t.Gid, "gid": t.Gid,
"branch_id": branchID, "branch_id": branchID,
"trans_type": "tcc", "trans_type": "tcc",

View File

@ -68,7 +68,7 @@ func adjustBalance(sdb *sql.DB, uid int, amount int) (interface{}, error) {
return nil, dbr.Error return nil, dbr.Error
} }
if dbr.RowsAffected == 0 { if dbr.RowsAffected == 0 {
return nil, fmt.Errorf("update trading error") return nil, fmt.Errorf("update 0 rows")
} }
return "SUCCESS", nil return "SUCCESS", nil
} }

View File

@ -18,12 +18,6 @@ const qsBusiPort = 8082
var qsBusi = fmt.Sprintf("http://localhost:%d%s", qsBusiPort, qsBusiAPI) var qsBusi = fmt.Sprintf("http://localhost:%d%s", qsBusiPort, qsBusiAPI)
// QuickStarMain called by app/main.go
func QuickStarMain() {
QsStartSvr()
QsFireRequest()
}
// QsStartSvr 1 // QsStartSvr 1
func QsStartSvr() { func QsStartSvr() {
app := common.GetGinApp() app := common.GetGinApp()