{"id":13601137,"url":"https://github.com/0xDkd/auxpi","last_synced_at":"2025-04-11T01:31:12.147Z","repository":{"id":37670863,"uuid":"156077183","full_name":"0xDkd/auxpi","owner":"0xDkd","description":"🍭 集合多家 API 的新一代图床","archived":false,"fork":false,"pushed_at":"2023-07-14T02:15:41.000Z","size":7053,"stargazers_count":2722,"open_issues_count":27,"forks_count":368,"subscribers_count":43,"default_branch":"dev","last_synced_at":"2024-11-07T03:42:57.507Z","etag":null,"topics":["api","baidu-image","cdnjs","element-ui","go","golang","image-store","mdui","rest-api","vue","weibo-image"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xDkd.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,"governance":null}},"created_at":"2018-11-04T11:56:31.000Z","updated_at":"2024-11-06T20:46:11.000Z","dependencies_parsed_at":"2023-10-21T10:00:39.047Z","dependency_job_id":null,"html_url":"https://github.com/0xDkd/auxpi","commit_stats":null,"previous_names":["aimerforreimu/auxpi"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xDkd%2Fauxpi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xDkd%2Fauxpi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xDkd%2Fauxpi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xDkd%2Fauxpi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xDkd","download_url":"https://codeload.github.com/0xDkd/auxpi/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248325086,"owners_count":21084866,"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":["api","baidu-image","cdnjs","element-ui","go","golang","image-store","mdui","rest-api","vue","weibo-image"],"created_at":"2024-08-01T18:00:56.365Z","updated_at":"2025-04-11T01:31:07.137Z","avatar_url":"https://github.com/0xDkd.png","language":"Go","funding_links":[],"categories":["Go","Repositories","Go (531)"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\n## AUXPI\n\n**集合多家 API 的新一代图床**\n\n[![Travis CI](https://travis-ci.org/aimerforreimu/auxpi.svg?branch=dev)](https://travis-ci.org/aimerforreimu/auxpi)\n[![GitHub forks](https://img.shields.io/github/forks/aimerforreimu/AUXPI.svg)](https://github.com/aimerforreimu/AUXPI/network)\n[![GitHub stars](https://img.shields.io/github/stars/aimerforreimu/AUXPI.svg)](https://github.com/aimerforreimu/AUXPI/stargazers)\n[![GitHub license](https://img.shields.io/github/license/aimerforreimu/AUXPI.svg)](https://github.com/aimerforreimu/AUXPI)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Faimerforreimu%2Fauxpi.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Faimerforreimu%2Fauxpi?ref=badge_shield)\n\n\n![Snipaste_2019-05-12_22-16-26.png](https://i.loli.net/2019/05/12/5cd82ac5cd74d.png)\n\u003c/div\u003e\n\u003cbr\u003e\n\n## 功能 特色\n\n* 支持 web 上传图片\n* 支持 API 上传图片\n* 支持分发，控制反转\n* 各种自由定制请看下面的截图\n\n    \n\n\n## 项目截图\n\n![首页](https://ws2.sinaimg.cn/large/007DFgJwgy1g10ecblh1dj31hc0nw770.jpg)\n\n![管理员后台](https://ws3.sinaimg.cn/large/007DFgJwgy1g10eavu2zqj31ha0obdii.jpg)\n\n![设置](https://ae01.alicdn.com/kf/HTB1w8QeT4jaK1RjSZFA762dLFXaS.png)\n      \n\n支持拖拽对首页的菜单进行排序和开关控制\n\n![拖拽](https://ae01.alicdn.com/kf/HTB1aWD3TYvpK1RjSZFq5jcXUVXat.gif)\n\n图片链接按照权重进行异步分发\n\n![分发](https://ae01.alicdn.com/kf/HTB1VljYTYPpK1RjSZFF5ja5PpXam.gif)\n\n首页有几个可视化的图表，方便分析\n\n![首页](https://ae01.alicdn.com/kf/HTB1yTweT4YaK1RjSZFn5ja80pXaq.gif)\n\n\n\n---\n\n**如果您感觉不错，请您点个 Star，您的 Star 是对我最大的鼓励 (认真脸)**\n\n有问题请到 Issue 中提出\n\n\n\n## 安装教程\n\n如果您是空白的 vps，您可以直接使用一键脚本进行安装，安装教程 \n\n注意此脚本会给您安装 Nginx 和 Mysql，请确保您的服务器是干净的\n\nhttps://github.com/aimerforreimu/AUXPI/wiki/%E4%B8%80%E9%94%AE%E5%AE%89%E8%A3%85%E8%84%9A%E6%9C%AC\n\n如果您想手动安装，可以参考安装 wiki\n\nhttps://github.com/aimerforreimu/AUXPI/wiki/%E5%9B%BE%E5%BA%8A%E9%85%8D%E7%BD%AE\n\n\n\n\n演示站点为 [https://test.demo-1s.com/](https://test.demo-1s.com/)\n\n请勿滥用，滥用者将被加入 ip 黑名单并且放到 github 上公示\n\n**请注意，目前已经开启图片鉴黄，且等级较高，如果试用程序请尽量上传风景图，否则有可能无法上传**\n\n演示站点管理员账户:\n```text\n用户名:admin123\n密码:admin123\n邮箱:auxpi@0w0.tn\n```\n## 分发原理\n\n![流程图](https://ae01.alicdn.com/kf/HTB1ikH2TY2pK1RjSZFs761NlXXaN.png)\n\n\n## 开发人员 \u0026\u0026 折腾用户\n\n如果您想要从源代码中构建 auxpi，您可以按照下面的教程进行构建，如果您仅仅想使用 auxpi，这一段您可以跳过\n\n请注意你，请确保您的电脑上有 Go 环境。\n### 从源码中构建\n\n#### 使用脚本构建\n\n在 [最近一次更新](https://github.com/aimerforreimu/AUXPI/commit/00e061273b6a74e0c85ed7feb744fc58d0e2c797) 中加入了批量编译打包的脚本，您可以使用此脚本进行代码的构建\n\n```bash\nbash build.sh all # 编译所有平台的程序\nbash build.sh mac # 编译 mac 程序\nbash build.sh windows # 编译 Windows 程序\nbash build.sh linux #编译 linux 程序\nbash build.sh all 2.2.0 clear # 编译程序，分别打包所有的平台的项目，2.2.0 为版本号，清空编译以后文件，只保留压缩包\nbahs build.sh help #查看帮助\n```\n\n打包前端\n\n```bash\ncd resource\nyarn install\nyarn run build\n```\n\n\n#### 使用 Bee 工具运行程序\n```bash\ncd $GOPATH/src\ngit clone git@github.com:aimerforreimu/AUXPI.git\ncd AUXPI/\nbee run auxpi\n```\n\n#### 交叉编译\n \n```bash\n#Mac/Windows环境编译成 Linux 程序 \nGOOS=linux GOARCH=amd64 bee pack \n#Mac/Linux 环境编译 Windows 程序\nGOOS=windows GOARCH=amd64 bee pack\n#Windows/Linux 编译 Mac 程序\nGOOS=darwin GOARCH=amd64 bee pack\n``` \n更多交叉编译请参考 [Go 交叉编译](https://www.jianshu.com/p/4b345a9e768e)\n\n### 二次开发规范\n\n如果这个项目让您感觉还不错，您想二次开发一下或者想为这个项目提交 PR\n\n##### 1.命名规范\n* 函数，私有变量必须采用小驼峰方式进行命名 即 `sendMail()`,`userInfo` \n\n* 共有变量需要使用**大驼峰**方式命名\n\n* 结构体,接口必须使用**大驼峰**方式进行命名\n\n##### 2.代码组织\n\n最好请按照这个下面说明的结构去组织您的代码\n\n* 中间件请存放在 `middleware` 文件夹中\n\n* api 请按照版本号放在 `controller/api/v(0-9)/`中，所有 api 除去 `auth` 都不能进行模板引擎的渲染和操作，只允许输出 `json`\n\n* 如果需要渲染模板引擎，请直接在 `controller/` 下面建立对应的 controller\n\n* `utils` 下面的各种工具文件不允许与 `models` 下面的文件耦合在一起，如果要为 `models` 编写工具，请放到 `tools` 下\n\n* `all.go` 中只允许写入经常被引入，需要格式化成 `json` , `xml` 等格式的结构体  \n\n\n```text\n.\n├── LICENSE\n├── README.md\n├── auxpiAll\n├── bootstrap\n├── build\n├── build.sh\n├── conf\n├── controllers\n├── install.sh\n├── log\n├── main.go\n├── middleware\n├── models\n├── pem\n├── resource\n├── routers\n├── server\n├── static\n├── tests\n├── tools\n├── utils\n└── views\n\n```\n\n## API 上传\n\n\n\n### API 上传实例\n\n**图片上传 V1 接口**\n\n| 功能 | 图片上传接口 |\n| --- | --- |\n| HTTP 请求方式 |  POST |\n| URL  | http://yourname/api/v1/upload |\n\n**请求参数**\n\n| 参数名称 | 类型 | 是否必须|描述|\n| --- | --- |---| --- |\n| image | File | 是 | 表单名称,上传图片|\n| token  | String | 是 | 认证所必须的 token ，如果站在没有开启则留空即可 |\n| apiSelect  | String | 是 | 所选择的 API 类型 |\n\n**apiSelect可选参数**\n\n| apiSelect 可选参数 | 参数说明\n| --- | ---|\n| SouGou| 搜狗图床|\n|Sina|新浪图床|\n|Smms|SMMS 图床|\n\n\n**成功上传返回**\n\n```json\n{\n    \"code\": 200,\n    \"msg\": \"上传成功\",\n    \"data\": {\n        \"name\": \"Snipaste_2018-08-28_01-17-58.png\",\n        \"url\": \"https://img04.sogoucdn.com/app/a/100520146/0dcb98aadb59c6b29dc0832eb7cc094a\"\n    }\n}\n\n```\n\n```json\n{\n    \"code\": 200,\n    \"msg\": \"上传成功\",\n    \"data\": {\n        \"name\": \"Snipaste_2018-08-28_01-17-58.png\",\n        \"url\": \"https://i.loli.net/2018/11/05/5be038b1b4af6.png\"\n    }\n}\n```\n\n**失败返回值**\n\n上传出错返回值\n\n```json\n{\n    \"code\": 500,\n    \"msg\": \"上传失败\"\n}\n```\n\nAPI 未开启返回值\n\n```json\n{\n    \"code\": 405,\n    \"msg\": \"Method not allowed\"\n}\n```\n Token 验证失败返回值\n \n```json\n{\n    \"code\": 403,\n    \"msg\": \"Forbidden\"\n}\n```\n\n选择文件为空返回值\n\n```json\n\n{\n    \"code\": 500,\n    \"msg\": \"No files were uploaded.\"\n}\n\n```\n\n文件太大返回值\n\n```json\n\n{\n    \"code\": 500,\n    \"msg\": \"File is too large.\"\n}\n\n```\n\n## TODO \n\n* [x] API 上传\n\n* [x] API v2 版本分发上传,返回所有图床储存链接 \n\n* [x] 用户系统\n\n* [x] 前后端分离,Vue 驱动前端\n\n* [x] 后台控制\n\n* [x] 本地上传，各大平台对接储存\n\n* [x] 使用 MySQL 而不是 JSON\n\n* [ ] API 自动文档\n\n* [ ] 国际化\n\n* [ ] 多缓存选择 Memory|redis|file|Memcached\n\n* [ ] 用户后台重构\n\n* [ ] 定时任务调度\n\n## 说明\n\n本项目是学习 Go 的过程中，边学边写出来的程序，可能存在 bug 连篇 ，逻辑让人无法接受，南辕北辙，代码无法让人直视等副作用。\n\n## 致敬\n[@ astaxie](https://github.com/astaxie) (beego)\n\n[@ PanJiaChen](https://github.com/PanJiaChen) (vue-element-admin)\n\n[@ metowolf](https://github.com/metowolf/upimg-cli) (upimg-cli)\n\n[@ wisp-x](https://github.com/wisp-x) (lsky-pro)\n\n\n\n## LICENSE\n\nGNU General Public License v3.0\n\n\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Faimerforreimu%2Fauxpi.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Faimerforreimu%2Fauxpi?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xDkd%2Fauxpi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xDkd%2Fauxpi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xDkd%2Fauxpi/lists"}