• Stars
    star
    197
  • Rank 196,583 (Top 4 %)
  • Language
    Go
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Gin+Gorm+Redis+Swagger 基于 RESTful API 规范搭建备忘录,包括redis缓存,swagger文档,docker部署

Todo List 备忘录

此项目使用Gin+Gorm ,基于RESTful API实现的一个备忘录

此项目比较适合小白入门web开发这一方面

详细教程

注意,最新版本是v2

B站:

博客:

前端仓库地址:https://github.com/CocaineCong/react-todolist

项目运行

手动执行

本项目使用Go Mod管理依赖。

将所有环境拉取启动

make env-up

下载依赖

go mod tidy

运行

go run ./cmd/main.go

将所有环境关闭并删除

make env-down

接口文档

Todo List 接口文档

密码:0000

也可以启动项目后,直接访问 http://localhost:3000/swagger/index.html

查看swagger文档

也可以选择postman文档导入

打开postman,点击导入

postman导入

选择导入文件 选择导入接口文件

导入

效果

展示

项目主要功能介绍

  • 用户注册登录 ( jwt-go鉴权 )
  • 新增/删除/修改/查询 备忘录
  • 存储每条备忘录的浏览次数
  • 分页功能

项目主要依赖:

Golang V1.15

  • Gin
  • Gorm
  • mysql
  • redis
  • ini
  • jwt-go
  • logrus
  • go-swagger

项目结构

TodoList/
├── api
├── cmd
├── conf
├── consts
├── docs
├── middleware
├── pkg
│  ├── e
│  └── util
├── routes
├── repository
│  ├── cache
│  └── db
│     ├── dao
│     └── model
├── routes
├── service
└── types
  • api : 用于定义接口函数,也就是controller层
  • cmd : 程序启动
  • conf : 用于存储配置文件
  • middleware : 应用中间件
  • pkg/e : 封装错误码
  • pkg/logging : 日志打印
  • pkg/util : 工具函数
  • repository: 仓库放置所有存储
  • repository/cache: 放置redis缓存
  • repository/db: 持久层MySQL仓库
  • repository/db/dao: 对db进行操作的dao层
  • repository/db/model: 定义所有持久层数据库表结构的model层
  • routes : 路由逻辑处理
  • service : 接口函数的实现
  • types : 放置所有的定义的结构体

配置文件

配置文件在conf/config.ini.example中,把.example去掉,然后根据自己的情况配置就好了

conf/config.ini

# debug开发模式,release生产模式
[service]
AppMode = debug
HttpPort = :3000
# 运行端口号 3000端口

[redis]
RedisDb = redis
RedisAddr = 
# redis ip地址和端口号
RedisPw = 
# redis 密码
RedisDbName = 2
# redis 名字

[mysql]
Db = mysql
DbHost =
# mysql ip地址
DbPort = 
# mysql 端口号
DbUser = 
# mysql 用户名
DbPassWord = 
# mysql 密码
DbName = 
# mysql 名字

简要说明

  1. mysql是存储主要数据
  2. redis用来存储备忘录的浏览次数

More Repositories

1

gin-mall

基于 gin+gorm+redis+mysql 读写分离的电子商城,包括 JWT 鉴权,CORS跨域,AES 对称加密,引入ELK体系方便日志查看,jaeger进行trace查看,skywalking进行检测,使用docker容器化部署
Go
484
star
2

grpc-todoList

gin+grpc+gorm+etcd+mysql 的备忘录功能。Gin作为HTTP的web框架,gRPC作为RPC框架,ETCD作为服务注册与发现。
Go
192
star
3

micro-todoList

Go语言微服务实战,go-micro+gin+gorm+rabbitMQ 构造简单备忘录,包括ETCD作为服务发现,JWT鉴权,降级熔断等等
Go
138
star
4

gin-chat-demo

gin+websocket+mongodb实现 IM 即时聊天系统,基于WS连接的即时聊天,支持单聊,在线回复以及历史记录查询
Go
119
star
5

Golang-Learning

以本人为例,学习Go语言的路线。我也是从20年10月开始接触go语言,和大家分享一下我的学习路程。
Go
114
star
6

tangseng

Tangseng search engine including full text search and vector search base on golang. 基于go语言的搜索引擎,信息检索系统
Go
111
star
7

Golang-Interview

记录实习、秋招中大型公司的Go语言面经,包括字节跳动,腾讯,滴滴,百度等等...内容涉及Go的基础语法以及底层,数据结构与算法,操作系统,数据库,计算机网络,计算机组成原理等等.....
56
star
8

BiliBili

Gin框架实现B站,Gin+Gorm 实现一个视频弹幕网站
Go
34
star
9

TeenStudy

青年大学习一键提醒、福建省,安徽省,上海市都有
Python
27
star
10

Go-SecKill

Gin+Gorm+Redis+ETCD的秒杀系统,列举出一系列并发情况下数据竞争问题的解决方案。
Go
26
star
11

Go-Spider-Demo

使用go语言进行爬虫的小案例
Go
25
star
12

gesture-recognizion

YOLO+ResNet的手势识别,YOLO进行目标识别,ResNet进行特征提取
Python
24
star
13

Lottery

以太坊智能合约实战 —— FanOne彩票网
Smarty
22
star
14

Car-Manage-System

Gin + Gorm 实现车辆信息联络平台
Go
17
star
15

BiliBili-Word

BiliBili 科普文案
11
star
16

react-todolist

typescript + react + antd + axios + redux 进行简单备忘录的构建
JavaScript
10
star
17

react-mall

gin-mall商城前端
TypeScript
8
star
18

go-plus-demo

使用go+进行爬虫并数据处理
Go
6
star
19

FaceYOLOv5

基于YOLOv5的人脸检测
Python
6
star
20

Car-Mini-Program

车辆信息联络平台的小程序端
JavaScript
6
star
21

secret

Provide the interface of symmetric encryption AES/DES/3DES and asymmetric encryption RSA, making your sensitive data easier to desensitize and store.( 提供 对称加密 AES/DES/3DES 以及非对称加密 RSA 的上层封装接口,让您的敏感数据更加容易脱敏并存储 )
Go
6
star
22

go-html2image

HTML to image tool based on golang
Go
5
star
23

Net-Demo

Go 语言实现TCP,UDP通信等等
Go
5
star
24

Python_Spider_demo

Python
5
star
25

NumpyMnist

纯Numpy实现手写数字识别
Jupyter Notebook
4
star
26

ML-Projects

记录机器学习的笔记
Python
4
star
27

Car-Yolo-FasterRcnn

Python
4
star
28

Flask_pandown

this is a wangpan of flask eduction
Python
4
star
29

PlantsVsZooms

Python
4
star
30

WxSnakeRush

JavaScript
4
star
31

mq-server

rabbitmq 服务端
Go
4
star
32

gRPC-Demo-Test

关于gRPC的一些小demo
Go
4
star
33

Gin-Seckill

基于Gin框架的商品秒杀系统
4
star
34

CocaineCong

4
star
35

FaceYOLOv3

基于YOLOv3的人脸检测算法
Python
4
star
36

react-tangseng

搜索引擎前端
JavaScript
4
star
37

eslogrus

an es hook base golang for logrus. 一个基于go语言的es钩子,为了能把logrus的日志送到es
Go
3
star
38

MIT6.824

for mit 6.824 knowledge learning
3
star
39

fgen

基于 gorm 根据数据库自动生成 curd 模版
Go
2
star
40

BiliBili-Code

b站的demo代码
HTML
2
star
41

mysql2other

Sync MySQL data into elasticsearch
Go
2
star
42

ChatRoom

使用go写的一个聊天室
JavaScript
1
star
43

gosin

kv store
1
star
44

fenbi

Kotlin
1
star
45

react-todolist-js

JavaScript
1
star