|
|
|
@ -19,7 +19,7 @@ func (f *File) Creat(context *gin.Context) {
|
|
|
|
|
user_name := context.GetString(consts.ValidatorPrefix + "user_name")
|
|
|
|
|
file_Path := context.GetString(consts.ValidatorPrefix + "file_path")
|
|
|
|
|
file_Name := context.GetString(consts.ValidatorPrefix + "file_name")
|
|
|
|
|
final_Path := fmt.Sprintf("%s/%s.docx", file_Path, file_Name)
|
|
|
|
|
final_Path := fmt.Sprintf("%s/%s", file_Path, file_Name)
|
|
|
|
|
|
|
|
|
|
//file, err := os.Create(final_Path)
|
|
|
|
|
if err := file.CreateFile(user_name, final_Path); err != nil {
|
|
|
|
@ -54,7 +54,7 @@ func (f *File) Get(context *gin.Context) {
|
|
|
|
|
user_name := context.GetString(consts.ValidatorPrefix + "user_name")
|
|
|
|
|
file_Path := context.GetString(consts.ValidatorPrefix + "file_path")
|
|
|
|
|
file_Name := context.GetString(consts.ValidatorPrefix + "file_name")
|
|
|
|
|
final_Path := fmt.Sprintf("%s/%s.docx", file_Path, file_Name)
|
|
|
|
|
final_Path := fmt.Sprintf("%s/%s", file_Path, file_Name)
|
|
|
|
|
|
|
|
|
|
fileObj, err := file.GetFile(user_name, final_Path)
|
|
|
|
|
if err != nil {
|
|
|
|
@ -84,11 +84,11 @@ func (f *File) Rename(context *gin.Context) {
|
|
|
|
|
user_name := context.GetString(consts.ValidatorPrefix + "user_name")
|
|
|
|
|
file_Path := context.GetString(consts.ValidatorPrefix + "file_path")
|
|
|
|
|
file_Name := context.GetString(consts.ValidatorPrefix + "file_name")
|
|
|
|
|
final_Path := fmt.Sprintf("%s/%s.docx", file_Path, file_Name)
|
|
|
|
|
final_Path := fmt.Sprintf("%s/%s", file_Path, file_Name)
|
|
|
|
|
|
|
|
|
|
//old_Name := context.GetString(consts.ValidatorPrefix + "oldname")
|
|
|
|
|
new_Name := context.GetString(consts.ValidatorPrefix + "newname")
|
|
|
|
|
new_finalpath := fmt.Sprintf("%s/%s.docx", file_Path, new_Name)
|
|
|
|
|
new_finalpath := fmt.Sprintf("%s/%s", file_Path, new_Name)
|
|
|
|
|
|
|
|
|
|
err := file.FileRename(user_name, final_Path, new_finalpath)
|
|
|
|
|
if err != nil {
|
|
|
|
@ -117,11 +117,11 @@ func (f *File) Move(context *gin.Context) {
|
|
|
|
|
user_name := context.GetString(consts.ValidatorPrefix + "user_name")
|
|
|
|
|
file_Path := context.GetString(consts.ValidatorPrefix + "file_path")
|
|
|
|
|
file_Name := context.GetString(consts.ValidatorPrefix + "file_name")
|
|
|
|
|
final_Path := fmt.Sprintf("%s/%s.docx", file_Path, file_Name)
|
|
|
|
|
final_Path := fmt.Sprintf("%s/%s", file_Path, file_Name)
|
|
|
|
|
|
|
|
|
|
//old_Name := context.GetString(consts.ValidatorPrefix + "oldname")
|
|
|
|
|
new_Path := context.GetString(consts.ValidatorPrefix + "newpath")
|
|
|
|
|
new_finalpath := fmt.Sprintf("%s/%s.docx", new_Path, file_Name)
|
|
|
|
|
new_finalpath := fmt.Sprintf("%s/%s", new_Path, file_Name)
|
|
|
|
|
|
|
|
|
|
err := file.FileMove(user_name, final_Path, new_finalpath)
|
|
|
|
|
if err != nil {
|
|
|
|
@ -150,7 +150,7 @@ func (f *File) Save(context *gin.Context) {
|
|
|
|
|
user_name := context.GetString(consts.ValidatorPrefix + "user_name")
|
|
|
|
|
Save_path := context.GetString(consts.ValidatorPrefix + "save_path")
|
|
|
|
|
file_Name := context.GetString(consts.ValidatorPrefix + "file_name")
|
|
|
|
|
final_savePath := fmt.Sprintf("%s/%s.docx", Save_path, file_Name)
|
|
|
|
|
final_savePath := fmt.Sprintf("%s/%s", Save_path, file_Name)
|
|
|
|
|
|
|
|
|
|
fileDataBase64 := context.PostForm("file_data")
|
|
|
|
|
if fileDataBase64 == "" {
|
|
|
|
@ -185,7 +185,7 @@ func (f *File) Delete(context *gin.Context) {
|
|
|
|
|
user_name := context.GetString(consts.ValidatorPrefix + "user_name")
|
|
|
|
|
file_Path := context.GetString(consts.ValidatorPrefix + "file_path")
|
|
|
|
|
file_Name := context.GetString(consts.ValidatorPrefix + "file_name")
|
|
|
|
|
final_Path := fmt.Sprintf("%s/%s.docx", file_Path, file_Name)
|
|
|
|
|
final_Path := fmt.Sprintf("%s/%s", file_Path, file_Name)
|
|
|
|
|
|
|
|
|
|
err := file.FileDe(user_name, final_Path)
|
|
|
|
|
if err != nil {
|
|
|
|
|