同步操作将从 go-admin-team/go-admin 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
English | 简体中文
Follow RESTful API design specifications
Provides rich middleware support based on GIN WEB API framework (user authentication, cross domain, access log, tracking ID, etc.)
Casbin-based RBAC access control model
JWT certification
Support Swagger documentation (based on swaggo)
GORM-based database storage that can expand many types of databases
Simple model mapping of configuration files to quickly get the desired configuration
TODO: unit test
settings:
application:
# Project launch environment
env: dev
# When env: demo, prompts for request operations other than GET
envmsg: "谢谢您的参与,但为了大家更好的体验,所以本次提交就算了吧!"
# Host IP or domain name, default 0.0.0.0
host: 0.0.0.0
# Whether to initialize the database structure and basic data; true: required; false: not required
isinit: false
# JWT encrypted string
jwtsecret: 123abc
# log storage path
logpath: temp/logs/log.log
# application name
name: go-admin
# application port
port: 8000
readtimeout: 1
writertimeout: 2
database:
# database name
database: dbname
# database type
dbtype: mysql
# database host
host: 127.0.0.1
# database password
password: password
# database port
port: 3306
# database username
username: root
redis:
# redis addresss
addr: 0.0.0.0:6379
# db
db: 0
# password
password: password
# read timeout
readtimeout: 50
First start instructions
# Get the code
git clone https://github.com/wenjianzhang/go-admin.git
# Enter working path
cd ./go-admin
# Build the project
go build
# Change setting
vi ./config/setting.yml (Note: Change isinit and database connection)
# 1. Database information in the configuration file
# Note: the corresponding configuration data under settings.database
# 2. Confirm database initialization parameters
# Note: If this is the first time settings.application.isinit is set, please set the current value to true, the system will automatically initialize the database structure and basic data information;
# 3. Confirm the log path
# Start the project or debug with the IDE
./go-admin
# See also instructions in WIKI
Document generation
swag init
If there is no swag
command go get installed
go get -u github.com/swaggo/swag/cmd/swag
Cross compilation
env GOOS=windows GOARCH=amd64 go build main.go
# or
env GOOS=linux GOARCH=amd64 go build main.go
admin / 123456
Demo address:http://www.zhangwj.com
I saw a lot of friends who experience the wrong verification code, so I adjusted the contrast for everyone to experience!
Copyright (c) 2020 wenjianzhang
[中文]qq technical exchange group: 74520518
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。