Documentation ¶
Index ¶
- Constants
- type AccountBook
- func (accountBook AccountBook) AccountIdByName(name string) int
- func (accountBook AccountBook) CategoryIdByName(name string) int
- func (accountBook AccountBook) CategoryIdMap() map[int]Category
- func (accountBook AccountBook) MemberIdByName(name string) int
- func (accountBook AccountBook) ProjectIdByName(name string) int
- func (accountBook AccountBook) StoreIdByName(name string) int
- type Category
- type Client
- func (cli *Client) BillEntry(id int, day time.Time, money float64) (string, error)
- func (cli *Client) CompareReport(accountId int, begin, end time.Time) ([]CompareInfo, error)
- func (cli *Client) CompareReportByPage(accountId int, begin, end time.Time, page int) (CompareReportResponse, error)
- func (cli *Client) DailyReport(begin, end time.Time, params url.Values) (DailyReport, error)
- func (cli *Client) ExportToBuffer() ([]byte, error)
- func (cli *Client) ExportToFile(filename string) error
- func (cli *Client) GetExportLink() (string, error)
- func (cli *Client) Login(email, password string) error
- func (cli *Client) MonthIncomeAndPayoutMap(beginYear, endYear int) (map[int]IncomeAndPayout, error)
- func (cli *Client) SwitchAccountBook(name string) error
- func (cli *Client) SyncAccountBookList() error
- func (cli *Client) SyncMetaInfo() error
- func (cli *Client) TallyCreate(tally Tally, when time.Time) error
- func (cli *Client) TallyDelete(tranIds ...string) error
- func (cli *Client) TallyList(begin, end time.Time, data url.Values) (TallyResponseInfo, error)
- func (cli *Client) TallyUpdate(tally Tally, updateData url.Values) error
- type CompareInfo
- type CompareReportResponse
- type DailyReport
- type DailyReportList
- type DateInfo
- type IdName
- type IncomeAndPayout
- type PageInfo
- type Tally
- type TallyGroup
- type TallyResponseInfo
- type VCCodeInfo
Constants ¶
View Source
const ( BaseUrl = "https://www.sui.com" LoginUrl = "https://login.sui.com" )
请求的基础链接地址
View Source
const ( TranTypePayout = 1 //支出 TranTypeTransfer = 2 //转账 TranTypeIncome = 5 //收入 )
交易类型
View Source
const MaxAuthRedirectCount = 5
自动跳转以刷新认证信息时,最大的递归调用次数
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBook ¶
type AccountBook struct { Categories []Category Stores []IdName Members []IdName Accounts []IdName Projects []IdName }
func (AccountBook) AccountIdByName ¶
func (accountBook AccountBook) AccountIdByName(name string) int
根据账户名获取账户ID
func (AccountBook) CategoryIdByName ¶
func (accountBook AccountBook) CategoryIdByName(name string) int
根据科目名获取科目ID
func (AccountBook) CategoryIdMap ¶
func (accountBook AccountBook) CategoryIdMap() map[int]Category
根据科目名获取科目ID为索引的Map
func (AccountBook) MemberIdByName ¶
func (accountBook AccountBook) MemberIdByName(name string) int
根据成员名获取成员ID
func (AccountBook) ProjectIdByName ¶
func (accountBook AccountBook) ProjectIdByName(name string) int
根据项目名获取项目ID
func (AccountBook) StoreIdByName ¶
func (accountBook AccountBook) StoreIdByName(name string) int
根据商户名获取商户ID
type Category ¶
type Category struct { IdName Type int //科目类别:支出或收入,参见TranTypeXXX常量 IsSub bool //是否是子科目 SubIds []int }
账单科目
type Client ¶
type Client struct { Verbose bool AccountBook AccountBookList []IdName // contains filtered or unexported fields }
执行操作的Feidee客户端
func (*Client) CompareReport ¶
获取所有对账报表
func (*Client) CompareReportByPage ¶
func (cli *Client) CompareReportByPage(accountId int, begin, end time.Time, page int) (CompareReportResponse, error)
获取单页对账报表
func (*Client) DailyReport ¶
日常收支报表
func (*Client) ExportToBuffer ¶
func (*Client) ExportToFile ¶
数据导出到文件(随手记WEB版格式的xls文件)
func (*Client) GetExportLink ¶
获取数据导出的链接(导出为随手记WEB版格式的xls文件)
func (*Client) MonthIncomeAndPayoutMap ¶
func (cli *Client) MonthIncomeAndPayoutMap(beginYear, endYear int) (map[int]IncomeAndPayout, error)
获取按月汇总的收支情况,key为201707格式
func (*Client) TallyCreate ¶
添加交易的接口 //TODO:增加对其他交易类型的支持
type CompareInfo ¶
type CompareInfo struct { Balance float32 //当前余额 DayBalance float32 //当日余额(当日收入-当日支出) Money struct { Claims float32 Income float32 In float32 //流入 Debet float32 Out float32 //留出 Payout float32 } Date DateInfo }
对账报表
type CompareReportResponse ¶
type CompareReportResponse struct { PageInfo List []CompareInfo }
报表页响应
type DailyReport ¶
type DailyReport struct { InAmount float32 OutAmount float32 Symbol string MaxIn float32 `json:"maxI"` MaxOut float32 `json:"maxO"` InList DailyReportList `json:"inlst"` OutList DailyReportList `json:"outlst"` }
type DailyReportList ¶
type DailyReportList []struct { IdName Total float32 List []struct { IdName Amount float32 } `json:"c"` }
日常收支报表
type DateInfo ¶
type DateInfo struct { Year int //从1900算起第N年 Month int //从0开始的月份 Date int //日期 Day int //星期 Hours int //时北京时间 Minutes int //分 Seconds int //秒 Time int //Unix时间戳* 1000 TimezoneOffset int //与UTC时间的相差的小时数 }
多个响应使用的日期结构
type Tally ¶
type Tally struct { Account int BuyerAcount string //支出、收入时为交易账户,转账时为转出账户 BuyerAcountId int //支出、收入时为交易账户,转账时为转出账户 CategoryId int CategoryName string MemberId int MemberName string TranType int TranName string ProjectId int ProjectName string SellerAcount string //转账时表示转入账户 SellerAcountId int //转账时表示转入账户 ItemAmount float32 //交易金额,转账时该数值和CurrencyAmount相同 CurrencyAmount float32 //转账金额 Relation string CategoryIcon string Url string Content string ImgId int TranId int TransferStoreId int Memo string Date DateInfo }
流水信息
type TallyResponseInfo ¶
type TallyResponseInfo struct { IncomeAndPayout PageNo int PageCount int Symbol string EndDate string BeginDate string Groups []TallyGroup }
查询流水接口的响应
type VCCodeInfo ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.