{"id":36457267,"url":"https://github.com/bugfan/gin-xorm-frame","last_synced_at":"2026-01-11T23:05:40.571Z","repository":{"id":112803030,"uuid":"192711066","full_name":"bugfan/gin-xorm-frame","owner":"bugfan","description":"gin xorm-mysql scafflod go web 快速开发脚手架 集成了redis、mysql、mongodb、influxdb相关库","archived":false,"fork":false,"pushed_at":"2019-09-05T01:16:43.000Z","size":366,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T18:46:57.002Z","etag":null,"topics":[],"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/bugfan.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-19T10:29:26.000Z","updated_at":"2020-02-25T03:58:43.000Z","dependencies_parsed_at":"2023-04-20T18:47:01.018Z","dependency_job_id":null,"html_url":"https://github.com/bugfan/gin-xorm-frame","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bugfan/gin-xorm-frame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfan%2Fgin-xorm-frame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfan%2Fgin-xorm-frame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfan%2Fgin-xorm-frame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfan%2Fgin-xorm-frame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugfan","download_url":"https://codeload.github.com/bugfan/gin-xorm-frame/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugfan%2Fgin-xorm-frame/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28326200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T22:11:01.104Z","status":"ssl_error","status_checked_at":"2026-01-11T22:10:58.990Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-11T23:05:35.753Z","updated_at":"2026-01-11T23:05:40.562Z","avatar_url":"https://github.com/bugfan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## golang web开发脚手架,集成了redis,mongo,influxdb数据库相关api(这个框架超级好用,强烈推荐)\n\n### 介绍\n1. 采用　gin + xorm 自动生成增删改查api，可重写增删改查api函数　\n2. golang的orm库中xorm是本人觉得比较好用的，语法都很清晰(本人最开始用beego/orm和gorm现在转xorm了)，文档地址 http://www.xorm.io/\n3. 程序启动的默认配置都在setting包下面，setting优先从环境变量里面读取配置\n4. docker-compose文件夹下面有常用的一些组件的docker-compose.yml以及相关配置，可以直接使用，或者自行更改配置\n5. main函数中注释的部分需要根据本地数据库情况来链接，暂时只放开了mysql链接 (配置从setting包里面看默认配置，稍微更改即可链接成功)\n![avatar](./img/note-code.png)\n\n## 使用\n1. 切换的此目录\n2. go run main.go  #如果启动顺利可以看到下面打印，如果失败请检查数据库链接配置，在setting包下面\n![avatar](./img/run-state.png)\n3. 如果需要链接其他数据库，在main.go里面把相关db链接代码注释放开即可\n4. 在api文件夹下面加入controllers代码 \n5. 在models文件下面加入models文件\n6. 相关的工具类和方法在utils包下面添加\n7. 程序启动后在未登录情况下，调用接口一律报401。【sign_in(POST请求)，sign_out(POST请求),user_info(Get请求)】除外\n8. 启动后初始化账号密码写入当前目录 `default_pass` 文件中,如果想增加管理员账号，在接口中调用models.Admin下面的api\n9. 需要先调用 `xxxxx/api/sign_in` 进行登录,参数如下:\n```\n{\n\t\"Username\":\"admin\",\n\t\"Password\":\"ladfjianfalen\"\n}\n```\n登录成功之后可以看到cookie已经写入客户端(我用的是postman)\n![avatar](./img/postman.png)\n登录之后可以调用其他接口了\n![avatar](./img/postman1.png)\n10. jwt过期时间在utils.cookie文件里设置 \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugfan%2Fgin-xorm-frame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugfan%2Fgin-xorm-frame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugfan%2Fgin-xorm-frame/lists"}