Commit ec844ee44d60705dae03a6333ba0c0b597c7af64

Authored by 陆恒
1 parent 99813ece
Exists in master

提交

Showing 1 changed file with 21 additions and 1 deletions   Show diff stats
src/HttpServer/logic/httpserver.go
... ... @@ -36,7 +36,7 @@ func CheckErr(err error) {
36 36 func startServerHttpServe() {
37 37 //-------------------------------------------------------------
38 38 http.HandleFunc("/catcafe/ClearData", ClearData) //情况账号的测试接口
39   -
  39 + http.HandleFunc("/catcafe/AddWhiteList", AddWhiteList) //情况账号的测试接口
40 40 //-------------------------------------------------------------
41 41 http.HandleFunc("/catcafe/login", UserLogin) //游客登录
42 42 http.HandleFunc("/catcafe/user/regeister", Regeister) //账号注册
... ... @@ -71,6 +71,26 @@ func startServerHttpServe() {
71 71 CheckErr(err)
72 72 }
73 73  
  74 +func AddWhiteList(w http.ResponseWriter, r *http.Request) {
  75 +
  76 + query := r.URL.Query()
  77 + uuid := query.Get("uuid")
  78 + logger.Info("ClearData , uuid:%v", uuid)
  79 + if uuid == "" {
  80 + fmt.Fprint(w, "uuid is nil,please check")
  81 + return
  82 + }
  83 + //uuidnum,_ := strconv.Atoi(uuid)
  84 + rkey := "CATCAFE_REDIS_CAN_RESETDATA_LIST"
  85 + err := redishandler.GetRedisClient().HSet(rkey,uuid,uuid)
  86 + if err!= nil {
  87 + fmt.Fprint(w, "添加白名单失败,err=%v",err)
  88 + }else {
  89 + fmt.Fprint(w, "添加白名单成功!")
  90 + }
  91 +
  92 +}
  93 +
74 94 func ClearData(w http.ResponseWriter, r *http.Request) {
75 95  
76 96 query := r.URL.Query()
... ...