Commit 0b7af79c817882c5ef2cbc9d0784c79a07731f61
1 parent
21636801
Exists in
master
and in
4 other branches
提交
Showing
3 changed files
with
17 additions
and
3 deletions
Show diff stats
src/HttpServer/logic/datadef.go
| ... | ... | @@ -110,6 +110,7 @@ type GetcashReq struct { |
| 110 | 110 | Openid string `json:"openid"` |
| 111 | 111 | Nickname string `json:"nickname"` |
| 112 | 112 | Headurl string `json:"headurl"` |
| 113 | + Ver string `json:"ver"` | |
| 113 | 114 | } |
| 114 | 115 | |
| 115 | 116 | type GetcashData struct { |
| ... | ... | @@ -314,6 +315,8 @@ type TixianDesc struct { |
| 314 | 315 | Openid string `json:"openid"` |
| 315 | 316 | Nickname string `json:"nickname"` |
| 316 | 317 | Headurl string `json:"headurl"` |
| 318 | + Editcoin int `json:"editcoin"` | |
| 319 | + Ver string `json:"ver"` | |
| 317 | 320 | } |
| 318 | 321 | |
| 319 | 322 | type AddCoinDesc struct { | ... | ... |
src/HttpServer/logic/function.go
| ... | ... | @@ -921,8 +921,8 @@ func AddCoinToSdk(uuid int, goldnum int, gameid string, channel string, atype in |
| 921 | 921 | return resp.Data.Mycoin, nil |
| 922 | 922 | } |
| 923 | 923 | |
| 924 | -func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, headurl string) (int, error) { | |
| 925 | - if goldnum == 0 || uuid == 0 || gameid == "" || channel == "" || openid == "" || nickname == "" || headurl == "" { | |
| 924 | +func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, headurl, ver string) (int, error) { | |
| 925 | + if goldnum == 0 || uuid == 0 || gameid == "" || channel == "" || openid == "" || nickname == "" || headurl == "" || ver == "" { | |
| 926 | 926 | logger.Error("GetCashFromSDK param empty") |
| 927 | 927 | return 0, errors.New("param empty") |
| 928 | 928 | } |
| ... | ... | @@ -938,6 +938,8 @@ func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, he |
| 938 | 938 | params.Openid = openid |
| 939 | 939 | params.Nickname = nickname |
| 940 | 940 | params.Typ = 6 |
| 941 | + params.Ver = ver | |
| 942 | + params.Editcoin = 1 | |
| 941 | 943 | signtypestr := "sign_type=" + params.Sign_type |
| 942 | 944 | timestampstr := "time_stamp=" + strconv.Itoa(int(time.Now().Unix())) |
| 943 | 945 | paramgameid := "gameid=" + gameid |
| ... | ... | @@ -948,6 +950,8 @@ func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, he |
| 948 | 950 | popenid := "openid=" + openid |
| 949 | 951 | pmoney := "money=" + strconv.Itoa(goldnum) |
| 950 | 952 | ptype := "typ=" + "6" //微信 |
| 953 | + ped := "editcoin=1" | |
| 954 | + pver := "ver=" + params.Ver | |
| 951 | 955 | paramlist = append(paramlist, signtypestr) |
| 952 | 956 | paramlist = append(paramlist, timestampstr) |
| 953 | 957 | paramlist = append(paramlist, paramgameid) |
| ... | ... | @@ -958,6 +962,8 @@ func GetCashFromSDK(uuid int, goldnum int, gameid, channel, openid, nickname, he |
| 958 | 962 | paramlist = append(paramlist, popenid) |
| 959 | 963 | paramlist = append(paramlist, pmoney) |
| 960 | 964 | paramlist = append(paramlist, ptype) |
| 965 | + paramlist = append(paramlist, ped) | |
| 966 | + paramlist = append(paramlist, pver) | |
| 961 | 967 | |
| 962 | 968 | sumparam := GettotalParam(paramlist) |
| 963 | 969 | //加serverkey | ... | ... |
src/HttpServer/logic/logic.go
| ... | ... | @@ -102,6 +102,11 @@ func HandlerGetcash(w http.ResponseWriter, data string, uuid int) { |
| 102 | 102 | resp.Code = ERROR_JSONUNMASH_ERROR |
| 103 | 103 | break |
| 104 | 104 | } |
| 105 | + //临时处理一下 | |
| 106 | + if rdata.Ver == "" { | |
| 107 | + rdata.Ver = "2.0.0" | |
| 108 | + } | |
| 109 | + | |
| 105 | 110 | uinfo, err := GetUserInfo(uuid) |
| 106 | 111 | if err != nil || uinfo == nil { |
| 107 | 112 | logger.Error("redis failed err=%v", err) |
| ... | ... | @@ -119,7 +124,7 @@ func HandlerGetcash(w http.ResponseWriter, data string, uuid int) { |
| 119 | 124 | break |
| 120 | 125 | } |
| 121 | 126 | |
| 122 | - _, err = GetCashFromSDK(uuid, drawnum, rdata.Gameid, rdata.Channel, rdata.Openid, rdata.Nickname, rdata.Headurl) | |
| 127 | + _, err = GetCashFromSDK(uuid, drawnum, rdata.Gameid, rdata.Channel, rdata.Openid, rdata.Nickname, rdata.Headurl, rdata.Ver) | |
| 123 | 128 | if err != nil { |
| 124 | 129 | logger.Error("GetCashFromSDK failed err=%v", err) |
| 125 | 130 | resp.Message = "从后台提现失败了" | ... | ... |