Fetch the repository succeeded.
RBAC scaffolding based on GIN + Gorm 2.0 + CASBIN + WIRE (DI).
English | 中文
RESTful API
design specificationCasbin
to implement fine-grained access to the interface designWire
to resolve dependencies between modulesGin
middlewares (JWTAuth,CORS,RequestLogger,RequestRateLimiter,TraceID,CasbinEnforce,Recover,GZIP)Swagger
go get -u github.com/cosmtrek/air
go get -u github.com/google/wire/cmd/wire
go get -u github.com/swaggo/swag/cmd/swag
git clone https://github.com/LyricTian/gin-admin
cd gin-admin
go run cmd/gin-admin/main.go web -c ./configs/config.toml -m ./configs/model.conf --menu ./configs/menu.yaml
# Or use Makefile: make start
The database and table structure will be automatically created during the startup process. After the startup is successful, you can access the swagger address through the browser: http://127.0.0.1:10088/swagger/index.html
swagger
documentationswag init --parseDependency --generalInfo ./cmd/${APP}/main.go --output ./internal/app/swagger
# Or use Makefile: make swagger
wire
to generate dependency injectionwire gen ./internal/app
# Or use Makefile: make wire
task.yaml
name: Task
comment: TaskManage
fields:
- name: Code
type: string
required: true
binding_options: ""
gorm_options: "size:50;index;"
- name: Name
type: string
required: true
binding_options: ""
gorm_options: "size:50;index;"
- name: Memo
type: string
required: false
binding_options: ""
gorm_options: "size:1024;"
generate
commandgin-admin-cli g -d . -p github.com/LyricTian/gin-admin/v8 -f ./task.yaml
make swagger
make wire
make start
├── cmd
│ └── gin-admin
│ └── main.go
├── configs
│ ├── config.toml
│ ├── menu.yaml
│ └── model.conf
├── docs
├── internal
│ └── app
│ ├── api
│ ├── config
│ ├── contextx
│ ├── dao
│ ├── ginx
│ ├── middleware
│ ├── module
│ ├── router
│ ├── schema
│ ├── service
│ ├── swagger
│ ├── test
├── pkg
│ ├── auth
│ │ └── jwtauth
│ ├── errors
│ ├── gormx
│ ├── logger
│ │ ├── hook
│ └── util
│ ├── conv
│ ├── hash
│ ├── json
│ ├── snowflake
│ ├── structure
│ ├── trace
│ ├── uuid
│ └── yaml
└── scripts
Copyright (c) 2021 Lyric
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
Activity
Community
Health
Trend
Influence
:Code submit frequency
:React/respond to issue & PR etc.
:Well-balanced team members and collaboration
:Recent popularity of project
:Star counts, download counts etc.