Commit 7f6e630a500ec99cd71c2120163b5618c7992b43
1 parent
0b943e81
Exists in
master
and in
4 other branches
提交
Showing
1 changed file
with
20 additions
and
0 deletions
Show diff stats
src/HttpServer/logic/httpserver.go
@@ -42,6 +42,7 @@ func startServerHttpServe() { | @@ -42,6 +42,7 @@ func startServerHttpServe() { | ||
42 | //------------------------------------------------------------- | 42 | //------------------------------------------------------------- |
43 | 43 | ||
44 | http.HandleFunc("/eliminatestar/test", Testapi) //测试接口 | 44 | http.HandleFunc("/eliminatestar/test", Testapi) //测试接口 |
45 | + http.HandleFunc("/eliminatestar/addcoin", Addcoin) //测试接口 | ||
45 | http.HandleFunc("/eliminatestar/clear", ClearData) //清除账号 | 46 | http.HandleFunc("/eliminatestar/clear", ClearData) //清除账号 |
46 | //---------------------------------------------------------------------------------------- | 47 | //---------------------------------------------------------------------------------------- |
47 | http.HandleFunc("/eliminatestar/login", UserLogin) //登录 | 48 | http.HandleFunc("/eliminatestar/login", UserLogin) //登录 |
@@ -133,6 +134,25 @@ func Querysigndata(w http.ResponseWriter, r *http.Request) { | @@ -133,6 +134,25 @@ func Querysigndata(w http.ResponseWriter, r *http.Request) { | ||
133 | HandlerQuerysigndata(w, s, Uuid) | 134 | HandlerQuerysigndata(w, s, Uuid) |
134 | } | 135 | } |
135 | 136 | ||
137 | +func Addcoin(w http.ResponseWriter, r *http.Request) { | ||
138 | + SetHeader(w) | ||
139 | + query := r.URL.Query() | ||
140 | + uuid := query.Get("uuid") | ||
141 | + uuidnum, _ := strconv.Atoi(uuid) | ||
142 | + uinfo, err := GetUserInfo(uuidnum) | ||
143 | + if err != nil || uinfo == nil { | ||
144 | + logger.Error("redis failed err=%v", err) | ||
145 | + fmt.Fprint(w, "failed") | ||
146 | + return | ||
147 | + } | ||
148 | + //调用sdk | ||
149 | + gold, err := AddCoinToSdk(uuidnum, 1000, "1001", "SA002", 99) | ||
150 | + if err != nil { | ||
151 | + logger.Error("test ddt! err=%v", err) | ||
152 | + } | ||
153 | + uinfo.RealGold = gold | ||
154 | +} | ||
155 | + | ||
136 | func Testapi(w http.ResponseWriter, r *http.Request) { | 156 | func Testapi(w http.ResponseWriter, r *http.Request) { |
137 | 157 | ||
138 | SetHeader(w) | 158 | SetHeader(w) |