feat: murder项目整体迁移

This commit is contained in:
2022-01-12 14:34:31 +08:00
parent 7398e7ab9e
commit c7df390cec
21 changed files with 1698 additions and 4 deletions
@@ -0,0 +1,19 @@
package util
import "strings"
type QueryMap map[string]string
// GetQueryMap 根据查询条件进行sql处理
func GetQueryMap(s string) QueryMap {
m := make(map[string]string)
if s != "" {
s = string([]byte(s)[1 : len([]byte(s))-1])
for _, v := range strings.Split(s, ",") {
split := strings.Split(v, "=")
m[split[0]] = split[1]
}
}
m["is_del"] = "0"
return m
}
@@ -0,0 +1,25 @@
package util
import "time"
var (
cst *time.Location
)
func init() {
var err error
if cst, err = time.LoadLocation("Asia/Shanghai"); err != nil {
panic(err)
}
// 默认设置为中国时区
time.Local = cst
}
// CSTLayout China Standard Time Layout
const CSTLayout = "2006-01-02 15:04:05"
func CSTLayoutString() string {
ts := time.Now()
return ts.In(cst).Format(CSTLayout)
}