mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 10:16:15 +00:00
25 lines
642 B
Go
25 lines
642 B
Go
package comm
|
|
|
|
import (
|
|
"github.com/assimon/luuu/model/request"
|
|
"github.com/assimon/luuu/model/service"
|
|
"github.com/assimon/luuu/util/constant"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
// CreateTransaction 创建交易
|
|
func (c *BaseCommController) CreateTransaction(ctx echo.Context) (err error) {
|
|
req := new(request.CreateTransactionRequest)
|
|
if err = ctx.Bind(req); err != nil {
|
|
return c.FailJson(ctx, constant.ParamsMarshalErr)
|
|
}
|
|
if err = c.ValidateStruct(ctx, req); err != nil {
|
|
return c.FailJson(ctx, err)
|
|
}
|
|
resp, err := service.CreateTransaction(req)
|
|
if err != nil {
|
|
return c.FailJson(ctx, err)
|
|
}
|
|
return c.SucJson(ctx, resp)
|
|
}
|