model

package
v0.0.0-...-6c63689 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id      uint64  `db:"id",json:"id"`
	Name    string  `db:"name",json:"name"`
	EntryId uint64  `db:"entry_id",json:"entry_id"`
	Balance float64 `db:"balance",json:"balance"`
}

type AccountDao

type AccountDao struct {
	DB *sqlx.DB
}

func (*AccountDao) QueryAccountByName

func (dao *AccountDao) QueryAccountByName(name string) (account Account, err error)

func (*AccountDao) QueryAllAccount

func (dao *AccountDao) QueryAllAccount() (accounts []Account, err error)

type Entry

type Entry struct {
	Id        uint64        `db:"id"`
	Name      string        `db:"name"`
	Level     uint64        `db:"level"`
	ParentLvl sql.NullInt64 `db:"parent_lvl"`
}

type EntryDao

type EntryDao struct {
	DB *sqlx.DB
}

func (*EntryDao) QueryAllEntries

func (dao *EntryDao) QueryAllEntries() (entries []Entry, err error)

func (*EntryDao) QueryChildEntriesById

func (dao *EntryDao) QueryChildEntriesById(id uint64) (entries []Entry, err error)

func (*EntryDao) QueryEntriesByLevel

func (dao *EntryDao) QueryEntriesByLevel(id uint64) (entries []Entry, err error)

func (*EntryDao) QueryEntryById

func (dao *EntryDao) QueryEntryById(id uint64) (entry Entry, err error)

func (*EntryDao) QueryEntryByName

func (dao *EntryDao) QueryEntryByName(name string) (entry Entry, err error)

type EntryType

type EntryType string
const (
	Asset     EntryType = "资产类"
	Liability EntryType = "负债类"
	Income    EntryType = "收入类"
	Expense   EntryType = "支出类"
)

type Record

type Record struct {
	Id        uint64     `db:"id"`
	Type      RecordType `db:"type"`
	AccountId uint64     `db:"account_id"`
	EntryId   uint64     `db:"entry_id"`
	Amount    float64    `db:"amount"`
	Datetime  time.Time  `db:"datetime"`
	Counter   string     `db:"counter"`
}

type RecordDao

type RecordDao struct {
	DB *sqlx.DB
}

func (*RecordDao) Insert

func (dao *RecordDao) Insert(debitRecord Record, creditRecord Record) (err error)

type RecordType

type RecordType int
const (
	Debit  RecordType = 1 // 借
	Credit RecordType = 2 // 贷
)

type Report

type Report interface {
}

Jump to

Keyboard shortcuts

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