# gin_template **Repository Path**: lixiang-98/gin_template ## Basic Information - **Project Name**: gin_template - **Description**: 基于gin框架的基础开发脚手架 - **Primary Language**: Go - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2023-08-31 - **Last Updated**: 2023-08-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gin_template #### 介绍 基于gin框架的基础开发脚手架 #### 软件架构 * web framework: [gin](https://github.com/gin-gonic/gin) * redis: [redigo](https://github.com/gomodule/redigo) * mysql: [gorm](https://github.com/jinzhu/gorm) * logger: [zerolog](https://github.com/rs/zerolog) * scheduler: [cron](https://github.com/robfig/cron) * config: [viper](https://github.com/spf13/viper) * json web token: [jwt-go](https://github.com/dgrijalva/jwt-go) * swagger docs: [swaggo](https://github.com/swaggo/gin-swagger) #### 安装教程 ``` shell $ git clone https://github.com/ErikJiang/market_monitor.git $ go mod init $ go mod tidy ``` #### 使用说明 ``` bash $ cd gin_template $ go run main.go ``` #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 目录结构: ``` bash gin_template/: ├─conf/ # 配置文件目录(运行前需要调整database、redis等参数配置) ├─controller/ # 控制器层目录 ├─docs/ # 接口文档 Swagger 生成目录 ├─core/ # 框架核心模块目录 ├─data/ # 静态资源目录 ├─jobs/ # 定时任务目录 ├─models/ # 数据模型层 ├─router/ # 路由目录 ├─service/ # 服务层目录 ├─templates/ # 视图模板层目录 ├─.gitignore # git忽略控制文件 ├─app.log # 日志文件 ├─go.mod # 包管理文件 ├─go.sum # 依赖包版本哈希文件 └─main.go # 运行入口main文件 ``` #### 特技 基于gin框架的api服务器 基于Go module的外部包管理 基于cron包的定时任务job 使用viper进行配置管理 使用zap日志库进行日志输出,支持控制台和文件输出,文件支持切割 使用mysql数据库进行数据存储 使用gomail/smtp库进行邮件的发送 使用Air实现程序实时热重载 使用JWT进行登录token认证 接入第三方api,如和风天气、节假日、土味情话、星座运势