Documentation ¶
Index ¶
- type Bill
- type BillHeader
- type BillHeaderType
- type Key
- type Product
- type ProductDao
- func (pd *ProductDao) GetBillHeaderList(productKey Key) (list []BillHeader, err error)
- func (pd *ProductDao) GetIncomeExpenseAndNameMap(productKey Key) (result map[constant.IncomeExpense]map[string]TransactionCategory, err error)
- func (pd *ProductDao) GetPtcIdMapping(accountId uint, productKey Key) (result map[uint]TransactionCategoryMapping, err error)
- func (pd *ProductDao) SelectAllCategoryMappingByCategoryId(categoryId uint) (result []TransactionCategoryMapping, err error)
- func (pd *ProductDao) SelectBillByKey(key Key) (result Bill, err error)
- func (pd *ProductDao) SelectByKey(key Key) (result Product, err error)
- func (pd *ProductDao) SelectCategoryByName(key Key, ie constant.IncomeExpense, name string) (result TransactionCategory, err error)
- type TransactionCategory
- func (tc *TransactionCategory) GetIncomeExpenseAndNameMap(productKey Key) (result map[constant.IncomeExpense]map[string]TransactionCategory, err error)
- func (tc *TransactionCategory) GetMap(productKey Key) (map[uint]TransactionCategory, error)
- func (tc *TransactionCategory) IsEmpty() bool
- func (tc *TransactionCategory) SelectById(id uint) error
- func (tc *TransactionCategory) TableName() string
- type TransactionCategoryMapping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bill ¶
type BillHeader ¶
type BillHeader struct { ID uint ProductKey string `gorm:"not null;uniqueIndex:product_header_type,priority:1"` Name string Type BillHeaderType `gorm:"not null;uniqueIndex:product_header_type,priority:2"` commonModel.BaseModel }
func (*BillHeader) GetNameMap ¶
func (tc *BillHeader) GetNameMap(productKey string) ( NameMap map[string]BillHeader, err error, )
func (*BillHeader) IsEmpty ¶
func (b *BillHeader) IsEmpty() bool
func (*BillHeader) TableName ¶
func (b *BillHeader) TableName() string
type BillHeaderType ¶
type BillHeaderType string
const ( TransTime BillHeaderType = "trans_time" TransCategory BillHeaderType = "trans_category" Remark BillHeaderType = "remark" IncomeExpense BillHeaderType = "income_expense" Amount BillHeaderType = "amount" OrderNumber BillHeaderType = "order_number" TransStatus BillHeaderType = "trans_status" )
type Product ¶
type ProductDao ¶
type ProductDao struct {
// contains filtered or unexported fields
}
func NewDao ¶
func NewDao(db ...*gorm.DB) *ProductDao
func (*ProductDao) GetBillHeaderList ¶
func (pd *ProductDao) GetBillHeaderList(productKey Key) (list []BillHeader, err error)
func (*ProductDao) GetIncomeExpenseAndNameMap ¶
func (pd *ProductDao) GetIncomeExpenseAndNameMap(productKey Key) ( result map[constant.IncomeExpense]map[string]TransactionCategory, err error, )
func (*ProductDao) GetPtcIdMapping ¶
func (pd *ProductDao) GetPtcIdMapping(accountId uint, productKey Key) ( result map[uint]TransactionCategoryMapping, err error, )
func (*ProductDao) SelectAllCategoryMappingByCategoryId ¶
func (pd *ProductDao) SelectAllCategoryMappingByCategoryId(categoryId uint) ( result []TransactionCategoryMapping, err error, )
func (*ProductDao) SelectBillByKey ¶
func (pd *ProductDao) SelectBillByKey(key Key) (result Bill, err error)
func (*ProductDao) SelectByKey ¶
func (pd *ProductDao) SelectByKey(key Key) (result Product, err error)
func (*ProductDao) SelectCategoryByName ¶
func (pd *ProductDao) SelectCategoryByName( key Key, ie constant.IncomeExpense, name string, ) (result TransactionCategory, err error)
type TransactionCategory ¶
type TransactionCategory struct { ID uint `gorm:"primary_key"` ProductKey string `gorm:"uniqueIndex:unique_name,priority:1"` IncomeExpense constant.IncomeExpense `gorm:"size:8;comment:'收支类型';uniqueIndex:unique_name,priority:2"` Name string `gorm:"size:64;uniqueIndex:unique_name,priority:3"` commonModel.BaseModel }
func (*TransactionCategory) GetIncomeExpenseAndNameMap ¶
func (tc *TransactionCategory) GetIncomeExpenseAndNameMap(productKey Key) ( result map[constant.IncomeExpense]map[string]TransactionCategory, err error, )
func (*TransactionCategory) GetMap ¶
func (tc *TransactionCategory) GetMap(productKey Key) (map[uint]TransactionCategory, error)
func (*TransactionCategory) IsEmpty ¶
func (tc *TransactionCategory) IsEmpty() bool
func (*TransactionCategory) SelectById ¶
func (tc *TransactionCategory) SelectById(id uint) error
func (*TransactionCategory) TableName ¶
func (tc *TransactionCategory) TableName() string
type TransactionCategoryMapping ¶
type TransactionCategoryMapping struct { AccountId uint `gorm:"uniqueIndex:account_ptc_mapping,priority:1"` CategoryId uint `gorm:"uniqueIndex:category_ptc_mapping,priority:1"` PtcId uint `gorm:"uniqueIndex:account_ptc_mapping,priority:2;uniqueIndex:category_ptc_mapping,priority:2"` ProductKey string CreatedAt time.Time `gorm:"type:TIMESTAMP"` UpdatedAt time.Time `gorm:"type:TIMESTAMP"` commonModel.BaseModel }
func (*TransactionCategoryMapping) GetPtcIdMapping ¶
func (tcm *TransactionCategoryMapping) GetPtcIdMapping( account *accountModel.Account, productKey Key, ) (result map[uint]TransactionCategoryMapping, err error)
func (*TransactionCategoryMapping) IsEmpty ¶
func (tcm *TransactionCategoryMapping) IsEmpty() bool
func (*TransactionCategoryMapping) TableName ¶
func (tcm *TransactionCategoryMapping) TableName() string
Click to show internal directories.
Click to hide internal directories.