From ec844ee44d60705dae03a6333ba0c0b597c7af64 Mon Sep 17 00:00:00 2001 From: 陆恒 Date: Thu, 30 Apr 2020 11:09:13 +0800 Subject: [PATCH] 提交 --- src/HttpServer/logic/httpserver.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/HttpServer/logic/httpserver.go b/src/HttpServer/logic/httpserver.go index dfc6b83..b0db7ab 100644 --- a/src/HttpServer/logic/httpserver.go +++ b/src/HttpServer/logic/httpserver.go @@ -36,7 +36,7 @@ func CheckErr(err error) { func startServerHttpServe() { //------------------------------------------------------------- http.HandleFunc("/catcafe/ClearData", ClearData) //情况账号的测试接口 - + http.HandleFunc("/catcafe/AddWhiteList", AddWhiteList) //情况账号的测试接口 //------------------------------------------------------------- http.HandleFunc("/catcafe/login", UserLogin) //游客登录 http.HandleFunc("/catcafe/user/regeister", Regeister) //账号注册 @@ -71,6 +71,26 @@ func startServerHttpServe() { CheckErr(err) } +func AddWhiteList(w http.ResponseWriter, r *http.Request) { + + query := r.URL.Query() + uuid := query.Get("uuid") + logger.Info("ClearData , uuid:%v", uuid) + if uuid == "" { + fmt.Fprint(w, "uuid is nil,please check") + return + } + //uuidnum,_ := strconv.Atoi(uuid) + rkey := "CATCAFE_REDIS_CAN_RESETDATA_LIST" + err := redishandler.GetRedisClient().HSet(rkey,uuid,uuid) + if err!= nil { + fmt.Fprint(w, "添加白名单失败,err=%v",err) + }else { + fmt.Fprint(w, "添加白名单成功!") + } + +} + func ClearData(w http.ResponseWriter, r *http.Request) { query := r.URL.Query() -- libgit2 0.21.0