From b69141f64ec925a89a486191a58a08dddfe53786 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com>
Date: Tue, 17 Aug 2021 16:08:38 +0800
Subject: [PATCH 1/3] 'commit'
---
dsSzxy/.idea/workspace.xml | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/dsSzxy/.idea/workspace.xml b/dsSzxy/.idea/workspace.xml
index 2923a0bf..c1a0f318 100644
--- a/dsSzxy/.idea/workspace.xml
+++ b/dsSzxy/.idea/workspace.xml
@@ -4,11 +4,7 @@
-
-
-
-
-
+
From d7e947bd1bac79442ea2f3dd3823c38ae88978cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com>
Date: Fri, 20 Aug 2021 08:04:58 +0800
Subject: [PATCH 2/3] 'commit'
---
.gitignore | 1 -
.../ControllerOauth2/ControllerOauth2.go | 32 +++++----
dsSzxy/.idea/workspace.xml | 68 ++++---------------
3 files changed, 29 insertions(+), 72 deletions(-)
diff --git a/.gitignore b/.gitignore
index f00124b6..628bb972 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,5 +48,4 @@
/dsSzxy/.idea/
/dsSzxy/build/
/dsSzxy/WinBuild/
-
*.log
\ No newline at end of file
diff --git a/dsSso/Controller/ControllerOauth2/ControllerOauth2.go b/dsSso/Controller/ControllerOauth2/ControllerOauth2.go
index 5a3b0736..23f420a4 100644
--- a/dsSso/Controller/ControllerOauth2/ControllerOauth2.go
+++ b/dsSso/Controller/ControllerOauth2/ControllerOauth2.go
@@ -505,21 +505,23 @@ func logout(context *gin.Context) {
//获取所有接入系统的
list, _ := ServiceJoinApp.GetAppBaseList(1, Const.Int32Max, "")
for i := range list {
- //每个系统的退出地址
- logoutUri := list[i]["logout_uri"].(string)
- //如果注册了退出地址的话
- if len(logoutUri) > 0 {
- //开启协程进行调用
- go func() {
- resp, err := http.Get(logoutUri + "?access_token=" + accessToken)
- if err != nil {
- fmt.Println(err)
- return
- }
- defer resp.Body.Close()
- body, _ := ioutil.ReadAll(resp.Body)
- fmt.Println(string(body))
- }()
+ if list[i]["logout_uri"] != nil {
+ //每个系统的退出地址
+ logoutUri := list[i]["logout_uri"].(string)
+ //如果注册了退出地址的话
+ if len(logoutUri) > 0 {
+ //开启协程进行调用
+ go func() {
+ resp, err := http.Get(logoutUri + "?access_token=" + accessToken)
+ if err != nil {
+ fmt.Println(err)
+ return
+ }
+ defer resp.Body.Close()
+ body, _ := ioutil.ReadAll(resp.Body)
+ fmt.Println(string(body))
+ }()
+ }
}
}
//清除cookie
diff --git a/dsSzxy/.idea/workspace.xml b/dsSzxy/.idea/workspace.xml
index 919bac7b..c8f48722 100644
--- a/dsSzxy/.idea/workspace.xml
+++ b/dsSzxy/.idea/workspace.xml
@@ -1,81 +1,54 @@
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
-
-
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
-
-
-
-
-
@@ -83,24 +56,7 @@
-
-
-
-
-
-
true
-
-
-
\ No newline at end of file
From b284af1d0d62dcf40fe3f0c4e27e63dcaeaae12f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com>
Date: Mon, 23 Aug 2021 09:27:46 +0800
Subject: [PATCH 3/3] commit
---
dsSzxy/.idea/workspace.xml | 2 +-
.../FileReleateController.go | 79 ++++++++++++++++++-
2 files changed, 79 insertions(+), 2 deletions(-)
diff --git a/dsSzxy/.idea/workspace.xml b/dsSzxy/.idea/workspace.xml
index c8f48722..07288c1e 100644
--- a/dsSzxy/.idea/workspace.xml
+++ b/dsSzxy/.idea/workspace.xml
@@ -5,8 +5,8 @@
-
+
diff --git a/dsSzxy/Business/FileRelate/FileRelateController/FileReleateController.go b/dsSzxy/Business/FileRelate/FileRelateController/FileReleateController.go
index 023b3c7b..f9921d7d 100644
--- a/dsSzxy/Business/FileRelate/FileRelateController/FileReleateController.go
+++ b/dsSzxy/Business/FileRelate/FileRelateController/FileReleateController.go
@@ -55,6 +55,12 @@ func Routers(r *gin.RouterGroup) {
// @X-IntRangeLimit [{"identity_id":"5"},{"person_id":"1,999999999999"},{"target_group_id":"-1,999999999999"},{"target_identity_id":"5"},{"target_person_id":"1,999999999999"},{"system_id":"1,20"}]
// @X-TableName ["t_zhxy_file"]
func fileUpload(c *gin.Context) {
+ //异常处理
+ defer func() {
+ if err := recover(); err != nil {
+ fmt.Printf("%s\n", err)
+ }
+ }()
file, err := c.FormFile("file")
if err != nil {
c.String(http.StatusBadRequest, fmt.Sprintf("get form err: %s", err.Error()))
@@ -107,7 +113,7 @@ func fileUpload(c *gin.Context) {
targetIdentityId := CommonUtil.ConvertStringToInt32(c.PostForm("target_identity_id")) //目标人身份ID
targetPersonId := CommonUtil.ConvertStringToInt32(c.PostForm("target_person_id")) //目标人员ID
systemId := CommonUtil.ConvertStringToInt32(c.PostForm("system_id")) //系统id
- FileRelateDao.FileRecord(uuid,filename, identityId, personId, targetGroupId, targetIdentityId, targetPersonId, systemId, int32(size), ext)
+ FileRelateDao.FileRecord(uuid, filename, identityId, personId, targetGroupId, targetIdentityId, targetPersonId, systemId, int32(size), ext)
//返回
s := FileRelateDao.GetFileDownLoadUrl(trueName[0:2]+"/"+trueName, file.Filename)
@@ -175,6 +181,13 @@ func fileUpload(c *gin.Context) {
// @X-EmptyLimit ["file_id","file_name"]
// @X-TableName ["t_zhxy_file"]
func fileUpdate(c *gin.Context) {
+ //异常处理
+ defer func() {
+ if err := recover(); err != nil {
+ fmt.Printf("%s\n", err)
+ }
+ }()
+
fileId := c.PostForm("file_id")
fileName := c.PostForm("file_name")
FileRelateDao.FileUpdate(fileId, fileName)
@@ -201,6 +214,13 @@ func fileUpdate(c *gin.Context) {
// @X-IntRangeLimit [{"source_identity_id":"5"},{"source_person_id":"1,999999999999"},{"target_group_id":"-1,999999999999"},{"target_identity_id":"5"},{"target_person_id":"1,999999999999"}]
// @X-TableName ["t_zhxy_file"]
func fileCopy(c *gin.Context) {
+ //异常处理
+ defer func() {
+ if err := recover(); err != nil {
+ fmt.Printf("%s\n", err)
+ }
+ }()
+
fileId := c.PostForm("file_id")
sourceIdentityId := CommonUtil.ConvertStringToInt32(c.PostForm("source_identity_id"))
sourcePersonId := CommonUtil.ConvertStringToInt32(c.PostForm("source_person_id"))
@@ -237,6 +257,13 @@ func fileCopy(c *gin.Context) {
// @X-IntRangeLimit [{"identity_id":"5"},{"person_id":"1,999999999999"}]
// @X-TableName ["t_zhxy_clouddisk_tree"]
func addNode(c *gin.Context) {
+ //异常处理
+ defer func() {
+ if err := recover(); err != nil {
+ fmt.Printf("%s\n", err)
+ }
+ }()
+
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
parentId := c.PostForm("parent_id") //根传入-1
@@ -267,6 +294,13 @@ func addNode(c *gin.Context) {
// @Router /dsSzxy/fileRelate/updateNode [post]
// @X-TableName ["t_zhxy_clouddisk_tree"]
func updateNode(c *gin.Context) {
+ //异常处理
+ defer func() {
+ if err := recover(); err != nil {
+ fmt.Printf("%s\n", err)
+ }
+ }()
+
nodeName := c.PostForm("nodeName")
nodeId := c.PostForm("node_id")
success, err := FileRelateDao.UpdateNode(nodeId, nodeName)
@@ -294,6 +328,13 @@ func updateNode(c *gin.Context) {
// @Router /dsSzxy/fileRelate/delNode [post]
// @X-TableName ["t_zhxy_clouddisk_tree"]
func delNode(c *gin.Context) {
+ //异常处理
+ defer func() {
+ if err := recover(); err != nil {
+ fmt.Printf("%s\n", err)
+ }
+ }()
+
nodeId := c.PostForm("node_id")
success, err := FileRelateDao.DelNode(nodeId)
if err != nil {
@@ -321,6 +362,13 @@ func delNode(c *gin.Context) {
// @Router /dsSzxy/fileRelate/addNodeFile [post]
// @X-TableName ["t_zhxy_clouddisk_tree"]
func addNodeFile(c *gin.Context) {
+ //异常处理
+ defer func() {
+ if err := recover(); err != nil {
+ fmt.Printf("%s\n", err)
+ }
+ }()
+
nodeId := c.PostForm("node_id")
fileId := c.PostForm("file_id")
success, err := FileRelateDao.AddNodeFile(nodeId, fileId)
@@ -349,6 +397,13 @@ func addNodeFile(c *gin.Context) {
// @Router /dsSzxy/fileRelate/delNodeFile [post]
// @X-TableName ["t_zhxy_clouddisk_tree"]
func delNodeFile(c *gin.Context) {
+ //异常处理
+ defer func() {
+ if err := recover(); err != nil {
+ fmt.Printf("%s\n", err)
+ }
+ }()
+
nodeId := c.PostForm("node_id")
fileId := c.PostForm("file_id")
success, err := FileRelateDao.DelNodeFile(nodeId, fileId)
@@ -365,6 +420,7 @@ func delNodeFile(c *gin.Context) {
}
}
+// GetFileList
// @Summary 获取指定结点下的文件列表
// @Description 获取指定结点下的文件列表
// @Tags 文件系统管理
@@ -378,6 +434,13 @@ func delNodeFile(c *gin.Context) {
// @X-EmptyLimit ["node_id"]
// @Router /dsSzxy/fileRelate/GetFileList [get]
func GetFileList(c *gin.Context) {
+ //异常处理
+ defer func() {
+ if err := recover(); err != nil {
+ fmt.Printf("%s\n", err)
+ }
+ }()
+
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
nodeId := c.PostForm("node_id")
@@ -390,6 +453,7 @@ func GetFileList(c *gin.Context) {
})
}
+// GetSyncTree
// @Summary 获取指定树型结构下的子目录(同步)
// @Description 获取指定树型结构下的子目录(同步)
// @Tags 文件系统管理
@@ -401,6 +465,12 @@ func GetFileList(c *gin.Context) {
// @X-IntRangeLimit [{"identity_id":"5"},{"person_id":"1,999999999999"}]
// @Router /dsSzxy/fileRelate/GetSyncTree [get]
func GetSyncTree(c *gin.Context) {
+ //异常处理
+ defer func() {
+ if err := recover(); err != nil {
+ fmt.Printf("%s\n", err)
+ }
+ }()
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
success, list := FileRelateDao.GetSyncTree(identityId, personId)
@@ -410,6 +480,7 @@ func GetSyncTree(c *gin.Context) {
})
}
+// GetAsyncTree
// @Summary 获取指定树型结构下的子目录(异步)
// @Description 获取指定树型结构下的子目录(异步)
// @Tags 文件系统管理
@@ -423,6 +494,12 @@ func GetSyncTree(c *gin.Context) {
// @X-EmptyLimit ["node_id"]
// @Router /dsSzxy/fileRelate/GetAsyncTree [get]
func GetAsyncTree(c *gin.Context) {
+ //异常处理
+ defer func() {
+ if err := recover(); err != nil {
+ fmt.Printf("%s\n", err)
+ }
+ }()
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
nodeId := c.PostForm("node_id")