一、腾讯云对象存储COS
1. 创建储存桶
然后直接下一步-创建即可。
2. API密钥创建
3...."github.com/gin-gonic/gin"
"log"
"net/http"
)
// Upload
// @Summary Upload
// @Description 腾讯云上传图片...= "image/gif" {
log.Println("上传图片非jpg,png,jpeg,gif,请重新上传!")...c.JSON(http.StatusBadRequest, gin.H{
"msg": "上传失败,图片非jpg,png,jpeg,gif,请重新上传!"..., gin.H{
"msg": "上传图片大于2M,请重新上传",
})
return
} else {
f, err := file.Open()
if err !