{"id":15320357,"url":"https://github.com/cocainecong/todolist","last_synced_at":"2025-04-09T15:06:55.230Z","repository":{"id":45650797,"uuid":"349073672","full_name":"CocaineCong/TodoList","owner":"CocaineCong","description":"Gin+Gorm+Redis+Swagger 基于 RESTful API 规范搭建备忘录，包括redis缓存，swagger文档，docker部署","archived":false,"fork":false,"pushed_at":"2023-05-21T15:00:43.000Z","size":250,"stargazers_count":224,"open_issues_count":3,"forks_count":62,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-09T15:06:49.836Z","etag":null,"topics":["docker","gin","go","golang","gorm","mysql","redis","restful-api","swagger"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CocaineCong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-03-18T12:55:38.000Z","updated_at":"2025-04-07T08:23:39.000Z","dependencies_parsed_at":"2025-01-01T04:11:12.681Z","dependency_job_id":"b5840ed0-9de1-42fe-9b1c-7254c8978d25","html_url":"https://github.com/CocaineCong/TodoList","commit_stats":{"total_commits":83,"total_committers":4,"mean_commits":20.75,"dds":"0.10843373493975905","last_synced_commit":"23ac24484f45eae034efbfcddfa807d2d8eb47b0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CocaineCong%2FTodoList","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CocaineCong%2FTodoList/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CocaineCong%2FTodoList/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CocaineCong%2FTodoList/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CocaineCong","download_url":"https://codeload.github.com/CocaineCong/TodoList/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055284,"owners_count":21040157,"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":["docker","gin","go","golang","gorm","mysql","redis","restful-api","swagger"],"created_at":"2024-10-01T09:08:18.025Z","updated_at":"2025-04-09T15:06:55.204Z","avatar_url":"https://github.com/CocaineCong.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Todo List 备忘录\n\n**此项目使用`Gin`+`Gorm` ，基于`RESTful API`实现的一个备忘录**。\n\n**此项目比较适合小白入门`web开发`这一方面**\n# 详细教程\n\n**注意，最新版本是v2**\n\nB站: \n- v1版本：https://www.bilibili.com/video/BV1GT4y1R7tX \n- 重构v2版本：https://www.bilibili.com/video/BV13z4y1a7ZJ\n\n博客: \n- v1版本：https://blog.csdn.net/weixin_45304503/article/details/120680957\n- 重构v2版本：https://blog.csdn.net/weixin_45304503/article/details/130460797\n\n**前端仓库地址：https://github.com/CocaineCong/react-todolist**\n\n\n## 项目运行\n### 手动执行\n**本项目使用`Go Mod`管理依赖。**\n\n将所有环境拉取启动\n\n```shell\nmake env-up\n```\n\n**下载依赖**\n\n```shell\ngo mod tidy\n```\n\n**运行**\n\n```shell\ngo run ./cmd/main.go\n```\n\n将所有环境关闭并删除\n\n```shell\nmake env-down\n```\n\n# 接口文档\n\n[Todo List 接口文档](https://www.showdoc.cc/1510696761141710)\n\n**密码：0000**\n\n也可以启动项目后，直接访问 http://localhost:3000/swagger/index.html \n\n查看**swagger**文档\n\n也可以选择postman文档导入\n\n打开postman，点击导入\n\n![postman导入](docs/1.点击import导入.png)\n\n选择导入文件\n![选择导入接口文件](docs/2.选择文件.png)\n\n![导入](docs/3.导入.png)\n\n效果\n\n![展示](docs/4.效果.png)\n\n\n## 项目主要功能介绍\n\n- 用户注册登录 ( jwt-go鉴权 )\n- 新增/删除/修改/查询 备忘录\n- 存储每条备忘录的浏览次数\n- 分页功能\n\n\n## 项目主要依赖：\n\n**Golang V1.15**\n\n- Gin\n- Gorm\n- mysql\n- redis\n- ini\n- jwt-go\n- logrus\n- go-swagger\n\n## 项目结构\n\n```shell\nTodoList/\n├── api\n├── cmd\n├── conf\n├── consts\n├── docs\n├── middleware\n├── pkg\n│  ├── e\n│  └── util\n├── routes\n├── repository\n│  ├── cache\n│  └── db\n│     ├── dao\n│     └── model\n├── routes\n├── service\n└── types\n```\n\n- api : 用于定义接口函数,也就是controller层\n- cmd : 程序启动\n- conf : 用于存储配置文件\n- middleware : 应用中间件\n- pkg/e : 封装错误码\n- pkg/logging : 日志打印\n- pkg/util : 工具函数\n- repository: 仓库放置所有存储\n- repository/cache: 放置redis缓存\n- repository/db: 持久层MySQL仓库\n- repository/db/dao: 对db进行操作的dao层\n- repository/db/model: 定义所有持久层数据库表结构的model层\n- routes : 路由逻辑处理\n- service : 接口函数的实现\n- types : 放置所有的定义的结构体\n\n## 配置文件\n配置文件在conf/config.ini.example中，把.example去掉，然后根据自己的情况配置就好了\n\n**conf/config.ini**\n```ini\n# debug开发模式,release生产模式\n[service]\nAppMode = debug\nHttpPort = :3000\n# 运行端口号 3000端口\n\n[redis]\nRedisDb = redis\nRedisAddr = \n# redis ip地址和端口号\nRedisPw = \n# redis 密码\nRedisDbName = 2\n# redis 名字\n\n[mysql]\nDb = mysql\nDbHost =\n# mysql ip地址\nDbPort = \n# mysql 端口号\nDbUser = \n# mysql 用户名\nDbPassWord = \n# mysql 密码\nDbName = \n# mysql 名字\n```\n\n## 简要说明\n1. `mysql`是存储主要数据\n2. `redis`用来存储备忘录的浏览次数\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcocainecong%2Ftodolist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcocainecong%2Ftodolist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcocainecong%2Ftodolist/lists"}