██████╗ ██████╗ ██████╗ ██╗███╗ ██╗ ██████╗ ███████╗███████╗████████╗███████╗██╗ ██╗██╗ █████╗ ██████╗ ██╗
██╔════╝ ██╔═══██╗ ██╔════╝ ██║████╗ ██║ ██╔══██╗██╔════╝██╔════╝╚══██╔══╝██╔════╝██║ ██║██║ ██╔══██╗██╔══██╗██║
██║ ███╗██║ ██║█████╗██║ ███╗██║██╔██╗ ██║█████╗██████╔╝█████╗ ███████╗ ██║ █████╗ ██║ ██║██║█████╗███████║██████╔╝██║
██║ ██║██║ ██║╚════╝██║ ██║██║██║╚██╗██║╚════╝██╔══██╗██╔══╝ ╚════██║ ██║ ██╔══╝ ██║ ██║██║╚════╝██╔══██║██╔═══╝ ██║
╚██████╔╝╚██████╔╝ ╚██████╔╝██║██║ ╚████║ ██║ ██║███████╗███████║ ██║ ██║ ╚██████╔╝███████╗ ██║ ██║██║ ██║
╚═════╝ ╚═════╝ ╚═════╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
- 复制 config-example.yaml 并重命名为 config.yaml,填上自己的配置
- go run main.go
- 访问 http://localhost:8000/swagger/index.html 即可看到接口文档
- POST /token/username-pwd 用户名密码登录
- POST /token/phone-pwd 手机号密码登录
- POST /token/phone-code 手机号验证码登录
- POST /token/open-id 小程序 openid 登录
- POST /users 用户普通注册
- PATCH /users/password 新旧密码修改密码
- PATCH /users/password/phone-code 手机号验证码修改密码
- PATCH /users/authority 更改用户权限
- GET /users 获取用户列表
- GET /verification/sms 手机号获取短信验证码
app:
pageSize: 10
server:
mode: debug
addr: 8000
readTimeout: 60
writeTimeout: 60
aliOSS:
endpoint: oss-cn-hangzhou.aliyuncs.com
accessKeyId: [ 阿里云accessKeyId ]
accessKeySecret: [ 阿里云accessKeySecret ]
bucketName: [ bucket ]
bucketUrl: [ bucket url ]
database:
type: mysql
user: xxx
password: xxxx
host: xx.xx.xxx.xx:3306
name: [ 数据库名 ]
tencent:
secretId: [ 腾讯云secretId ]
secretKey: [ 腾讯云secretId ]
redisDB:
addr: xx.xxx.xx.xx:6379
password: xxxxx
db: 0
jwt:
signingKey: [ jwt signingKey ]
expiresTime: [ 604800, token过期时长 ]
bufferTime: [ bufferTime ]
zap:
level: 'info'
format: 'console'
prefix: '[AKA_ZWZ]'
director: 'log'
linkName: 'latest_log'
showLine: true
encodeLevel: 'LowercaseColorLevelEncoder'
stacktraceKey: 'stacktrace'
logInConsole: true