Commit f4ab4b6a by zhengqiuyun86

初始化

parent f4266832
...@@ -17,6 +17,6 @@ func main() { ...@@ -17,6 +17,6 @@ func main() {
mysqlrym.TestLog() mysqlrym.TestLog()
es.TestLog() es.TestLog()
redis.TestLog() redis.TestLog()
c := router.InitGinEngine() c := router.InitGinEngine(true)
router.Run(c) router.Run(c)
} }
...@@ -62,6 +62,15 @@ func GetString(key string) string { ...@@ -62,6 +62,15 @@ func GetString(key string) string {
return r.Val() return r.Val()
} }
func Get(key string) []byte {
r := redisClient.Get(key)
rByte, err := r.Bytes()
if err != nil {
log.Error(fmt.Sprintf("获取缓存错误:%s", err.Error()))
}
return rByte
}
func Set(k string, v string) { func Set(k string, v string) {
redisClient.Set(k, v, 0) redisClient.Set(k, v, 0)
log.Debug(fmt.Sprintf("设置缓存成功:%s %s", k, v)) log.Debug(fmt.Sprintf("设置缓存成功:%s %s", k, v))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment