From 40157f90ba26c47c94e790ae026b98120a48fd52 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com>
Date: Mon, 16 Aug 2021 14:13:20 +0800
Subject: [PATCH] 'commit'
---
dsSzxy/.idea/workspace.xml | 3 +-
.../FileReleateController.go | 63 ++++++++++++++++++-
.../FileRelateDao/FileReleateDao.go | 36 +++++++++++
dsSzxy/models/t_zhxy_clouddisk_tree.go | 10 +--
4 files changed, 102 insertions(+), 10 deletions(-)
diff --git a/dsSzxy/.idea/workspace.xml b/dsSzxy/.idea/workspace.xml
index 17dc197d..933448a5 100644
--- a/dsSzxy/.idea/workspace.xml
+++ b/dsSzxy/.idea/workspace.xml
@@ -8,8 +8,7 @@
-
-
+
diff --git a/dsSzxy/Business/FileRelate/FileRelateController/FileReleateController.go b/dsSzxy/Business/FileRelate/FileRelateController/FileReleateController.go
index c6c91021..f8fe616c 100644
--- a/dsSzxy/Business/FileRelate/FileRelateController/FileReleateController.go
+++ b/dsSzxy/Business/FileRelate/FileRelateController/FileReleateController.go
@@ -24,9 +24,13 @@ func Routers(r *gin.RouterGroup) {
//文件表
rr.POST("/fileUpload", fileUpload)
rr.POST("/fileUpdate", fileUpdate)
- //rr.POST("/fileCopy", fileCopy)
+ rr.POST("/fileCopy", fileCopy)
//树型结构
-
+ rr.POST("/addNode", addNode)
+ rr.POST("/updateNode", updateNode)
+ rr.POST("/delNode", delNode)
+ rr.POST("/addNodeFile", addNodeFile)
+ rr.POST("/delNodeFile", delNodeFile)
}
// @Summary 文件上传
@@ -187,7 +191,7 @@ func fileUpdate(c *gin.Context) {
// @Router /dsSzxy/fileRelate/FileCopy [post]
// @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) {
+func fileCopy(c *gin.Context) {
fileId := c.PostForm("file_id")
sourceIdentityId := CommonUtil.ConvertStringToInt32(c.PostForm("source_identity_id"))
sourcePersonId := CommonUtil.ConvertStringToInt32(c.PostForm("source_person_id"))
@@ -208,3 +212,56 @@ func FileCopy(c *gin.Context) {
})
}
}
+
+// @Summary 增加云盘结点
+// @Description 增加云盘结点
+// @Tags 文件系统管理
+// @Accept application/x-www-form-urlencoded
+// @Produce json
+// @Param identity_id formData string true "创建者身份ID"
+// @Param person_id formData string true "创建者ID"
+// @Param parent_id formData string true "父结点ID"
+// @Param node_name formData string true "结点名称"
+// @Success 200 {object} Model.Res
+// @X-EmptyLimit ["parent_id","node_name"]
+// @Router /dsSzxy/fileRelate/addNode [post]
+// @X-IntRangeLimit [{"identity_id":"5"},{"person_id":"1,999999999999"}]
+// @X-TableName ["t_zhxy_clouddisk_tree"]
+func addNode(c *gin.Context) {
+ identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
+ personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
+ parentId := c.PostForm("parent_id") //根传入-1
+ nodeName := c.PostForm("node_name")
+ success, err := FileRelateDao.AddNode(identityId, personId, parentId, nodeName)
+ if err != nil {
+ c.JSON(200, gin.H{
+ "success": success,
+ "message": `增加成功!`,
+ })
+ } else {
+ c.JSON(200, gin.H{
+ "success": success,
+ "message": err.Error(),
+ })
+ }
+}
+
+//增加云盘结点名称
+func updateNode(c *gin.Context) {
+
+}
+
+//删除云盘结点
+func delNode(c *gin.Context) {
+
+}
+
+//增加云盘结点文件
+func addNodeFile(c *gin.Context) {
+
+}
+
+//删除云盘结点文件
+func delNodeFile(c *gin.Context) {
+
+}
diff --git a/dsSzxy/Business/FileRelate/FileRelateDao/FileReleateDao.go b/dsSzxy/Business/FileRelate/FileRelateDao/FileReleateDao.go
index 853cc18a..13a17df0 100644
--- a/dsSzxy/Business/FileRelate/FileRelateDao/FileReleateDao.go
+++ b/dsSzxy/Business/FileRelate/FileRelateDao/FileReleateDao.go
@@ -105,3 +105,39 @@ func GetFileTypeByExtName(extName string) (int64, error) {
}
return res[0]["type_id"].(int64), nil
}
+
+//增加云盘结点
+func AddNode(identityId int32, personId int32, parentNodeId string, nodeName string) (bool, error) {
+ var model models.TZhxyClouddiskTree
+ model.NodeId = CommonUtil.GetUUID()
+ model.NodeName = nodeName
+ model.IndentityId = identityId
+ model.PersonId = personId
+ model.ParentId = parentNodeId
+ _, err := db.Insert(model)
+ if err != nil {
+ return false, err
+ } else {
+ return true, nil
+ }
+}
+
+//增加云盘结点名称
+func updateNode(nodeId string, nodeName string) {
+
+}
+
+//删除云盘结点
+func delNode(nodeId string) {
+
+}
+
+//增加云盘结点文件
+func addNodeFile(nodeId string, fileId string) {
+
+}
+
+//删除云盘结点文件
+func delNodeFile(nodeId string, fileId string) {
+
+}
diff --git a/dsSzxy/models/t_zhxy_clouddisk_tree.go b/dsSzxy/models/t_zhxy_clouddisk_tree.go
index 86114a07..c2c000ac 100644
--- a/dsSzxy/models/t_zhxy_clouddisk_tree.go
+++ b/dsSzxy/models/t_zhxy_clouddisk_tree.go
@@ -1,9 +1,9 @@
package models
type TZhxyClouddiskTree struct {
- NodeId string `xorm:"not null pk comment('结点ID') CHAR(36)"`
- NodeName string `xorm:"not null comment('结点名称') VARCHAR(255)"`
- ParentId string `xorm:"not null comment('父结点ID') CHAR(36)"`
- OwnerIndentityId int32 `xorm:"not null comment('所有人的身份') INT(11)"`
- OwnerPersonId int32 `xorm:"not null comment('所有人的ID') INT(11)"`
+ NodeId string `xorm:"not null pk comment('结点ID') CHAR(36)"`
+ NodeName string `xorm:"not null comment('结点名称') VARCHAR(255)"`
+ ParentId string `xorm:"not null comment('父结点ID') CHAR(36)"`
+ IndentityId int32 `xorm:"not null comment('所有人的身份') INT(11)"`
+ PersonId int32 `xorm:"not null comment('所有人的ID') INT(11)"`
}