transfer

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 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, input 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" valid:"required~请选择币种"`                   // 币种
	To       string  `json:"to" valid:"required~请输入转账对象,numeric~请输入正确的接受人ID"`   // 转账给谁
	Amount   string  `json:"amount" valid:"required~请输入转账数量,float~请输入纯数字的转账数量"` // 转账数量
	Note     *string `json:"note"`                                              // 转账备注
}

Jump to

Keyboard shortcuts

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