{"id":20358685,"url":"https://github.com/gopherlinzy/gin-gorm-example","last_synced_at":"2025-10-07T02:14:17.958Z","repository":{"id":62866102,"uuid":"515877997","full_name":"Gopherlinzy/gin-gorm-example","owner":"Gopherlinzy","description":"简单的gin-gorm的例子","archived":false,"fork":false,"pushed_at":"2022-08-13T03:45:12.000Z","size":27698,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-23T15:42:18.538Z","etag":null,"topics":["api","docker","endless","gin","go","gorm","jwt","swagger"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gopherlinzy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-20T07:26:59.000Z","updated_at":"2025-08-12T04:48:44.000Z","dependencies_parsed_at":"2022-11-08T06:45:45.401Z","dependency_job_id":null,"html_url":"https://github.com/Gopherlinzy/gin-gorm-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Gopherlinzy/gin-gorm-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gopherlinzy%2Fgin-gorm-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gopherlinzy%2Fgin-gorm-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gopherlinzy%2Fgin-gorm-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gopherlinzy%2Fgin-gorm-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gopherlinzy","download_url":"https://codeload.github.com/Gopherlinzy/gin-gorm-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gopherlinzy%2Fgin-gorm-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278708004,"owners_count":26031932,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","docker","endless","gin","go","gorm","jwt","swagger"],"created_at":"2024-11-14T23:28:18.792Z","updated_at":"2025-10-07T02:14:17.931Z","avatar_url":"https://github.com/Gopherlinzy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gin-gorm-example\n这是一个简单的gin-gorm API项目，有很多有用的特性\n\n## 安装\n```\ngo get github.com/Gopherlinzy/gin-gorm-example\n```\n\n# 如何运行\n***\n## 需要\n- Mysql\n- go\n\n## 准备\n创建一个新的 blog 数据库,代码里有自动迁移数据表,会自动创建数据表\n\n## 配置\n修改 conf/app.ini 配置文件\n\n```\n[database]\nType = mysql\nUser = 数据库名称\nPassword = 数据库密码\n//数据库的IP地址\nHost = 127.0.0.1:3306\n//数据库名称 \nName = blog\nTablePrefix = blog_\n```\n\n## 运行\n```\n//进入到项目的里\ncd $GOPATH/src/go-gin-example\n//运行main文件\ngo run main.go \n```\n\n显示项目运行信息和创建的API\n```\n[GIN-debug] [WARNING] Running in \"debug\" mode. Switch to \"release\" mode in production.\n - using env:   export GIN_MODE=release\n - using code:  gin.SetMode(gin.ReleaseMode)\n\n[GIN-debug] GET    /auth                     --\u003e github.com/Gopherlinzy/go-gin-example/routers/api.GetAuth (3 handlers)\n[GIN-debug] GET    /api/v1/tags              --\u003e github.com/Gopherlinzy/go-gin-example/routers/api/v1.GetTags (4 handlers)\n[GIN-debug] POST   /api/v1/tags              --\u003e github.com/Gopherlinzy/go-gin-example/routers/api/v1.AddTag (4 handlers)\n[GIN-debug] PUT    /api/v1/tags/:id          --\u003e github.com/Gopherlinzy/go-gin-example/routers/api/v1.EditTag (4 handlers)\n[GIN-debug] DELETE /api/v1/tags/:id          --\u003e github.com/Gopherlinzy/go-gin-example/routers/api/v1.DeleteTag (4 handlers)\n[GIN-debug] GET    /api/v1/articles          --\u003e github.com/Gopherlinzy/go-gin-example/routers/api/v1.GetArticles (4 handlers)\n[GIN-debug] GET    /api/v1/articles/:id      --\u003e github.com/Gopherlinzy/go-gin-example/routers/api/v1.GetArticle (4 handlers)\n[GIN-debug] POST   /api/v1/articles          --\u003e github.com/Gopherlinzy/go-gin-example/routers/api/v1.AddArticle (4 handlers)\n[GIN-debug] PUT    /api/v1/articles/:id      --\u003e github.com/Gopherlinzy/go-gin-example/routers/api/v1.EditArticle (4 handlers)\n[GIN-debug] DELETE /api/v1/articles/:id      --\u003e github.com/Gopherlinzy/go-gin-example/routers/api/v1.DeleteArticle (4 handlers)\n[GIN-debug] GET    /swagger/*any             --\u003e github.com/swaggo/gin-swagger.CustomWrapHandler.func1 (3 handlers)\n```\n\n# Swagger 文档\n![image](https://user-images.githubusercontent.com/109471496/184467177-239dbd7c-0b3d-4a79-abff-bc8fd0dc678f.png)\n\n# 特性\n- RESTful API\n- Gin\n- jwt-go\n- Gorm\n- Swagger\n- logging\n- Graceful restart or stop (fvbock/endless)\n- App configurable\n- Docker\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopherlinzy%2Fgin-gorm-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgopherlinzy%2Fgin-gorm-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopherlinzy%2Fgin-gorm-example/lists"}