- 进入目录安装依赖
cd bus_api
go mod tidy
- 复制配置文件
cp core/etc/core-api.yaml.example core/etc/core-api.yaml
-
导入数据库 database/core.sql
-
运行服务
go run core/core.go -f core/etc/core-api.yaml
- 启动后浏览器访问 http://localhost:9999 ,如果需更改启动端口,可在 core-api.yaml 文件中配置。
使用 go-zero 官方的工具生成代码:
goctl api go -api core.api -dir . -style go_zero