{"id":23388251,"url":"https://github.com/opensourceai/go-api-service","last_synced_at":"2026-03-14T17:36:57.520Z","repository":{"id":57545402,"uuid":"243944220","full_name":"opensourceai/go-api-service","owner":"opensourceai","description":"基于Gin构建的土拨鼠社区基础服务","archived":false,"fork":false,"pushed_at":"2020-03-28T07:34:41.000Z","size":10619,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-11T06:33:44.021Z","etag":null,"topics":["gin","go","hive","opensourceai"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opensourceai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-29T09:57:47.000Z","updated_at":"2020-03-28T07:34:44.000Z","dependencies_parsed_at":"2022-09-17T05:10:15.378Z","dependency_job_id":null,"html_url":"https://github.com/opensourceai/go-api-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/opensourceai/go-api-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceai%2Fgo-api-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceai%2Fgo-api-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceai%2Fgo-api-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceai%2Fgo-api-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opensourceai","download_url":"https://codeload.github.com/opensourceai/go-api-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opensourceai%2Fgo-api-service/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261704429,"owners_count":23197161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gin","go","hive","opensourceai"],"created_at":"2024-12-22T02:18:21.430Z","updated_at":"2026-03-14T17:36:52.484Z","avatar_url":"https://github.com/opensourceai.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go API Service\n**基于Gin构建的土拨鼠社区基础服务**\n\n[![Go](https://github.com/opensourceai/go-api-service/workflows/Go/badge.svg)](https://github.com/opensourceai/go-api-service/actions)\n\n## How to run\n\n### Required\n\n- Mysql:线上已部署\n- Redis \n\u003e 本地部署.使用`test/docker-compose.yaml`本地部署\n\n### Conf\n\n配置文件 `conf/app.ini`\n\n```\n[database]\nType = mysql\nUser = root\nPassword = root \nHost = 127.0.0.1:3306\nName = blog\nTablePrefix = blog_\n\n[redis]\nHost = 127.0.0.1:6379\nPassword =\nMaxIdle = 30\nMaxActive = 30\nIdleTimeout = 200\n...\n```\n配置环境变量\n\n- GO111MODULE=on\n- GOPROXY=https://goproxy.io\n\n### Run\n```\n$ cd c/go-api-service\n\n$ go run main.go \n```\n\n项目信息和现有API\n\n```\n[info] replacing callback `gorm:update_time_stamp` from D:/opensourceai/go-api-service/dao/mysql/dao.go:32\n[info] replacing callback `gorm:update_time_stamp` from D:/opensourceai/go-api-service/dao/mysql/dao.go:33\n[info] replacing callback `gorm:delete` from D:/opensourceai/go-api-service/dao/mysql/dao.go:34\n[GIN-debug] [WARNING] Running in \"debug\" mode. Switch to \"release\" mode in production.\n - using env:\texport GIN_MODE=release\n - using code:\tgin.SetMode(gin.ReleaseMode)\n\n[GIN-debug] GET    /export/*filepath         --\u003e github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)\n[GIN-debug] HEAD   /export/*filepath         --\u003e github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)\n[GIN-debug] GET    /upload/images/*filepath  --\u003e github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)\n[GIN-debug] HEAD   /upload/images/*filepath  --\u003e github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)\n[GIN-debug] GET    /qrcode/*filepath         --\u003e github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)\n[GIN-debug] HEAD   /qrcode/*filepath         --\u003e github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (3 handlers)\n[GIN-debug] GET    /auth                     --\u003e github.com/opensourceai/go-api-service/routers/api.GetAuth (3 handlers)\n[GIN-debug] GET    /swagger/*any             --\u003e github.com/swaggo/gin-swagger.WrapHandler.func1 (3 handlers)\n[GIN-debug] POST   /upload                   --\u003e github.com/opensourceai/go-api-service/routers/api.UploadImage (3 handlers)\n[info] start http server listening :8000\n\n```\n## Swagger\n```shell script\nswag init # 生成文档\n```\nSwagger doc: http://localhost:8000/swagger/index.html\n\n## Test Api\n```\n[GET] /auth Get Auth\n```\n- userName:hive\n- password:hive\n\n## Dev\n1. fork repository\n2. clone repository\n   ```shell script\n   # [git@github.com:chenquan/go-api-service.git]为自己账户下仓库地址\n   git clone git@github.com:chenquan/go-api-service.git\n   cd go-api-service \n   ```\n3. 开发新功能前必须拉去主库代码到本地master\n    \n    1. 新建远程库连接(`只需第一次clone之后设置`)\n    ```shell script\n     git remote add opensourceai git@github.com:opensourceai/go-api-service.git\n    ```\n    2. 拉取主库最新master代码到本地master\n    ```shell script\n    git pull opensourceai master:master --rebase -f\n    ```\n4. 开发新功能/修改\n    1. 从本地master分支新建出`feature-*`（`fix-*`）分支（`*`表示对应新功能名称）\n    2. 开发完毕之后，push到自己账号下的仓库\n    3. 通过PR使用squash方式合并到主库\n5. 后续开发循环`3`,`4`\n   \n   \n## Features\n\n- RESTful API\n- Gorm\n- Swagger\n- logging\n- Jwt-go\n- Gin\n- Graceful restart or stop (fvbock/endless)\n- App configurable\n- Cron\n- Redis\n\n## Tools\n\n- GoLand\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensourceai%2Fgo-api-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopensourceai%2Fgo-api-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopensourceai%2Fgo-api-service/lists"}