master
kgdxpr 4 years ago
parent ad6310b2f5
commit 1207e08762

@ -3,8 +3,12 @@
<component name="ChangeListManager">
<list default="true" id="0d4ad043-ffc9-484f-90ab-0d2e603f76d4" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/go.mod" beforeDir="false" afterPath="$PROJECT_DIR$/go.mod" afterDir="false" />
<change beforePath="$PROJECT_DIR$/go.sum" beforeDir="false" afterPath="$PROJECT_DIR$/go.sum" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Business/MinIORelate/MinIORelateController/MinIORelateController.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/MinIORelate/MinIORelateController/MinIORelateController.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Utils/DbUtil/DbUtil.go" beforeDir="false" afterPath="$PROJECT_DIR$/Utils/DbUtil/DbUtil.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/build/debug.sh" beforeDir="false" afterPath="$PROJECT_DIR$/build/debug.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/build/dsCommonTools" beforeDir="false" afterPath="$PROJECT_DIR$/build/dsCommonTools" afterDir="false" />
<change beforePath="$PROJECT_DIR$/build/start.sh" beforeDir="false" afterPath="$PROJECT_DIR$/build/start.sh" afterDir="false" />
<change beforePath="$PROJECT_DIR$/build/stop.sh" beforeDir="false" afterPath="$PROJECT_DIR$/build/stop.sh" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

@ -12,6 +12,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/minio/minio-go/v6"
"net/http"
"net/url"
"path"
"strings"
"time"
@ -52,9 +53,10 @@ func getFileDownLoadUrl(c *gin.Context) {
originName := resMap["origin_name"]
storageKey := resMap["storage_key"]
storageBucket := resMap["storage_bucket"]
downloadUrl := ConfigUtil.MinioDownloadPrefix + storageBucket + "/" + storageKey
infix := "?response-content-disposition=attachment%3BfileName%2A%3DUTF-8%27%27"
downloadUrl := ConfigUtil.MinioDownloadPrefix + storageBucket + "/" + storageKey + infix + url.QueryEscape(url.QueryEscape(originName))
c.JSON(http.StatusOK, gin.H{"success": true, "download_url": downloadUrl, "origin_name": originName})
c.JSON(http.StatusOK, gin.H{"success": true, "download_url": downloadUrl})
}
@ -69,6 +71,7 @@ func saveFileInfo(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"success": false, "info": "文件id参数不允许为空"})
return
}
systemId := c.Query("systemid")
if systemId == "" {
c.JSON(http.StatusOK, gin.H{"success": false, "info": "系统ID不允许为空"})

@ -41,8 +41,8 @@ func init() {
//这段代码是黄海后加上的 2020-04-16
//通过定时ping保持鲜活
// 创建完成engine之后并没有立即连接数据库此时可以通过engine.Ping()来进行数据库的连接测试是否可以连接到数据库。
// 另外对于某些数据库有连接超时设置的可以通过起一个定期Ping的Go程来保持连接鲜活。
//创建完成engine之后并没有立即连接数据库此时可以通过engine.Ping()来进行数据库的连接测试是否可以连接到数据库。
//另外对于某些数据库有连接超时设置的可以通过起一个定期Ping的Go程来保持连接鲜活。
go func() {
for {
//https://studygolang.com/articles/12617

Binary file not shown.
Loading…
Cancel
Save