1 Star 1 Fork 4

dsysama / go-gin-gorm-api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Api go simple

It is a just simple RESTful API with Go using:

  1. Gin Framework
  2. Gorm

Installation & Run


# Download Gin Framework
$ go get github.com/gin-gonic/gin

# Download GORM
$ go get github.com/jinzhu/gorm

Setting DB in settings-dev.yaml

mysql:
  name: 'root'
  host: '127.0.0.1'
  port: 3306
  password: 'root'
  dbName: 'test_gin'

Structure

├── Models
│   ├── Book.go // Book models
|	  ├── Scheme.go // Book struct and tabel
├── Config
│   └── Config.go // Config struct
├── Controllers
│   └── Book.go // Book Controller
├── Global
│   └── GlobarVar.go // Global variables
├── Initialize
│   └── Config.go // Config initialize
│   └── Mysql.go // Mysql initialize
│   └── Router.go // Router initialize
├── ApiHelpers
│   └── Response.go // response function
├── Routers
|   └── Routers.go // Routers
└── main.go

API

/book

  • GET : Get all book
  • POST : Create a new book

/book/:id

  • GET : Get a book
  • PUT : Update a book
  • DELETE : Delete a book

空文件

简介

基于Gin+Gorm+Mysql搭建的简易增删改查api接口 展开 收起
Go
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/dsysama/go-gin-gorm-api.git
git@gitee.com:dsysama/go-gin-gorm-api.git
dsysama
go-gin-gorm-api
go-gin-gorm-api
master

搜索帮助