7
0

金额改成int

This commit is contained in:
许 洋 2026-05-20 19:27:53 +08:00
parent 9c93f863b5
commit d67eb28722
6 changed files with 24 additions and 23 deletions

View File

@ -418,10 +418,12 @@ func TestGetRole(t *testing.T) {
return return
} }
//game_id=9175&server_id=0&user_id=247058227&user_name=yg90938415&no_virtual=1 //game_id=9175&server_id=0&user_id=247058227&user_name=yg90938415&no_virtual=1
//game_id=3706&no_virtual=1&reg_time=0&server_id=0&use_cache=0&user_id=253403109&user_name=nl16840512
req := CreateGetRoleReq(&GetRoleReq{ req := CreateGetRoleReq(&GetRoleReq{
GameId: 7874, ServerId: 10358,
UserId: "221016372", GameId: 8049,
UserName: "rz35990497", UserId: "135837010",
UserName: "qy13815523",
NoVirtual: 1, NoVirtual: 1,
}) })
resp, err := client.GetRole(req) resp, err := client.GetRole(req)
@ -429,5 +431,5 @@ func TestGetRole(t *testing.T) {
t.Error(err) t.Error(err)
return return
} }
fmt.Printf("%+v", resp.Data.RoleListInfo[0]) fmt.Printf("%+v", resp)
} }

View File

@ -1,8 +1,6 @@
package game package game
import ( import (
"fmt"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses"
) )
@ -70,7 +68,7 @@ type MakeOrderReq struct {
RealSid string `position:"Body" field:"real_sid"` RealSid string `position:"Body" field:"real_sid"`
RoleId string `position:"Body" field:"role_id"` RoleId string `position:"Body" field:"role_id"`
RoleName string `position:"Body" field:"role_name"` RoleName string `position:"Body" field:"role_name"`
Money string `position:"Body" field:"money"` Money int `position:"Body" field:"money"`
ServerName string `position:"Body" field:"server_name"` ServerName string `position:"Body" field:"server_name"`
ProductName string `position:"Body" field:"product_name"` ProductName string `position:"Body" field:"product_name"`
DwId int64 `position:"Body" field:"dw_id"` DwId int64 `position:"Body" field:"dw_id"`
@ -94,7 +92,7 @@ type MakeOrderParam struct {
RealSid string RealSid string
RoleId string RoleId string
RoleName string RoleName string
Money float64 Money int
ServerName string ServerName string
ProductName string ProductName string
DwId int64 DwId int64
@ -109,7 +107,7 @@ func CreateMakeOrderReq(param MakeOrderParam) *MakeOrderReq {
RealSid: param.RealSid, RealSid: param.RealSid,
RoleId: param.RoleId, RoleId: param.RoleId,
RoleName: param.RoleName, RoleName: param.RoleName,
Money: fmt.Sprintf("%v", param.Money), Money: param.Money,
ServerName: param.ServerName, ServerName: param.ServerName,
ProductName: param.ProductName, ProductName: param.ProductName,
DwId: param.DwId, DwId: param.DwId,

View File

@ -198,7 +198,7 @@ func TestGetUserId(t *testing.T) {
t.Error(err) t.Error(err)
return return
} }
req := CreateGetUserIdRequest("rz35990497") req := CreateGetUserIdRequest("qy13815523")
resp, err := client.GetUserId(req) resp, err := client.GetUserId(req)
if err != nil { if err != nil {
t.Error(err) t.Error(err)

View File

@ -48,7 +48,7 @@ func TestManualReplenish(t *testing.T) {
} }
req := CreateManualReplenishRequest(ManualReplenishParam{ req := CreateManualReplenishRequest(ManualReplenishParam{
GameId: 100, GameId: 100,
Money: 6, Money: 98,
OrderId: "202112060000193551730", OrderId: "202112060000193551730",
UserName: "testuser", UserName: "testuser",
PayChannel: 1, PayChannel: 1,

View File

@ -7,7 +7,7 @@ import (
type ManualReplenishParam struct { type ManualReplenishParam struct {
GameId int64 GameId int64
Money float64 Money int
OrderId string OrderId string
UserName string UserName string
PayChannel int64 PayChannel int64
@ -16,12 +16,12 @@ type ManualReplenishParam struct {
type ManualReplenishRequest struct { type ManualReplenishRequest struct {
*requests.RpcRequest *requests.RpcRequest
GameId int64 `position:"Body" field:"game_id"` GameId int64 `position:"Body" field:"game_id"`
Money float64 `position:"Body" field:"money"` Money int `position:"Body" field:"money"`
OrderId string `position:"Body" field:"order_id"` OrderId string `position:"Body" field:"order_id"`
UserName string `position:"Body" field:"user_name"` UserName string `position:"Body" field:"user_name"`
PayChannel int64 `position:"Body" field:"pay_channel"` PayChannel int64 `position:"Body" field:"pay_channel"`
PayChannelType int64 `position:"Body" field:"pay_channel_type"` PayChannelType int64 `position:"Body" field:"pay_channel_type"`
} }
type ManualReplenishResponse struct { type ManualReplenishResponse struct {

View File

@ -3,8 +3,9 @@ package sms
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
"testing" "testing"
"golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests"
) )
var ( var (
@ -108,16 +109,16 @@ func TestClient_SendSmsCode(t *testing.T) {
}}, }},
}) })
req.Domain = requests.Host{ //req.Domain = requests.Host{
Default: "127.0.0.1:8804", // Default: "127.0.0.1:8804",
} //}
sms, err := client.SendSms(req) sms, err := client.SendSms(req)
if err != nil { if err != nil {
panic(err) panic(err)
} }
fmt.Println(sms) fmt.Println(sms.Msg)
} }
func TestClient_SendSmsUrl(t *testing.T) { func TestClient_SendSmsUrl(t *testing.T) {