Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hunter-ji/resetful-gin-demo
gin的resetful案例
https://github.com/hunter-ji/resetful-gin-demo
demo docker dockerfile gin golang mysql redis restful-api web
Last synced: about 2 months ago
JSON representation
gin的resetful案例
- Host: GitHub
- URL: https://github.com/hunter-ji/resetful-gin-demo
- Owner: hunter-ji
- License: mit
- Created: 2020-08-16T08:30:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-12T15:27:27.000Z (about 4 years ago)
- Last Synced: 2023-10-30T12:43:13.044Z (about 1 year ago)
- Topics: demo, docker, dockerfile, gin, golang, mysql, redis, restful-api, web
- Language: Go
- Homepage:
- Size: 55.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Resetful Gin Demo
## 简介
使用`gin`开发的resetful风格的todo项目,包括用户管理和todo的增删改查。使用query params的方式携带token来验证身份,中间件拦截请求,验证token,将相关用户信息写到上下文中。数据库连接使用`gin`的`GIN_MODE`环境变量来切换生产和开发环境。
## 路由
| 路由 | 说明 |
| ------------ | ----------------------------- |
| /ping | ping/pong检测mysql和redis连接 |
| /user/login | 登录 |
| /user/info | 用户信息 |
| /user/logout | 注销 |
| /todo | todo的增删改查 |
| /todo/single | 单个todo的详情 |