A new generation image bed that integrates multiple APIs
Supports drag and drop to sort and switch the menu on the homepage
Image links are distributed asynchronously according to weight
There are several visual charts on the homepage to facilitate analysis.
If you feel good, please click a star. Your star is the greatest encouragement to me (serious face)
If you have any questions, please submit them in Issue
If you have a blank vps, you can directly use the one-click script to install it. Installation tutorial
Note that this script will install Nginx and Mysql for you, please make sure your server is clean
https://github.com/aimerforreimu/AUXPI/wiki/%E4%B8%80%E9%94%AE%E5%AE%89%E8%A3%85%E8%84%9A%E6%9C%AC
If you want to install manually, you can refer to the installation wiki
https://github.com/aimerforreimu/AUXPI/wiki/%E5%9B%BE%E5%BA%8A%E9%85%8D%E7%BD%AE
The demo site is https://test.demo-1s.com/
Please do not abuse, abusers will be added to the IP blacklist and posted on github.
Please note that picture porn detection is currently enabled and the level is relatively high. If you are trying out the program, please try to upload landscape pictures, otherwise you may not be able to upload them.
Demo site administrator account:
用户名:admin123
密码:admin123
邮箱:[email protected]
If you want to build auxpi from source code, you can follow the tutorial below to build it. If you just want to use auxpi, you can skip this section.
Note to you, please make sure you have a Go environment on your computer.
A batch compilation and packaging script has been added in the latest update. You can use this script to build the code.
bash build.sh all # 编译所有平台的程序
bash build.sh mac # 编译 mac 程序
bash build.sh windows # 编译 Windows 程序
bash build.sh linux #编译 linux 程序
bash build.sh all 2.2.0 clear # 编译程序,分别打包所有的平台的项目,2.2.0 为版本号,清空编译以后文件,只保留压缩包
bahs build.sh help #查看帮助
Packaging front-end
cd resource
yarn install
yarn run build
cd $GOPATH /src
git clone [email protected]:aimerforreimu/AUXPI.git
cd AUXPI/
bee run auxpi
# Mac/Windows环境编译成 Linux 程序
GOOS=linux GOARCH=amd64 bee pack
# Mac/Linux 环境编译 Windows 程序
GOOS=windows GOARCH=amd64 bee pack
# Windows/Linux 编译 Mac 程序
GOOS=darwin GOARCH=amd64 bee pack
For more cross-compilation, please refer to Go cross-compilation
If this project makes you feel good, you want to develop it again or submit a PR for this project
Functions and private variables must be named using CamelCase, i.e. sendMail()
, userInfo
Shared variables need to be named using camel case
Structures and interfaces must be named using camel case.
It is best to organize your code according to the structure explained below
Please store middleware in the middleware
folder
Please put the api in controller/api/v(0-9)/
according to the version number. All apis except auth
cannot render and operate the template engine, and only allow the output of json
If you need to render the template engine, please create the corresponding controller directly under controller/
Various tool files under utils
are not allowed to be coupled with files under models
. If you want to write tools for models
, please put them under tools
all.go
only allows writing, which is often introduced and needs to be formatted into a structure in json
, xml
and other formats.
.
├── LICENSE
├── README.md
├── auxpiAll
├── bootstrap
├── build
├── build.sh
├── conf
├── controllers
├── install.sh
├── log
├── main.go
├── middleware
├── models
├── pem
├── resource
├── routers
├── server
├── static
├── tests
├── tools
├── utils
└── views
Image upload V1 interface
Function | Image upload interface |
---|---|
HTTP request method | POST |
URL | http://yourname/api/v1/upload |
Request parameters
Parameter name | type | Is it necessary | describe |
---|---|---|---|
image | File | yes | Form name, upload image |
token | String | yes | The token required for authentication. If the site is not enabled, just leave it blank. |
apiSelect | String | yes | Selected API type |
apiSelect optional parameters
apiSelect optional parameters | Parameter description |
---|---|
SouGou | Sogou picture bed |
Sina | Sina picture bed |
Smms | SMMS picture bed |
Successful upload returns
{
"code" : 200 ,
"msg" : "上传成功" ,
"data" : {
"name" : " Snipaste_2018-08-28_01-17-58.png " ,
"url" : " https://img04.sogoucdn.com/app/a/100520146/0dcb98aadb59c6b29dc0832eb7cc094a "
}
}
{
"code" : 200 ,
"msg" : "上传成功" ,
"data" : {
"name" : " Snipaste_2018-08-28_01-17-58.png " ,
"url" : " https://i.loli.net/2018/11/05/5be038b1b4af6.png "
}
}
Failure return value
Upload error return value
{
"code" : 500 ,
"msg" : "上传失败"
}
API is not enabled return value
{
"code" : 405 ,
"msg" : " Method not allowed "
}
Token verification failure return value
{
"code" : 403 ,
"msg" : " Forbidden "
}
Select file is empty return value
{
"code" : 500 ,
"msg" : " No files were uploaded. "
}
File too large return value
{
"code" : 500 ,
"msg" : " File is too large. "
}
API upload
API v2 version distribution and upload, return all image bed storage links
User system
Separation of front and rear ends, Vue drives the front end
background control
Local upload, docking and storage on major platforms
Use MySQL instead of JSON
API automatic documentation
internationalization
For multiple caches, select Memory|redis|file|Memcached
User background reconstruction
Scheduled tasks
This project is a program written while learning Go. It may have side effects such as bugs, unacceptable logic, completely different ideas, and code that cannot be viewed directly.
@astaxie (beego)
@PanJiaChen (vue-element-admin)
@metowolf (upimg-cli)
@wisp-x (lsky-pro)
GNU General Public License v3.0