accounts

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2022 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderMethodStateEnabled  = 1 // 已启用
	OrderMethodStateDisabled = 0 // 已禁用
)
View Source
const (
	UserOrderStateEnabled  = 1 // 已启用
	UserOrderStateDisabled = 0 // 已禁用
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OrderMethod added in v0.5.0

type OrderMethod struct {
	Id          uint32   `field:"id"`          // ID
	Name        string   `field:"name"`        // 名称
	IsOn        bool     `field:"isOn"`        // 是否启用
	Description string   `field:"description"` // 描述
	ParentCode  string   `field:"parentCode"`  // 内置的父级代号
	Code        string   `field:"code"`        // 代号
	Url         string   `field:"url"`         // URL
	Secret      string   `field:"secret"`      // 密钥
	Params      dbs.JSON `field:"params"`      // 参数
	Order       uint32   `field:"order"`       // 排序
	State       uint8    `field:"state"`       // 状态
}

OrderMethod 订单支付方式

type OrderMethodDAO added in v0.5.0

type OrderMethodDAO dbs.DAO
var SharedOrderMethodDAO *OrderMethodDAO

func NewOrderMethodDAO added in v0.5.0

func NewOrderMethodDAO() *OrderMethodDAO

type OrderMethodOperator added in v0.5.0

type OrderMethodOperator struct {
	Id          interface{} // ID
	Name        interface{} // 名称
	IsOn        interface{} // 是否启用
	Description interface{} // 描述
	ParentCode  interface{} // 内置的父级代号
	Code        interface{} // 代号
	Url         interface{} // URL
	Secret      interface{} // 密钥
	Params      interface{} // 参数
	Order       interface{} // 排序
	State       interface{} // 状态
}

func NewOrderMethodOperator added in v0.5.0

func NewOrderMethodOperator() *OrderMethodOperator

type UserAccount

type UserAccount struct {
	Id          uint64  `field:"id"`          // ID
	UserId      uint64  `field:"userId"`      // 用户ID
	Total       float64 `field:"total"`       // 可用总余额
	TotalFrozen float64 `field:"totalFrozen"` // 冻结余额
}

UserAccount 用户账号

type UserAccountDAO

type UserAccountDAO dbs.DAO
var SharedUserAccountDAO *UserAccountDAO

func NewUserAccountDAO

func NewUserAccountDAO() *UserAccountDAO

func (*UserAccountDAO) CheckUserAccount

func (this *UserAccountDAO) CheckUserAccount(tx *dbs.Tx, userId int64, accountId int64) error

CheckUserAccount 检查用户账户

func (*UserAccountDAO) CountAllAccounts

func (this *UserAccountDAO) CountAllAccounts(tx *dbs.Tx, keyword string) (int64, error)

CountAllAccounts 计算所有账户数量

func (*UserAccountDAO) FindUserAccountWithAccountId

func (this *UserAccountDAO) FindUserAccountWithAccountId(tx *dbs.Tx, accountId int64) (*UserAccount, error)

FindUserAccountWithAccountId 根据ID查找用户账户

func (*UserAccountDAO) FindUserAccountWithUserId

func (this *UserAccountDAO) FindUserAccountWithUserId(tx *dbs.Tx, userId int64) (*UserAccount, error)

FindUserAccountWithUserId 根据用户ID查找用户账户

func (*UserAccountDAO) ListAccounts

func (this *UserAccountDAO) ListAccounts(tx *dbs.Tx, keyword string, offset int64, size int64) (result []*UserAccount, err error)

ListAccounts 列出单页账户

func (*UserAccountDAO) PayBills

func (this *UserAccountDAO) PayBills(tx *dbs.Tx) error

PayBills 尝试自动支付账单

func (*UserAccountDAO) UpdateUserAccount

func (this *UserAccountDAO) UpdateUserAccount(tx *dbs.Tx, accountId int64, delta float32, eventType userconfigs.AccountEventType, description string, params maps.Map) error

UpdateUserAccount 操作用户账户

func (*UserAccountDAO) UpdateUserAccountFrozen

func (this *UserAccountDAO) UpdateUserAccountFrozen(tx *dbs.Tx, userId int64, delta float32, eventType userconfigs.AccountEventType, description string, params maps.Map) error

UpdateUserAccountFrozen 操作用户账户冻结余额

type UserAccountDailyStat

type UserAccountDailyStat struct {
	Id      uint32  `field:"id"`      // ID
	Day     string  `field:"day"`     // YYYYMMDD
	Month   string  `field:"month"`   // YYYYMM
	Income  float64 `field:"income"`  // 收入
	Expense float64 `field:"expense"` // 支出
}

UserAccountDailyStat 账户每日统计

type UserAccountDailyStatDAO

type UserAccountDailyStatDAO dbs.DAO
var SharedUserAccountDailyStatDAO *UserAccountDailyStatDAO

func NewUserAccountDailyStatDAO

func NewUserAccountDailyStatDAO() *UserAccountDailyStatDAO

func (*UserAccountDailyStatDAO) FindDailyStats

func (this *UserAccountDailyStatDAO) FindDailyStats(tx *dbs.Tx, dayFrom string, dayTo string) (result []*UserAccountDailyStat, err error)

FindDailyStats 查看按天统计

func (*UserAccountDailyStatDAO) FindMonthlyStats

func (this *UserAccountDailyStatDAO) FindMonthlyStats(tx *dbs.Tx, dayFrom string, dayTo string) (result []*UserAccountDailyStat, err error)

FindMonthlyStats 查看某月统计

func (*UserAccountDailyStatDAO) UpdateDailyStat

func (this *UserAccountDailyStatDAO) UpdateDailyStat(tx *dbs.Tx) error

UpdateDailyStat 更新当天统计数据

type UserAccountDailyStatOperator

type UserAccountDailyStatOperator struct {
	Id      interface{} // ID
	Day     interface{} // YYYYMMDD
	Month   interface{} // YYYYMM
	Income  interface{} // 收入
	Expense interface{} // 支出
}

func NewUserAccountDailyStatOperator

func NewUserAccountDailyStatOperator() *UserAccountDailyStatOperator

type UserAccountLog

type UserAccountLog struct {
	Id          uint64   `field:"id"`          // ID
	UserId      uint64   `field:"userId"`      // 用户ID
	AccountId   uint64   `field:"accountId"`   // 账户ID
	Delta       float64  `field:"delta"`       // 操作余额的数量(可为负)
	DeltaFrozen float64  `field:"deltaFrozen"` // 操作冻结的数量(可为负)
	Total       float64  `field:"total"`       // 操作后余额
	TotalFrozen float64  `field:"totalFrozen"` // 操作后冻结余额
	EventType   string   `field:"eventType"`   // 类型
	Description string   `field:"description"` // 描述文字
	Day         string   `field:"day"`         // YYYYMMDD
	CreatedAt   uint64   `field:"createdAt"`   // 时间
	Params      dbs.JSON `field:"params"`      // 参数
}

UserAccountLog 用户账户日志

type UserAccountLogDAO

type UserAccountLogDAO dbs.DAO
var SharedUserAccountLogDAO *UserAccountLogDAO

func NewUserAccountLogDAO

func NewUserAccountLogDAO() *UserAccountLogDAO

func (*UserAccountLogDAO) CountAccountLogs

func (this *UserAccountLogDAO) CountAccountLogs(tx *dbs.Tx, userId int64, accountId int64, keyword string, eventType string) (int64, error)

CountAccountLogs 计算日志数量

func (*UserAccountLogDAO) CreateAccountLog

func (this *UserAccountLogDAO) CreateAccountLog(tx *dbs.Tx, userId int64, accountId int64, delta float32, deltaFrozen float32, eventType userconfigs.AccountEventType, description string, params maps.Map) error

CreateAccountLog 生成用户账户日志

func (*UserAccountLogDAO) ListAccountLogs

func (this *UserAccountLogDAO) ListAccountLogs(tx *dbs.Tx, userId int64, accountId int64, keyword string, eventType string, offset int64, size int64) (result []*UserAccountLog, err error)

ListAccountLogs 列出单页日志

func (*UserAccountLogDAO) SumDailyEventTypes

func (this *UserAccountLogDAO) SumDailyEventTypes(tx *dbs.Tx, day string, eventTypes []userconfigs.AccountEventType) (float32, error)

SumDailyEventTypes 统计某天数据总和

type UserAccountLogOperator

type UserAccountLogOperator struct {
	Id          interface{} // ID
	UserId      interface{} // 用户ID
	AccountId   interface{} // 账户ID
	Delta       interface{} // 操作余额的数量(可为负)
	DeltaFrozen interface{} // 操作冻结的数量(可为负)
	Total       interface{} // 操作后余额
	TotalFrozen interface{} // 操作后冻结余额
	EventType   interface{} // 类型
	Description interface{} // 描述文字
	Day         interface{} // YYYYMMDD
	CreatedAt   interface{} // 时间
	Params      interface{} // 参数
}

func NewUserAccountLogOperator

func NewUserAccountLogOperator() *UserAccountLogOperator

type UserAccountOperator

type UserAccountOperator struct {
	Id          interface{} // ID
	UserId      interface{} // 用户ID
	Total       interface{} // 可用总余额
	TotalFrozen interface{} // 冻结余额
}

func NewUserAccountOperator

func NewUserAccountOperator() *UserAccountOperator

type UserOrder added in v0.5.0

type UserOrder struct {
	Id          uint64   `field:"id"`          // 用户订单
	UserId      uint64   `field:"userId"`      // 用户ID
	Code        string   `field:"code"`        // 订单号
	Type        string   `field:"type"`        // 订单类型
	MethodId    uint32   `field:"methodId"`    // 支付方式
	Status      string   `field:"status"`      // 订单状态
	Amount      float64  `field:"amount"`      // 金额
	Params      dbs.JSON `field:"params"`      // 附加参数
	ExpiredAt   uint64   `field:"expiredAt"`   // 过期时间
	CreatedAt   uint64   `field:"createdAt"`   // 创建时间
	CancelledAt uint64   `field:"cancelledAt"` // 取消时间
	FinishedAt  uint64   `field:"finishedAt"`  // 结束时间
	State       uint8    `field:"state"`       // 状态
}

UserOrder 用户订单

type UserOrderDAO added in v0.5.0

type UserOrderDAO dbs.DAO
var SharedUserOrderDAO *UserOrderDAO

func NewUserOrderDAO added in v0.5.0

func NewUserOrderDAO() *UserOrderDAO

type UserOrderLog added in v0.5.0

type UserOrderLog struct {
	Id        uint64   `field:"id"`        // ID
	AdminId   uint64   `field:"adminId"`   // 管理员ID
	UserId    uint64   `field:"userId"`    // 用户ID
	OrderId   uint64   `field:"orderId"`   // 订单ID
	Status    string   `field:"status"`    // 状态
	Snapshot  dbs.JSON `field:"snapshot"`  // 状态快照
	CreatedAt uint64   `field:"createdAt"` // 创建时间
}

UserOrderLog 订单日志

type UserOrderLogDAO added in v0.5.0

type UserOrderLogDAO dbs.DAO
var SharedUserOrderLogDAO *UserOrderLogDAO

func NewUserOrderLogDAO added in v0.5.0

func NewUserOrderLogDAO() *UserOrderLogDAO

type UserOrderLogOperator added in v0.5.0

type UserOrderLogOperator struct {
	Id        interface{} // ID
	AdminId   interface{} // 管理员ID
	UserId    interface{} // 用户ID
	OrderId   interface{} // 订单ID
	Status    interface{} // 状态
	Snapshot  interface{} // 状态快照
	CreatedAt interface{} // 创建时间
}

func NewUserOrderLogOperator added in v0.5.0

func NewUserOrderLogOperator() *UserOrderLogOperator

type UserOrderOperator added in v0.5.0

type UserOrderOperator struct {
	Id          interface{} // 用户订单
	UserId      interface{} // 用户ID
	Code        interface{} // 订单号
	Type        interface{} // 订单类型
	MethodId    interface{} // 支付方式
	Status      interface{} // 订单状态
	Amount      interface{} // 金额
	Params      interface{} // 附加参数
	ExpiredAt   interface{} // 过期时间
	CreatedAt   interface{} // 创建时间
	CancelledAt interface{} // 取消时间
	FinishedAt  interface{} // 结束时间
	State       interface{} // 状态
}

func NewUserOrderOperator added in v0.5.0

func NewUserOrderOperator() *UserOrderOperator

Jump to

Keyboard shortcuts

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