Feat: file upload handler

This commit is contained in:
HFO4
2019-11-17 13:50:14 +08:00
parent 841832bb65
commit 99e7eecab7
12 changed files with 242 additions and 25 deletions

View File

@@ -2,6 +2,7 @@ package util
import (
"math/rand"
"strings"
)
// RandStringRunes 返回随机字符串
@@ -34,3 +35,11 @@ func ContainsString(s []string, e string) bool {
}
return false
}
// Replace 根据替换表执行批量替换
func Replace(table map[string]string, s string) string {
for key, value := range table {
s = strings.Replace(s, key, value, -1)
}
return s
}