|
|
@ -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-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"]
|
|
|
|
// @X-TableName ["t_zhxy_file"]
|
|
|
|
func fileUpload(c *gin.Context) {
|
|
|
|
func fileUpload(c *gin.Context) {
|
|
|
|
|
|
|
|
//异常处理
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
file, err := c.FormFile("file")
|
|
|
|
file, err := c.FormFile("file")
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
c.String(http.StatusBadRequest, fmt.Sprintf("get form err: %s", err.Error()))
|
|
|
|
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
|
|
|
|
targetIdentityId := CommonUtil.ConvertStringToInt32(c.PostForm("target_identity_id")) //目标人身份ID
|
|
|
|
targetPersonId := CommonUtil.ConvertStringToInt32(c.PostForm("target_person_id")) //目标人员ID
|
|
|
|
targetPersonId := CommonUtil.ConvertStringToInt32(c.PostForm("target_person_id")) //目标人员ID
|
|
|
|
systemId := CommonUtil.ConvertStringToInt32(c.PostForm("system_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)
|
|
|
|
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-EmptyLimit ["file_id","file_name"]
|
|
|
|
// @X-TableName ["t_zhxy_file"]
|
|
|
|
// @X-TableName ["t_zhxy_file"]
|
|
|
|
func fileUpdate(c *gin.Context) {
|
|
|
|
func fileUpdate(c *gin.Context) {
|
|
|
|
|
|
|
|
//异常处理
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
fileId := c.PostForm("file_id")
|
|
|
|
fileId := c.PostForm("file_id")
|
|
|
|
fileName := c.PostForm("file_name")
|
|
|
|
fileName := c.PostForm("file_name")
|
|
|
|
FileRelateDao.FileUpdate(fileId, fileName)
|
|
|
|
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-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) {
|
|
|
|
|
|
|
|
//异常处理
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
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"))
|
|
|
@ -237,6 +257,13 @@ func fileCopy(c *gin.Context) {
|
|
|
|
// @X-IntRangeLimit [{"identity_id":"5"},{"person_id":"1,999999999999"}]
|
|
|
|
// @X-IntRangeLimit [{"identity_id":"5"},{"person_id":"1,999999999999"}]
|
|
|
|
// @X-TableName ["t_zhxy_clouddisk_tree"]
|
|
|
|
// @X-TableName ["t_zhxy_clouddisk_tree"]
|
|
|
|
func addNode(c *gin.Context) {
|
|
|
|
func addNode(c *gin.Context) {
|
|
|
|
|
|
|
|
//异常处理
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
parentId := c.PostForm("parent_id") //根传入-1
|
|
|
|
parentId := c.PostForm("parent_id") //根传入-1
|
|
|
@ -267,6 +294,13 @@ func addNode(c *gin.Context) {
|
|
|
|
// @Router /dsSzxy/fileRelate/updateNode [post]
|
|
|
|
// @Router /dsSzxy/fileRelate/updateNode [post]
|
|
|
|
// @X-TableName ["t_zhxy_clouddisk_tree"]
|
|
|
|
// @X-TableName ["t_zhxy_clouddisk_tree"]
|
|
|
|
func updateNode(c *gin.Context) {
|
|
|
|
func updateNode(c *gin.Context) {
|
|
|
|
|
|
|
|
//异常处理
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
nodeName := c.PostForm("nodeName")
|
|
|
|
nodeName := c.PostForm("nodeName")
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
success, err := FileRelateDao.UpdateNode(nodeId, nodeName)
|
|
|
|
success, err := FileRelateDao.UpdateNode(nodeId, nodeName)
|
|
|
@ -294,6 +328,13 @@ func updateNode(c *gin.Context) {
|
|
|
|
// @Router /dsSzxy/fileRelate/delNode [post]
|
|
|
|
// @Router /dsSzxy/fileRelate/delNode [post]
|
|
|
|
// @X-TableName ["t_zhxy_clouddisk_tree"]
|
|
|
|
// @X-TableName ["t_zhxy_clouddisk_tree"]
|
|
|
|
func delNode(c *gin.Context) {
|
|
|
|
func delNode(c *gin.Context) {
|
|
|
|
|
|
|
|
//异常处理
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
success, err := FileRelateDao.DelNode(nodeId)
|
|
|
|
success, err := FileRelateDao.DelNode(nodeId)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
@ -321,6 +362,13 @@ func delNode(c *gin.Context) {
|
|
|
|
// @Router /dsSzxy/fileRelate/addNodeFile [post]
|
|
|
|
// @Router /dsSzxy/fileRelate/addNodeFile [post]
|
|
|
|
// @X-TableName ["t_zhxy_clouddisk_tree"]
|
|
|
|
// @X-TableName ["t_zhxy_clouddisk_tree"]
|
|
|
|
func addNodeFile(c *gin.Context) {
|
|
|
|
func addNodeFile(c *gin.Context) {
|
|
|
|
|
|
|
|
//异常处理
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
fileId := c.PostForm("file_id")
|
|
|
|
fileId := c.PostForm("file_id")
|
|
|
|
success, err := FileRelateDao.AddNodeFile(nodeId, fileId)
|
|
|
|
success, err := FileRelateDao.AddNodeFile(nodeId, fileId)
|
|
|
@ -349,6 +397,13 @@ func addNodeFile(c *gin.Context) {
|
|
|
|
// @Router /dsSzxy/fileRelate/delNodeFile [post]
|
|
|
|
// @Router /dsSzxy/fileRelate/delNodeFile [post]
|
|
|
|
// @X-TableName ["t_zhxy_clouddisk_tree"]
|
|
|
|
// @X-TableName ["t_zhxy_clouddisk_tree"]
|
|
|
|
func delNodeFile(c *gin.Context) {
|
|
|
|
func delNodeFile(c *gin.Context) {
|
|
|
|
|
|
|
|
//异常处理
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
fileId := c.PostForm("file_id")
|
|
|
|
fileId := c.PostForm("file_id")
|
|
|
|
success, err := FileRelateDao.DelNodeFile(nodeId, fileId)
|
|
|
|
success, err := FileRelateDao.DelNodeFile(nodeId, fileId)
|
|
|
@ -365,6 +420,7 @@ func delNodeFile(c *gin.Context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GetFileList
|
|
|
|
// @Summary 获取指定结点下的文件列表
|
|
|
|
// @Summary 获取指定结点下的文件列表
|
|
|
|
// @Description 获取指定结点下的文件列表
|
|
|
|
// @Description 获取指定结点下的文件列表
|
|
|
|
// @Tags 文件系统管理
|
|
|
|
// @Tags 文件系统管理
|
|
|
@ -378,6 +434,13 @@ func delNodeFile(c *gin.Context) {
|
|
|
|
// @X-EmptyLimit ["node_id"]
|
|
|
|
// @X-EmptyLimit ["node_id"]
|
|
|
|
// @Router /dsSzxy/fileRelate/GetFileList [get]
|
|
|
|
// @Router /dsSzxy/fileRelate/GetFileList [get]
|
|
|
|
func GetFileList(c *gin.Context) {
|
|
|
|
func GetFileList(c *gin.Context) {
|
|
|
|
|
|
|
|
//异常处理
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
@ -390,6 +453,7 @@ func GetFileList(c *gin.Context) {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GetSyncTree
|
|
|
|
// @Summary 获取指定树型结构下的子目录(同步)
|
|
|
|
// @Summary 获取指定树型结构下的子目录(同步)
|
|
|
|
// @Description 获取指定树型结构下的子目录(同步)
|
|
|
|
// @Description 获取指定树型结构下的子目录(同步)
|
|
|
|
// @Tags 文件系统管理
|
|
|
|
// @Tags 文件系统管理
|
|
|
@ -401,6 +465,12 @@ func GetFileList(c *gin.Context) {
|
|
|
|
// @X-IntRangeLimit [{"identity_id":"5"},{"person_id":"1,999999999999"}]
|
|
|
|
// @X-IntRangeLimit [{"identity_id":"5"},{"person_id":"1,999999999999"}]
|
|
|
|
// @Router /dsSzxy/fileRelate/GetSyncTree [get]
|
|
|
|
// @Router /dsSzxy/fileRelate/GetSyncTree [get]
|
|
|
|
func GetSyncTree(c *gin.Context) {
|
|
|
|
func GetSyncTree(c *gin.Context) {
|
|
|
|
|
|
|
|
//异常处理
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
success, list := FileRelateDao.GetSyncTree(identityId, personId)
|
|
|
|
success, list := FileRelateDao.GetSyncTree(identityId, personId)
|
|
|
@ -410,6 +480,7 @@ func GetSyncTree(c *gin.Context) {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GetAsyncTree
|
|
|
|
// @Summary 获取指定树型结构下的子目录(异步)
|
|
|
|
// @Summary 获取指定树型结构下的子目录(异步)
|
|
|
|
// @Description 获取指定树型结构下的子目录(异步)
|
|
|
|
// @Description 获取指定树型结构下的子目录(异步)
|
|
|
|
// @Tags 文件系统管理
|
|
|
|
// @Tags 文件系统管理
|
|
|
@ -423,6 +494,12 @@ func GetSyncTree(c *gin.Context) {
|
|
|
|
// @X-EmptyLimit ["node_id"]
|
|
|
|
// @X-EmptyLimit ["node_id"]
|
|
|
|
// @Router /dsSzxy/fileRelate/GetAsyncTree [get]
|
|
|
|
// @Router /dsSzxy/fileRelate/GetAsyncTree [get]
|
|
|
|
func GetAsyncTree(c *gin.Context) {
|
|
|
|
func GetAsyncTree(c *gin.Context) {
|
|
|
|
|
|
|
|
//异常处理
|
|
|
|
|
|
|
|
defer func() {
|
|
|
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}()
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|
nodeId := c.PostForm("node_id")
|
|
|
|