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

master
黄海 4 years ago
parent 9f481b89ec
commit 19c2f72522

@ -6,6 +6,7 @@
<component name="ChangeListManager">
<list default="true" id="19c8c37d-a056-451c-a29d-fb612b9a3e2f" name="Default Changelist" comment="commit">
<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/FileRelateDao/FileReleateDao.go" beforeDir="false" afterPath="$PROJECT_DIR$/Business/FileRelate/FileRelateDao/FileReleateDao.go" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />

@ -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": `修改成功!`,
})
}

@ -51,6 +51,14 @@ func FileRecord(fileName string, indentityId int32, personId int32, targetGroupI
}
}
//修改文件名称
func FileUpdate(fileId string, fileName string) {
var myBuilder = builder.Dialect(builder.MYSQL).Update(builder.Eq{"file_name": fileName}).
From(`t_zhxy_file`).Where(builder.Eq{"file_id": fileId})
sql, _ := myBuilder.ToBoundSQL()
db.SQL(sql).Execute()
}
/**
ID
*/

Loading…
Cancel
Save