An open API service indexing awesome lists of open source software.

https://github.com/cloud-org/go-zero-gin-template

go-zero gin template for user
https://github.com/cloud-org/go-zero-gin-template

api gin go go-zero

Last synced: 2 months ago
JSON representation

go-zero gin template for user

Awesome Lists containing this project

README

          

**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [go-zero-gin-template](#go-zero-gin-template)
- [run](#run)
- [test](#test)
- [docker](#docker)

### go-zero-gin-template

一个 go-zero gin web 模板

#### run

```sh
go mod tidy
cd api && go run api.go
```

#### test

```
[GIN-debug] GET /v1/hello --> go-zero-gin-template/api/internal/handler.(*Handler).ReflectHandler.func1 (4 handlers)
{"@timestamp":"2022-06-08T15:45:16.871+08:00","caller":"api/api.go:73","content":"server is start at: 0.0.0.0:9097","level":"info"}
```

```
$ curl http://127.0.0.1:9097/v1/hello\?name\=ashing
{"errMsg":"","errCode":0,"data":"hello, ashing"}%
```

#### docker

```sh
make docker-build-api version=v0.0.1
```

```sh
make docker-run-api version=v0.0.1
```