feat (generate-file): not tested yet
This commit is contained in:
No files matched your search
@@ -0,0 +1,33 @@
|
||||
package filehelper
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// const DEFAULT_EXPIRY_FILES = time.Hour * 24 * 7
|
||||
|
||||
func PathAgreement(medicalNumber string) (string, error) {
|
||||
outputPath := fmt.Sprintf("./public/patient/%s", medicalNumber)
|
||||
err := os.MkdirAll(outputPath, os.ModePerm)
|
||||
return outputPath, err
|
||||
}
|
||||
|
||||
func PathToSaveFile(outputPath string) (string, error) {
|
||||
err := os.MkdirAll(outputPath, os.ModePerm)
|
||||
return outputPath, err
|
||||
}
|
||||
|
||||
func RenameFile(srcPath, dstPath string) error {
|
||||
return os.Rename(srcPath, dstPath)
|
||||
}
|
||||
|
||||
func DeleteFolder(path string) error {
|
||||
return os.RemoveAll(path)
|
||||
}
|
||||
|
||||
func PathToUrl(fileName string) *string {
|
||||
fileUrl := filepath.ToSlash(fmt.Sprintf("%c%s", os.PathSeparator, fileName))
|
||||
return &fileUrl
|
||||
}
|
||||
Reference in New Issue
Block a user