鲁阿特河
Projeto de teste,com est ud mais sobre Go e GraphQL。
开发设置
转到Google翻译:GORM,graphql-go。 Utilizando um banco de dados Postgres。
Para rodar o servidor,simplesmente rodar dentro da意大利面server :
go run main.go
利用localhost:8000/graphql使用localhost:8000
开始
启动
go run main.go
生成api文档
swag init
访问
使用air启动
安装空气
go get -v github.com/cosmtrek/air/cmd/...
创建.air.conf文件
可以复制里面的air.conf.example内容
启动
根目录下
air
遇到的一些问题
如何方式gorm save的时候覆盖create_at细分
db.Save(&user)会共同更新created_at。为了使created_at细分的值不被重置,可以使用省略忽略前缀。