项目作者: wl05

项目描述 :
博客系统,gin、casbin、jwt、restful api。
高级语言: Go
项目地址: git://github.com/wl05/ant-forum-admin.git
创建时间: 2019-10-19T13:55:46Z
项目社区:https://github.com/wl05/ant-forum-admin

开源协议:

下载


start

启动

  1. go run main.go

生成api文档

  1. swag init

访问 http://localhost:8080/swagger/index.html

使用air启动

  1. 安装air

    1. go get -v github.com/cosmtrek/air/cmd/...
  2. 创建.air.conf文件

可以复制 https://github.com/cosmtrek/air 里面的air.conf.example内容

  1. 启动

根目录下

  1. air

遇到的一些问题

  1. 如何方式gorm save的时候覆盖create_at 字段

db.Save(&user)会一同更新created_at。为了使created_at字段的值不被重置,可以使用Omit忽略字段。即:db.Omit(“created_at”).Save(&user)