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.
258 lines
11 KiB
258 lines
11 KiB
package gs |
|
|
|
import "server/common" |
|
|
|
const ( |
|
APIRlease = "https://prodmd.9977997.com" |
|
APITest = "https://swmd.6633663.com" |
|
// OperatorCode = "E387" |
|
// SecretKey = "qqmruv" |
|
LaunchGameURL = "/Seamless/LaunchGame" |
|
GetGameListURL = "/Seamless/GetGameList" |
|
) |
|
|
|
type Agent struct { |
|
OperatorCode string |
|
SecretKey string |
|
Currency common.CurrencyType |
|
} |
|
|
|
// 错误码 |
|
var ( |
|
CodeOk = 0 |
|
CodeFailed = 16 |
|
CodeAPIError = 19 |
|
CodeInnerError = 999 |
|
CodeAPIMemberNotExists = 1000 |
|
CodeAPIMemberInsufficientBalance = 1001 |
|
CodeAPIIncorrectAgentKey = 1002 |
|
CodeAPIDuplicateTransaction = 1003 |
|
CodeAPIInvalidSign = 1004 |
|
CodeAPINotGetGameList = 1005 |
|
CodeAPIBetNotExist = 1006 |
|
CodeAPIProductUnderMainTenance = 2000 |
|
) |
|
|
|
var ( |
|
API = "" |
|
AgentMap = map[string]*Agent{} |
|
GameTypeMap = map[int]int{ |
|
common.GameTypeSlots: 1, |
|
common.GameTypeLive: 2, |
|
common.GameTypeTable: 4, |
|
common.GameTypeESport: 13, |
|
common.GameTypeSportBook: 3, |
|
common.GameTypeFish: 8, |
|
} |
|
ProductIDMap = map[int]int{ |
|
common.ProviderSexy: 1022, |
|
common.ProviderPGSoft: 1007, |
|
common.ProviderEvolutionGaming: 1002, |
|
common.ProviderAllBet: 1003, |
|
common.ProviderBigGaming: 1004, |
|
common.ProviderSAGaming: 1005, |
|
common.ProviderPragmaticPlay: 1006, |
|
common.ProviderCQ9: 1009, |
|
common.ProviderPlayTech: 1011, |
|
common.ProviderJoker: 1013, |
|
common.ProviderDragonSoft: 1014, |
|
common.ProviderTFGaming: 1017, |
|
common.ProviderWMCasino: 1020, |
|
common.ProviderKing855: 1038, |
|
common.ProviderAMAYA: 1039, |
|
common.ProviderHabanero: 1041, |
|
common.ProviderIBC: 1046, |
|
common.ProviderReevo: 1048, |
|
common.ProviderEvoPlay: 1049, |
|
common.ProviderPlayStar: 1050, |
|
common.ProviderEzugi: 1051, |
|
common.ProviderDreamGaming: 1052, |
|
common.ProviderNexus4D: 1053, |
|
common.ProviderSlotXo: 1075, |
|
common.ProviderBTI: 1081, |
|
common.ProviderJili: 1091, |
|
common.ProviderJDB: 1085, |
|
common.ProviderCMD368: 1078, |
|
common.ProviderSBO: 1012, |
|
} |
|
ProviderIDMap = map[int]int{ |
|
1022: common.ProviderSexy, |
|
1007: common.ProviderPGSoft, |
|
1002: common.ProviderEvolutionGaming, |
|
1003: common.ProviderAllBet, |
|
1004: common.ProviderBigGaming, |
|
1005: common.ProviderSAGaming, |
|
1006: common.ProviderPragmaticPlay, |
|
1009: common.ProviderCQ9, |
|
1011: common.ProviderPlayTech, |
|
1013: common.ProviderJoker, |
|
1014: common.ProviderDragonSoft, |
|
1017: common.ProviderTFGaming, |
|
1020: common.ProviderWMCasino, |
|
1038: common.ProviderKing855, |
|
1039: common.ProviderAMAYA, |
|
1041: common.ProviderHabanero, |
|
1046: common.ProviderIBC, |
|
1048: common.ProviderReevo, |
|
1049: common.ProviderEvoPlay, |
|
1050: common.ProviderPlayStar, |
|
1051: common.ProviderEzugi, |
|
1052: common.ProviderDreamGaming, |
|
1053: common.ProviderNexus4D, |
|
1075: common.ProviderSlotXo, |
|
1081: common.ProviderBTI, |
|
1091: common.ProviderJili, |
|
1085: common.ProviderJDB, |
|
1078: common.ProviderCMD368, |
|
1012: common.ProviderSBO, |
|
} |
|
CurrencyIDMap = map[int]common.CurrencyType{ |
|
2: common.CurrencyUSDT, |
|
3: common.CurrencyINR, |
|
33: common.CurrencyUSDT, |
|
36: common.CurrencyINR, |
|
} |
|
LangMap = map[string]int{ |
|
"en": 1, |
|
"pt": 28, |
|
} |
|
AgentMapTest = map[string]*Agent{ |
|
"E467": { |
|
OperatorCode: "E467", |
|
SecretKey: "ixurJZ", |
|
Currency: common.CurrencyINR, |
|
}, |
|
"E386": { |
|
OperatorCode: "E386", |
|
SecretKey: "56EcfZ", |
|
Currency: common.CurrencyINR, |
|
}, |
|
"E387": { |
|
OperatorCode: "E387", |
|
SecretKey: "qqmruv", |
|
Currency: common.CurrencyUSDT, |
|
}, |
|
} |
|
AgentMapRelease = map[string]*Agent{ |
|
"E467": { |
|
OperatorCode: "E467", |
|
SecretKey: "COKxg3", |
|
Currency: common.CurrencyINR, |
|
}, |
|
"E387": { |
|
OperatorCode: "E387", |
|
SecretKey: "QclvPN", |
|
Currency: common.CurrencyUSDT, |
|
}, |
|
} |
|
) |
|
|
|
func GetAgentByCode(operatorCode string) *Agent { |
|
return AgentMap[operatorCode] |
|
} |
|
|
|
func GetAgentByCurrency(ct common.CurrencyType) *Agent { |
|
for _, v := range AgentMap { |
|
if v.Currency == ct { |
|
return v |
|
} |
|
} |
|
return nil |
|
} |
|
|
|
const ( |
|
statusPending = iota + 100 |
|
statusSettle |
|
statueVoid |
|
) |
|
|
|
type GetBalanceReq struct { |
|
MemberName string `json:"MemberName"` // 操作员的玩家唯一标识符 (必填) |
|
OperatorCode string `json:"OperatorCode"` // Seamless运算符的唯一标识符 |
|
ProductID int64 `json:"ProductID"` // Seamless产品的唯一标识符 (非必填) |
|
MessageID string `json:"MessageID"` // 当前 API 请求的唯一标识符 (必填) |
|
RequestTime string `json:"RequestTime"` // Request DateTime,格式为 yyyMDDHHMMSS (必填) |
|
Sign string `json:"Sign"` // 请求的签名 |
|
} |
|
|
|
type Transaction struct { |
|
MemberID int64 `json:"MemberID"` // Seamless玩家的唯一标识符 (必填) |
|
OperatorID int64 `json:"OperatorID"` // Seamless运算符的唯一标识符 (必填) |
|
ProductID int `json:"ProductID"` // Seamless产品的唯一标识符 (必填) |
|
ProviderID int64 `json:"ProviderID"` // Seamless提供程序的唯一标识符 (必填) |
|
ProviderLineID int64 `json:"ProviderLineID"` // Seamless对产品线进行配置的唯一标识符 (必填) |
|
WagerID int64 `json:"WagerID,omitempty"` // Seamless工资记录的唯一标识符 (可选) |
|
CurrencyID int `json:"CurrencyID"` // Seamless货币的唯一标识符 (必填) |
|
GameType int `json:"GameType"` // 交易的游戏类型 (必填) |
|
GameID string `json:"GameID,omitempty"` // 提供程序游戏代码 (可选) |
|
GameRoundID string `json:"GameRoundID,omitempty"` // 提供商游戏回合 ID (可选) |
|
ValidBetAmount float64 `json:"ValidBetAmount,omitempty"` // 扣除营业额奖金后的投注金额 (可选) |
|
BetAmount float64 `json:"BetAmount,omitempty"` // 整个投注金额,不扣除营业额奖金 (可选) |
|
TransactionAmount float64 `json:"TransactionAmount"` // 更改需要对玩家钱包执行的操作的金额 (必填) |
|
TransactionID string `json:"TransactionID,omitempty"` // 当前交易的唯一标识符 (可选) |
|
PayoutAmount float64 `json:"PayoutAmount,omitempty"` // 玩家的中奖金额 (可选) |
|
PayoutDetail string `json:"PayoutDetail,omitempty"` // 提供商发送的有关玩家获胜的详细信息 (可选) |
|
BetDetail string `json:"BetDetail,omitempty"` // 有关提供商发送的玩家投注的详细信息 (可选) |
|
CommisionAmount float64 `json:"CommisionAmount,omitempty"` // 佣金金额 (可选) |
|
JackpotAmount float64 `json:"JackpotAmount,omitempty"` // 头奖金额 (可选) |
|
SettlementDate string `json:"SettlementDate,omitempty"` // 最终确定工资记录的日期 (可选) |
|
JPBet float64 `json:"JPBet,omitempty"` // 提供商每次投注的累积奖金 (可选) |
|
Status int `json:"Status"` // 当前交易的状态 (必填) |
|
CreatedOn string `json:"CreatedOn"` // 交易日期 (必填) |
|
ModifiedOn string `json:"ModifiedOn"` // 修改交易的日期 (必填) |
|
} |
|
|
|
type CommonReq struct { |
|
MemberName string `json:"MemberName"` // 操作员的玩家唯一标识符 (必填) |
|
OperatorCode string `json:"OperatorCode"` // Seamless运算符的唯一标识符 |
|
ProductID int64 `json:"ProductID"` // Seamless产品的唯一标识符 (必填) |
|
MessageID string `json:"MessageID"` // 当前 API 请求的唯一标识符 (必填) |
|
RequestTime string `json:"RequestTime"` // Request DateTime,格式为 yyyMDDHHMMSS (必填) |
|
Sign string `json:"Sign"` // 请求的签名 (必填) |
|
Transactions []Transaction `json:"Transactions"` // 交易对象的清单 (必填) |
|
} |
|
|
|
type CommonResp struct { |
|
ErrorCode int `json:"ErrorCode"` // 响应的状态代码 (必填) |
|
ErrorMessage string `json:"ErrorMessage"` // 响应消息 (必填) |
|
Balance float64 `json:"Balance"` // 最终信用余额 (必填,4位小数) |
|
BeforeBalance float64 `json:"BeforeBalance"` // 以前的信用余额 (必填,4位小数) |
|
} |
|
|
|
type CommonResp2 struct { |
|
ErrorCode int `json:"ErrorCode"` // 响应的状态代码 (必填) |
|
ErrorMessage string `json:"ErrorMessage"` // 响应消息 (必填) |
|
Balance float64 `json:"Balance"` // 最终信用余额 (必填,4位小数) |
|
} |
|
|
|
type MobileLoginReq struct { |
|
MemberName string `json:"MemberName"` // 操作员的玩家唯一标识符 (必填) |
|
OperatorCode string `json:"OperatorCode"` // Seamless运算符的唯一标识符 |
|
ProductID int64 `json:"ProductID"` // Seamless产品的唯一标识符 (必填) |
|
MessageID string `json:"MessageID"` // 当前 API 请求的唯一标识符 (必填) |
|
RequestTime string `json:"RequestTime"` // Request DateTime,格式为 yyyMDDHHMMSS (必填) |
|
Sign string `json:"Sign"` // 请求的签名 (必填) |
|
Password string `json:"Password"` // 操作员中的玩家密码 |
|
} |
|
|
|
type BuyInReq struct { |
|
MemberName string `json:"MemberName"` // 操作员的玩家唯一标识符 (必填) |
|
OperatorCode string `json:"OperatorCode"` // Seamless运算符的唯一标识符 |
|
ProductID int64 `json:"ProductID"` // Seamless产品的唯一标识符 (必填) |
|
MessageID string `json:"MessageID"` // 当前 API 请求的唯一标识符 (必填) |
|
RequestTime string `json:"RequestTime"` // Request DateTime,格式为 yyyMDDHHMMSS (必填) |
|
Sign string `json:"Sign"` // 请求的签名 (必填) |
|
Transaction Transaction `json:"Transaction"` // 单一交易对象 |
|
CheckLimit bool `json:"CheckLimit"` // 查看买入限制 |
|
} |
|
|
|
type BuyOutReq struct { |
|
MemberName string `json:"MemberName"` // 操作员的玩家唯一标识符 (必填) |
|
OperatorCode string `json:"OperatorCode"` // Seamless运算符的唯一标识符 |
|
ProductID int64 `json:"ProductID"` // Seamless产品的唯一标识符 (必填) |
|
MessageID string `json:"MessageID"` // 当前 API 请求的唯一标识符 (必填) |
|
RequestTime string `json:"RequestTime"` // Request DateTime,格式为 yyyMDDHHMMSS (必填) |
|
Sign string `json:"Sign"` // 请求的签名 (必填) |
|
Transaction Transaction `json:"Transaction"` // 单一交易对象 |
|
IsAddWager bool `json:"IsAddWager"` // 用于检查在买断期间是否添加了工资记录的标识符 |
|
}
|
|
|