Commit 041e46b757d8053df3ae94c15e5b5cccd1b50d76

Authored by 陆恒
1 parent 77af7168
Exists in ver2.3.0

提交

src/HttpServer/logic/datadef.go
... ... @@ -488,10 +488,14 @@ type GetCashResp struct {
488 488 Msg string `json:"msg"`
489 489 }
490 490  
491   -type GetCashWechatResp struct {
492   - Code string `json:"code"`
  491 +type GetCashWechatData struct {
493 492 Cdkey string `json:"cdkey"`
494   - Msg string `json:"msg"`
  493 +}
  494 +
  495 +type GetCashWechatResp struct {
  496 + Code string `json:"code"`
  497 + Data GetCashWechatData `json:"data"`
  498 + Msg string `json:"msg"`
495 499 }
496 500  
497 501 type GetCashListDesc struct {
... ...
src/HttpServer/logic/function.go
... ... @@ -1361,7 +1361,7 @@ func GetCashWechatFromSDK(uuid int, goldnum int, gameid, channel, openid, nickna
1361 1361 }
1362 1362 if goldnum == 0 || uuid == 0 || gameid == "" || channel == "" || openid == "" || ver == "" {
1363 1363 logger.Error("GetCashFromSDK param empty")
1364   - return "", errors.New("param empty")
  1364 + return "error", errors.New("param empty")
1365 1365 }
1366 1366 var paramlist []string
1367 1367 var params TixianDesc
... ... @@ -1420,14 +1420,14 @@ func GetCashWechatFromSDK(uuid int, goldnum int, gameid, channel, openid, nickna
1420 1420 bys, err := json.Marshal(&params)
1421 1421 if err != nil {
1422 1422 logger.Error("GetCashWechatFromSDK failed=%v", err)
1423   - return "", err
  1423 + return "error", err
1424 1424 }
1425 1425 res, err := DoHttpPost(bys, "api/server/tixiancdkey")
1426 1426 logger.Info("GetCashWechatFromSDK sumparam is:%v,sign is:%v", signsum, sign)
1427 1427 logger.Info("GetCashWechatFromSDK sumparam param=%v", string(bys))
1428 1428 if err != nil {
1429 1429 logger.Error("GetCashWechatFromSDK failed=%v", err)
1430   - return "", err
  1430 + return "error", err
1431 1431 }
1432 1432  
1433 1433 logger.Info("GetCashWechatFromSDK res=%v", res)
... ... @@ -1436,15 +1436,15 @@ func GetCashWechatFromSDK(uuid int, goldnum int, gameid, channel, openid, nickna
1436 1436 err = json.Unmarshal([]byte(res), &resp)
1437 1437 if err != nil {
1438 1438 logger.Error("GetCashWechatFromSDK failed=%v", err)
1439   - return "", err
  1439 + return "error", err
1440 1440 }
1441 1441  
1442 1442 if resp.Code != "0" {
1443 1443 logger.Error("GetCashWechatFromSDK failed=%v", resp.Msg)
1444   - return "", errors.New(resp.Msg)
  1444 + return "error", errors.New(resp.Msg)
1445 1445 }
1446 1446  
1447   - return resp.Cdkey, nil
  1447 + return resp.Data.Cdkey, nil
1448 1448 }
1449 1449  
1450 1450 func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, headurl, ver string, checkcoin int) (int, error) {
... ...