transfer

package
v0.0.0-...-d742f65 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncodeTransferService

type EncodeTransferService struct {
	eel.ServiceBase
}

func NewEncodeTransferService

func NewEncodeTransferService(ctx context.Context) *EncodeTransferService

func (*EncodeTransferService) EncodeForAccount

func (this *EncodeTransferService) EncodeForAccount(account *b_account.Account, transfer *Transfer) *RTransfer

func (*EncodeTransferService) EncodeManyForAccount

func (this *EncodeTransferService) EncodeManyForAccount(account *b_account.Account, transfers []*Transfer) []*RTransfer

type FillTransferService

type FillTransferService struct {
	eel.ServiceBase
}

func NewFillTransferService

func NewFillTransferService(ctx context.Context) *FillTransferService

func (*FillTransferService) FillAccount

func (this *FillTransferService) FillAccount(transfers []*Transfer)

func (*FillTransferService) FillId

func (this *FillTransferService) FillId(transfer *Transfer)

FillId 填充id

type RTransfer

type RTransfer struct {
	Id              int    `json:"id"`
	Bid             string `json:"bid"`
	ThirdBid        string `json:"third_bid"`
	SourceAccountId int    `json:"source_account_id"`
	DestAccountId   int    `json:"dest_account_id"`
	SourceUserId    int    `json:"source_user_id"`
	DestUserId      int    `json:"dest_user_id"`
	Amount          int    `json:"amount"`
	SourceAmount    int    `json:"source_amount"`
	DestAmount      int    `json:"dest_amount"`
	Action          string `json:"action"`
	OriginAction    string `json:"origin_action"`
	TransferType    string `json:"transfer_type"`
	CreatedAt       string `json:"created_at"`
}

type StateTransferService

type StateTransferService struct {
	eel.ServiceBase
}

func NewStateTransferService

func NewStateTransferService(ctx context.Context) *StateTransferService

func (*StateTransferService) GetRealtimeValidBalance

func (this *StateTransferService) GetRealtimeValidBalance(account *b_account.Account, args ...map[string]interface{}) int

GetRealtimeValidBalance 实时计算(特定时间的)可用余额 = 特定时间transfer总收入 - transfer总支出 - frozen总金额

func (*StateTransferService) GetTotalExpenseForAccount

func (this *StateTransferService) GetTotalExpenseForAccount(account *b_account.Account) int

GetTotalExpenseForAccount 获取账户的总支出

func (*StateTransferService) GetTotalIncomeForAccount

func (this *StateTransferService) GetTotalIncomeForAccount(accountId int, args ...map[string]interface{}) int

GetTotalIncomeForAccount 获取账户总收入

func (*StateTransferService) GetTotalIncomeForAccounts

func (this *StateTransferService) GetTotalIncomeForAccounts(accountIds []int, filters eel.Map) map[int]int

type Transfer

type Transfer struct {
	eel.EntityBase

	Id              int
	Bid             string
	ThirdBid        string
	SourceAccountId int
	DestAccountId   int
	SourceAmount    int
	DestAmount      int
	Action          string
	ExtraData       string
	Digest          string
	IsDeleted       bool
	CreatedAt       time.Time

	SourceAccount *b_account.Account
	DestAccount   *b_account.Account
}

func NewTransferFromMap

func NewTransferFromMap(data map[string]interface{}) *Transfer

func NewTransferFromModel

func NewTransferFromModel(ctx context.Context, dbModel *m_account.Transfer) *Transfer

func (*Transfer) GetActionType

func (this *Transfer) GetActionType() string

func (*Transfer) GetBid

func (this *Transfer) GetBid() string

func (*Transfer) GetBusinessType

func (this *Transfer) GetBusinessType() string

func (*Transfer) GetDisplayAction

func (this *Transfer) GetDisplayAction() string

func (*Transfer) GetTransferType

func (this *Transfer) GetTransferType(account *b_account.Account) string

type TransferParams

type TransferParams struct {
	SourceAccount *b_account.Account
	DestAccount   *b_account.Account
	SourceAmount  int
	DestAmount    int
	Bid           string
	Action        string
	ExtraData     map[string]interface{}
}

TransferParams 交易的必要因素

type TransferRepository

type TransferRepository struct {
	eel.ServiceBase
}

func NewTransferRepository

func NewTransferRepository(ctx context.Context) *TransferRepository

func (*TransferRepository) GetByBid

func (this *TransferRepository) GetByBid(bid string) []*Transfer

func (*TransferRepository) GetByFilters

func (this *TransferRepository) GetByFilters(filters eel.Map) []*Transfer

func (*TransferRepository) GetById

func (this *TransferRepository) GetById(tid int) *Transfer

func (*TransferRepository) GetByThirdBid

func (this *TransferRepository) GetByThirdBid(bid string) []*Transfer

func (*TransferRepository) GetFeeTransfersByThirdBids

func (this *TransferRepository) GetFeeTransfersByThirdBids(thirdBIds []string) []*Transfer

GetFeeTransfersByThirdBids 根据订单号获取手续费交易记录

func (*TransferRepository) GetPagedTransfersForAccount

func (this *TransferRepository) GetPagedTransfersForAccount(account *b_account.Account, transferType string, filters eel.Map, pageInfo *eel.PageInfo) ([]*Transfer, eel.INextPageInfo)

func (*TransferRepository) IsSettled

func (this *TransferRepository) IsSettled(bid string) bool

type TransferService

type TransferService struct {
	eel.ServiceBase
}

func NewTransferService

func NewTransferService(ctx context.Context) *TransferService

func (*TransferService) BulkTransfer

func (this *TransferService) BulkTransfer(params []TransferParams) []*Transfer

BulkTransfer 批量交易

func (*TransferService) Transfer

func (this *TransferService) Transfer(params TransferParams) *Transfer

Transfer 账户间交易

func (*TransferService) TransferForDeposit

func (this *TransferService) TransferForDeposit(destAccount *b_account.Account, amount int, orderBid string) *Transfer

TransferForDeposit 充值交易 1、user的rmb账户 => 平台的cash账户 订单结算中完成 2、平台的imoney账户 => 用户的imoney账户

func (*TransferService) TransferForFee

func (this *TransferService) TransferForFee(deductAccount *b_account.Account, feeAmount int, orderBid string) *Transfer

TransferForFee Deprecated

Jump to

Keyboard shortcuts

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