|
|
|
@ -30,14 +30,14 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
rr.POST("/updateNode", updateNode)
|
|
|
|
|
rr.POST("/delNode", delNode)
|
|
|
|
|
//返回指定树型结构下的子路径
|
|
|
|
|
//TODO
|
|
|
|
|
rr.GET("/getFileList", GetFileList)
|
|
|
|
|
|
|
|
|
|
//文件与文件夹的关系维护
|
|
|
|
|
rr.POST("/addNodeFile", addNodeFile)
|
|
|
|
|
rr.POST("/delNodeFile", delNodeFile)
|
|
|
|
|
//返回指定树型结构下的文件列表
|
|
|
|
|
//TODO
|
|
|
|
|
|
|
|
|
|
rr.GET("/getSyncTree", GetSyncTree)
|
|
|
|
|
rr.GET("/getAsyncTree", GetAsyncTree)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Summary 文件上传
|
|
|
|
@ -253,7 +253,6 @@ func addNode(c *gin.Context) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @Summary 修改云盘结点
|
|
|
|
|
// @Description 修改云盘结点
|
|
|
|
|
// @Tags 文件系统管理
|
|
|
|
@ -282,7 +281,6 @@ func updateNode(c *gin.Context) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @Summary 删除云盘结点
|
|
|
|
|
// @Description 删除云盘结点
|
|
|
|
|
// @Tags 文件系统管理
|
|
|
|
@ -323,7 +321,7 @@ func delNode(c *gin.Context) {
|
|
|
|
|
func addNodeFile(c *gin.Context) {
|
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
|
fileId := c.PostForm("file_id")
|
|
|
|
|
success, err := FileRelateDao.AddNodeFile(nodeId,fileId)
|
|
|
|
|
success, err := FileRelateDao.AddNodeFile(nodeId, fileId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
|
"success": success,
|
|
|
|
@ -337,7 +335,6 @@ func addNodeFile(c *gin.Context) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// @Summary 删除云盘结点文件
|
|
|
|
|
// @Description 删除云盘结点文件
|
|
|
|
|
// @Tags 文件系统管理
|
|
|
|
@ -352,7 +349,7 @@ func addNodeFile(c *gin.Context) {
|
|
|
|
|
func delNodeFile(c *gin.Context) {
|
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
|
fileId := c.PostForm("file_id")
|
|
|
|
|
success, err := FileRelateDao.DelNodeFile(nodeId,fileId)
|
|
|
|
|
success, err := FileRelateDao.DelNodeFile(nodeId, fileId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
|
"success": success,
|
|
|
|
@ -365,3 +362,42 @@ func delNodeFile(c *gin.Context) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
功能:获取指定结点下的文件列表
|
|
|
|
|
*/
|
|
|
|
|
func GetFileList(c *gin.Context) {
|
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
|
limit := CommonUtil.ConvertStringToInt32(c.PostForm("limit"))
|
|
|
|
|
offset := CommonUtil.ConvertStringToInt32(c.PostForm("offset"))
|
|
|
|
|
success, list := FileRelateDao.GetFileList(identityId, personId, nodeId, int(limit), int(offset))
|
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
|
"success": success,
|
|
|
|
|
"data": list,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取指定树型结构下的子目录(同步)
|
|
|
|
|
func GetSyncTree(c *gin.Context) {
|
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
|
success, list := FileRelateDao.GetSyncTree(identityId, personId)
|
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
|
"success": success,
|
|
|
|
|
"data": list,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取指定树型结构下的子目录(异步)
|
|
|
|
|
func GetAsyncTree(c *gin.Context) {
|
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
|
success, list := FileRelateDao.GetAsyncTree(identityId, personId, nodeId)
|
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
|
"success": success,
|
|
|
|
|
"data": list,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|