transfer

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

This section is empty.

Variables

View Source
var GetDetailRouter = router.Handler(func(c router.Context) {
	c.ResponseFunc(nil, func() schema.Response {
		return GetDetail(helper.NewContext(&c), c.Param("transfer_id"))
	})
})
View Source
var GetHistoryRouter = router.Handler(func(c router.Context) {
	var (
		input Query
	)

	c.ResponseFunc(c.ShouldBindQuery(&input), func() schema.Response {
		return GetHistory(helper.NewContext(&c), input)
	})
})
View Source
var ToRouter = router.Handler(func(c router.Context) {
	var (
		input ToParams
	)

	signature := c.GetHeader(middleware.SignatureHeader)

	c.ResponseFunc(c.ShouldBindJSON(&input), func() schema.Response {
		return To(helper.NewContext(&c), input, signature)
	})

})

Functions

func GenerateTransferLogSQL

func GenerateTransferLogSQL(filter QueryParams, limit int, count bool) string

func GetDetail

func GetDetail(c helper.Context, transferId string) (res schema.Response)

func GetHistory

func GetHistory(c helper.Context, query Query) (res schema.Response)

func GetTransferTableName

func GetTransferTableName(currency string) string

获取转账表名

func To

func To(c helper.Context, input ToParams, signature string) (res schema.Response)

Types

type Query

type Query struct {
	schema.Query
}

type QueryParams

type QueryParams struct {
	Id       *string               `json:"id"`       // 转账ID
	Currency *string               `json:"currency"` // 转账币种
	From     *string               `json:"from"`     // 汇款人
	To       *string               `json:"to"`       // 收款人
	Amount   *string               `json:"amount"`   // 转账数量
	Status   *model.TransferStatus `json:"status"`   // 转账状态
}

type ToParams

type ToParams struct {
	Currency string  `json:"currency" validate:"required" comment:"币种"`              // 币种
	To       string  `json:"to" validate:"required,numeric" comment:"转账对象"`          // 转账给谁
	Amount   string  `json:"amount" validate:"required,numeric,gt=0" comment:"转账数量"` // 转账数量
	Note     *string `json:"note" validate:"omitempty" comment:"转账备注"`               // 转账备注
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL