'commit'
continuous-integration/drone/push Build is passing Details

master
黄海 4 years ago
parent 137c67c8a8
commit 40157f90ba

@ -8,8 +8,7 @@
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Business/FileRelate/FileRelateController/FileReleateController.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/FileRelate/FileRelateController/FileReleateController.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Business/FileRelate/FileRelateController/FileReleateController.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/FileRelate/FileRelateController/FileReleateController.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Business/FileRelate/FileRelateDao/FileReleateDao.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/FileRelate/FileRelateDao/FileReleateDao.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/Business/FileRelate/FileRelateDao/FileReleateDao.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/FileRelate/FileRelateDao/FileReleateDao.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.go" beforeDir="false" afterPath="$PROJECT_DIR$/main.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/models/t_zhxy_clouddisk_tree.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/t_zhxy_clouddisk_tree.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/models/t_zhxy_file.go" beforeDir="false" afterPath="$PROJECT_DIR$/models/t_zhxy_file.go" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />

@ -24,9 +24,13 @@ func Routers(r *gin.RouterGroup) {
//文件表 //文件表
rr.POST("/fileUpload", fileUpload) rr.POST("/fileUpload", fileUpload)
rr.POST("/fileUpdate", fileUpdate) 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 文件上传 // @Summary 文件上传
@ -187,7 +191,7 @@ func fileUpdate(c *gin.Context) {
// @Router /dsSzxy/fileRelate/FileCopy [post] // @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-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"] // @X-TableName ["t_zhxy_file"]
func FileCopy(c *gin.Context) { func fileCopy(c *gin.Context) {
fileId := c.PostForm("file_id") fileId := c.PostForm("file_id")
sourceIdentityId := CommonUtil.ConvertStringToInt32(c.PostForm("source_identity_id")) sourceIdentityId := CommonUtil.ConvertStringToInt32(c.PostForm("source_identity_id"))
sourcePersonId := CommonUtil.ConvertStringToInt32(c.PostForm("source_person_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) {
}

@ -105,3 +105,39 @@ func GetFileTypeByExtName(extName string) (int64, error) {
} }
return res[0]["type_id"].(int64), nil 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) {
}

@ -1,9 +1,9 @@
package models package models
type TZhxyClouddiskTree struct { type TZhxyClouddiskTree struct {
NodeId string `xorm:"not null pk comment('结点ID') CHAR(36)"` NodeId string `xorm:"not null pk comment('结点ID') CHAR(36)"`
NodeName string `xorm:"not null comment('结点名称') VARCHAR(255)"` NodeName string `xorm:"not null comment('结点名称') VARCHAR(255)"`
ParentId string `xorm:"not null comment('父结点ID') CHAR(36)"` ParentId string `xorm:"not null comment('父结点ID') CHAR(36)"`
OwnerIndentityId int32 `xorm:"not null comment('所有人的身份') INT(11)"` IndentityId int32 `xorm:"not null comment('所有人的身份') INT(11)"`
OwnerPersonId int32 `xorm:"not null comment('所有人的ID') INT(11)"` PersonId int32 `xorm:"not null comment('所有人的ID') INT(11)"`
} }

Loading…
Cancel
Save