cmd

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bar added in v0.0.2

func Bar(list []*Account)

func Execute

func Execute()

func GetCSVPath

func GetCSVPath() (items []string)

GetCSVPath 查找当前目录下的账单文件

func PromptSelectAnalysis

func PromptSelectAnalysis() string

func PromptSelectCSVPath

func PromptSelectCSVPath(bType string) string

Types

type Account added in v0.0.2

type Account struct {
	TransAt       DateTime `csv:"交易时间"`
	TransType     string   `csv:"交易类型"`
	TransFrom     string   `csv:"交易对方"`
	GoodsName     string   `csv:"商品"`
	IO            string   `csv:"收/支"`
	Money         float64  `csv:"金额(元)"`
	PayType       string   `csv:"支付方式"`
	CurrentStatus string   `csv:"当前状态"`
	TransNo       string   `csv:"交易单号"`
	BusinessNo    string   `csv:"商户单号"`
	Remark        string   `csv:"备注"`
}

type Accounts added in v0.0.2

type Accounts []*Account

func (Accounts) Len added in v0.0.2

func (I Accounts) Len() int

func (Accounts) Less added in v0.0.2

func (I Accounts) Less(i, j int) bool

func (Accounts) Swap added in v0.0.2

func (I Accounts) Swap(i, j int)

type Bill

type Bill struct {
	// contains filtered or unexported fields
}

func (*Bill) GetTitle

func (b *Bill) GetTitle()

GetTitle 转换 title

func (*Bill) ReadAliPay

func (b *Bill) ReadAliPay(path string) error

func (*Bill) ReadMergeFile

func (b *Bill) ReadMergeFile(path string) (accounts []*Account, err error)

ReadMergeFile 读取合并后的账单

func (*Bill) ReadWechatPay

func (b *Bill) ReadWechatPay(path string) error

func (*Bill) WriteMergeFile

func (b *Bill) WriteMergeFile(path string) error

WriteMergeFile 合并账单

type DateTime added in v0.0.2

type DateTime struct {
	time.Time
}

func (*DateTime) MarshalCSV added in v0.0.2

func (date *DateTime) MarshalCSV() (string, error)

MarshalCSV Convert the internal date as CSV string

func (*DateTime) String added in v0.0.2

func (date *DateTime) String() string

String You could also use the standard Stringer interface

func (*DateTime) UnmarshalCSV added in v0.0.2

func (date *DateTime) UnmarshalCSV(csv string) (err error)

UnmarshalCSV Convert the CSV string as internal date

Jump to

Keyboard shortcuts

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