You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
3.1 KiB
84 lines
3.1 KiB
package jin2 |
|
|
|
// Success Codes |
|
const ( |
|
CodeSuccess = 0 // 操作成功 |
|
) |
|
|
|
// Request Error Codes |
|
const ( |
|
CodeRequestEmptyParams = 1001 // 请求参数为空 |
|
CodeRequestInvalidParams = 1002 // 请求参数错误 |
|
CodeSignatureError = 1003 // 签名错误 |
|
CodeInvalidOperator = 1004 // 无效的运营商代码 |
|
) |
|
|
|
// Operation Error Codes |
|
const ( |
|
CodeOperationFailed = 3001 // 操作失败(没有具体的失败原因说明) |
|
CodeUserNotFound = 3002 // 用户不存在 |
|
CodeUserDataIncomplete = 3003 // 用户数据未加载完全 |
|
CodeParameterProcessingError = 3004 // 参数处理异常(一般是数据不一致导致的) |
|
CodeDuplicateOrder = 3005 // 订单号重复 |
|
CodeTokenMismatch = 3006 // Token不一致 |
|
CodeRequestRateLimit = 3007 // 请求频率过高 |
|
CodeInsufficientBalance = 3008 // 余额不足 |
|
) |
|
|
|
type GetBalanceReq struct { |
|
AppID string |
|
AppSecret string |
|
UserID string |
|
} |
|
|
|
type GetBalanceResp struct { |
|
Code int `json:"code"` |
|
Error string `json:"error"` |
|
Data struct { |
|
Balance float64 `json:"Balance"` |
|
Level int `json:"Level"` |
|
} `json:"data"` |
|
} |
|
|
|
type GameBetReq struct { |
|
IsEnd bool // 返奖时游戏结束标识(true: 当前对局已结束, false: 当前对局未结束) |
|
AppID string // 运营商唯一标识 |
|
AppSecret string // 运营商 AppSecret |
|
UserID string // 运营商的玩家唯一标识 |
|
TransactionID string // 交易订单号 |
|
Amount float64 // 增加/扣除金额(+ 增加, - 扣除) |
|
RoundID string // 本局游戏 ID |
|
GameID string // 游戏 ID |
|
ReqTime string // 请求时间 |
|
Reason string // bet 下注扣款; win 派奖; refund 服务器内部出错,退回下注 |
|
} |
|
|
|
type GameBetResp struct { |
|
Code int `json:"code"` |
|
Error string `json:"error"` |
|
Data struct { |
|
Balance float64 `json:"Balance"` |
|
Level int `json:"Level"` |
|
} `json:"data"` |
|
} |
|
|
|
type JackpotReq struct { |
|
Reference string `json:"reference" form:"reference"` // 当前注单号 |
|
OperatorID string `json:"operator_id" form:"operator_id"` // 本平台提供的运营商ID |
|
Accounts string `json:"accounts" form:"accounts"` // 运营的游戏帐号或ID |
|
Token string `json:"token" form:"token"` // authentication 返回的 token |
|
GameID string `json:"game_id" form:"game_id"` // 游戏类型ID |
|
RoomID string `json:"room_id" form:"room_id"` // 游戏房间ID |
|
WinAmount float64 `json:"win_amount" form:"win_amount"` // 当前游戏彩金金额 |
|
RecordType string `json:"record_type" form:"record_type"` // 10 小彩金 11 大彩金 12 中等彩金 |
|
BetReferenceID string `json:"bet_reference_id" form:"bet_reference_id"` // 压注注单号 |
|
RoundID string `json:"round_id" form:"round_id"` // 局号 |
|
} |
|
|
|
type JackpotResp struct { |
|
Code int `json:"code"` |
|
Msg string `json:"msg"` |
|
Data struct { |
|
Amount float64 `json:"amount"` |
|
} `json:"data"` |
|
}
|
|
|