Giter VIP home page Giter VIP logo

todolist's Introduction

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用来存储备忘录的浏览次数

todolist's People

Contributors

cocainecong avatar hzbnb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.