Commit b4816ad6e8a0f6c00a5935f193fe93796f5c9ba6
1 parent
7417db33
Exists in
master
提交
Showing
1 changed file
with
21 additions
and
0 deletions
Show diff stats
src/HttpServer/logic/httpserver.go
| ... | ... | @@ -116,6 +116,7 @@ func startServerHttpServe() { |
| 116 | 116 | http.HandleFunc("/api/test/addFlop", AddFlop) //增加翻牌 |
| 117 | 117 | http.HandleFunc("/api/test/settlement", Settlement) //发财猫开奖 |
| 118 | 118 | http.HandleFunc("/api/test/addresource", Addresource) //增加资源 |
| 119 | + http.HandleFunc("/api/test/cleardata", Cleardata) //清号 | |
| 119 | 120 | |
| 120 | 121 | //real |
| 121 | 122 | http.HandleFunc("/api/account/login", UserLogin) //登录 |
| ... | ... | @@ -1336,6 +1337,26 @@ func Getrandredbag(w http.ResponseWriter, r *http.Request) { |
| 1336 | 1337 | HandlerGetrandredbag(w, s, Uuid) |
| 1337 | 1338 | } |
| 1338 | 1339 | |
| 1340 | +func Cleardata(w http.ResponseWriter, r *http.Request) { | |
| 1341 | + Uuid := 0 | |
| 1342 | + if len(r.Header) > 0 { | |
| 1343 | + Uuid, _ = strconv.Atoi(r.Header.Get("uid")) | |
| 1344 | + } | |
| 1345 | + if Uuid == 0 { | |
| 1346 | + SetHeader(w) | |
| 1347 | + return | |
| 1348 | + } | |
| 1349 | + result, _ := ioutil.ReadAll(r.Body) | |
| 1350 | + r.Body.Close() | |
| 1351 | + | |
| 1352 | + s := string(result) | |
| 1353 | + logger.Info("Cleardata , body:%v,uuid=%v", s, Uuid) | |
| 1354 | + | |
| 1355 | + //SaveUserInfo(uinfo, strconv.Itoa(Uuid)) | |
| 1356 | + redishandler.GetRedisClient().HDel(redis.USER_INFO__KEY, strconv.Itoa(Uuid)) | |
| 1357 | + fmt.Fprint(w, "success") | |
| 1358 | +} | |
| 1359 | + | |
| 1339 | 1360 | func Addresource(w http.ResponseWriter, r *http.Request) { |
| 1340 | 1361 | Uuid := 0 |
| 1341 | 1362 | if len(r.Header) > 0 { | ... | ... |