mirror of https://github.com/dtm-labs/dtm.git
csharpjavadistributed-transactionsdtmgogolangmicroservicenodejsphpdatabasesagaseatatcctransactiontransactionsxapythondistributed
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
613 B
27 lines
613 B
package examples
|
|
|
|
import (
|
|
"github.com/sirupsen/logrus"
|
|
"github.com/yedf/dtm/common"
|
|
)
|
|
|
|
func Main() {
|
|
go StartSvr()
|
|
trans(&TransReq{
|
|
Amount: 30,
|
|
TransInFailed: false,
|
|
TransOutFailed: true,
|
|
})
|
|
}
|
|
|
|
func StartSvr() {
|
|
logrus.Printf("examples starting")
|
|
app := common.GetGinApp()
|
|
app.POST(BusiApi+"/TransIn", TransIn)
|
|
app.POST(BusiApi+"/TransInCompensate", TransInCompensate)
|
|
app.POST(BusiApi+"/TransOut", TransOut)
|
|
app.POST(BusiApi+"/TransOutCompensate", TransOutCompensate)
|
|
app.POST(BusiApi+"/TransQuery", TransQuery)
|
|
logrus.Printf("examples istening at %d", BusiPort)
|
|
app.Run(":8081")
|
|
}
|
|
|