{"id":18985947,"url":"https://github.com/go-http/feidee","last_synced_at":"2025-04-19T20:35:38.071Z","repository":{"id":50246364,"uuid":"96740992","full_name":"go-http/feidee","owner":"go-http","description":"随手记API","archived":false,"fork":false,"pushed_at":"2024-06-21T04:48:55.000Z","size":60,"stargazers_count":24,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T13:05:50.502Z","etag":null,"topics":["api","feidee","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-http.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-10T05:59:27.000Z","updated_at":"2025-02-25T09:05:03.000Z","dependencies_parsed_at":"2024-03-26T10:26:25.737Z","dependency_job_id":"189f3ad2-a7ae-4e96-afe1-2b66ed074133","html_url":"https://github.com/go-http/feidee","commit_stats":null,"previous_names":["athurg/feidee"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-http%2Ffeidee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-http%2Ffeidee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-http%2Ffeidee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-http%2Ffeidee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-http","download_url":"https://codeload.github.com/go-http/feidee/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249250819,"owners_count":21237961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","feidee","golang"],"created_at":"2024-11-08T16:28:49.596Z","updated_at":"2025-04-16T14:32:37.619Z","avatar_url":"https://github.com/go-http.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# feidee [![PkgGoDev](https://pkg.go.dev/badge/mod/github.com/go-http/feidee/v2)](https://pkg.go.dev/mod/github.com/go-http/feidee/v2)\n随手记API\n\n# Usage\n\n## 创建并初始化客户端\n```go\n\t//创建客户端并登录\n\tclient := feidee.New(\"username\", \"password\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"登录失败:%s\", err)\n\t}\n\n\t//（可选）获取账本列表\n\terr = client.SyncAccountBookList()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"刷新账本列表失败: %s\", err)\n\t}\n\n\t//（可选）切换账本（此处需要上一步同步账本列表才能通过账本名查到账本ID，否则会报错找不到账本）\n\terr = client.SwitchBook(\"默认账本\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"切换账本失败: %s\", err)\n\t}\n\n\t//同步基础数据（科目、成员、商家、项目、账户等）\n\terr = client.SyncMetaInfo()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"同步账户基础信息失败:%s\", err)\n\t}\n```\n\n## 打印上个月对账信息\n```go\n\tnow := time.Now()\n\tt := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, time.Local)\n\tstart := t.AddDate(0, -1, 0)\n\tend := start.AddDate(0, 1, -1)\n\n\tfor id, account := range FdCLient.AccountMap {\n\t\tlist, err := FdCLient.CompareReport(id, start, end)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"\\n\\n账户%s错误:%s\", account.Name, err)\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Println(\"\\n\\n账户:\", account.Name, \"x\", len(list))\n\t\tfor _, info := range list {\n\t\t\tfmt.Printf(\"\\t%+v\\n\", info)\n\t\t}\n\t}\n```\n\n## 查询并打印按月收支\n```go\n\tinfoMap, err := FdCLient.MonthIncomeAndPayoutMap(2017, 2018)\n\tif err != nil {\n\t\tfmt.Printf(\"查询按月收支信息失败: %s\", err)\n\t\treturn\n\t}\n\tfor key, info := range infoMap {\n\t\tfmt.Printf(\"%d: %+v\\n\", key, info)\n\t}\n```\n\n## 查询并打印上月流水\n```go\n\tnow := time.Now()\n\tt := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, time.Local)\n\tstart := t.AddDate(0, -1, 0)\n\tend := start.AddDate(0, 1, -1)\n\n\tinfo, err := FdCLient.TallyList(start, end, nil)\n\tif err != nil {\n\t\tfmt.Printf(\"查询失败:%s\", err)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"%s - %s\\n\", info.BeginDate, info.EndDate)\n\tfmt.Printf(\"汇总：%+v\\n\", info.IncomeAndPayout)\n\tfor i, group := range info.Groups {\n\t\tfmt.Printf(\"%+v\\n\", group.IncomeAndPayout)\n\t\tfor j, t := range group.List {\n\t\t\tfmt.Printf(\"%d-%d %4s(%2d) %8s =\u003e %8s %10.2f\\n\", i, j, t.TranName, t.TranType, t.BuyerAcount, t.SellerAcount, t.ItemAmount)\n\t\t}\n\t}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-http%2Ffeidee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-http%2Ffeidee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-http%2Ffeidee/lists"}