|
|
|
@ -23,8 +23,7 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
rr := r.Group("/fileRelate")
|
|
|
|
|
//文件表
|
|
|
|
|
rr.POST("/fileUpload", fileUpload)
|
|
|
|
|
//rr.POST("/fileRecord", fileRecord)
|
|
|
|
|
//rr.POST("/fileUpdate", fileUpdate)
|
|
|
|
|
rr.POST("/fileUpdate", fileUpdate)
|
|
|
|
|
//rr.POST("/fileCopy", fileCopy)
|
|
|
|
|
//树型结构
|
|
|
|
|
|
|
|
|
@ -80,11 +79,12 @@ func fileUpload(c *gin.Context) {
|
|
|
|
|
//记录数据库
|
|
|
|
|
identityId := CommonUtil.ConvertStringToInt32(c.PostForm("identity_id"))
|
|
|
|
|
personId := CommonUtil.ConvertStringToInt32(c.PostForm("person_id"))
|
|
|
|
|
targetGroupId := CommonUtil.ConvertStringToInt32(c.PostForm("target_group_id"))
|
|
|
|
|
targetIdentityId := CommonUtil.ConvertStringToInt32(c.PostForm("target_identity_id"))
|
|
|
|
|
targetPersonId := CommonUtil.ConvertStringToInt32(c.PostForm("target_person_id"))
|
|
|
|
|
systemId := CommonUtil.ConvertStringToInt32(c.PostForm("system_id"))
|
|
|
|
|
targetGroupId := CommonUtil.ConvertStringToInt32(c.PostForm("target_group_id")) //不是对群组的,填写-1
|
|
|
|
|
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(filename, identityId, personId, targetGroupId, targetIdentityId, targetPersonId, systemId, int32(size), ext)
|
|
|
|
|
|
|
|
|
|
//返回
|
|
|
|
|
s := FileRelateDao.GetFileDownLoadUrl(trueName[0:2]+"/"+trueName, file.Filename)
|
|
|
|
|
originUrl := ConfigUtil.MinioDownloadPrefix + ConfigUtil.MinioBucket + "/" + trueName[0:2] + "/" + trueName
|
|
|
|
@ -136,3 +136,14 @@ func fileUpload(c *gin.Context) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//文件修改名称
|
|
|
|
|
func fileUpdate(c *gin.Context) {
|
|
|
|
|
fileId := c.PostForm("file_id")
|
|
|
|
|
fileName := c.PostForm("file_name")
|
|
|
|
|
FileRelateDao.FileUpdate(fileId, fileName)
|
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
|
"success": true,
|
|
|
|
|
"message": `修改成功!`,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|