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.
63 lines
1.7 KiB
63 lines
1.7 KiB
|
1 year ago
|
package awc
|
||
|
|
|
||
|
|
import (
|
||
|
|
"fmt"
|
||
|
|
"server/call"
|
||
|
|
"server/common"
|
||
|
|
"server/config"
|
||
|
|
"server/util"
|
||
|
|
"strings"
|
||
|
|
|
||
|
|
"github.com/liangdas/mqant/log"
|
||
|
|
)
|
||
|
|
|
||
|
|
type CreateMemberReq struct {
|
||
|
|
Cert string `json:"cert"`
|
||
|
|
AgentId string `json:"agentId"`
|
||
|
|
UserId string `json:"userId"`
|
||
|
|
Currency string `json:"currency"`
|
||
|
|
BetLimit string `json:"betLimit"` // {"SEXYBCRT":{"LIVE":{"limitId":[110901,110902]}}}
|
||
|
|
Language string `json:"language"` // en
|
||
|
|
UserName string `json:"userName"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func CreateMember(uid int, ct common.CurrencyType) bool {
|
||
|
|
ctName := strings.ToUpper(ct.GetCurrencyName())
|
||
|
|
if ctName == "USDT" {
|
||
|
|
ctName = "USD"
|
||
|
|
}
|
||
|
|
p, _ := call.GetUserXInfo(uid, "nick")
|
||
|
|
req := &CreateMemberReq{
|
||
|
|
Cert: Cert,
|
||
|
|
AgentId: AgentID,
|
||
|
|
UserId: fmt.Sprintf("%v%s", uid, ct.GetCurrencyName()),
|
||
|
|
Currency: ctName,
|
||
|
|
// BetLimit: ,
|
||
|
|
Language: "en",
|
||
|
|
UserName: p.Nick,
|
||
|
|
}
|
||
|
|
if ct == common.CurrencyBrazil {
|
||
|
|
if !config.GetBase().Release {
|
||
|
|
req.BetLimit = `{"SEXYBCRT":{"LIVE":{"limitId":[284901,284902,284903]}}}`
|
||
|
|
} else {
|
||
|
|
req.BetLimit = `{"SEXYBCRT":{"LIVE":{"limitId":[154902,154903,154904]}}}`
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
if !config.GetBase().Release {
|
||
|
|
req.BetLimit = `{"SEXYBCRT":{"LIVE":{"limitId":[280701,280702,280703]}}}`
|
||
|
|
} else {
|
||
|
|
req.BetLimit = `{"SEXYBCRT":{"LIVE":{"limitId":[150704,150705,150703]}}}`
|
||
|
|
}
|
||
|
|
}
|
||
|
|
url := API + CreateAPI
|
||
|
|
// reqURL := fmt.Sprintf("%s?Token=%s&GameId=%d&Lang=%s&AgentId=%s&Key=%s", url, token, gameid, reqLang, AgentID, GetSignKey(req))
|
||
|
|
log.Debug("sexy CreateMember:%+v,url:%s", *req, url)
|
||
|
|
ret := new(CommonResp)
|
||
|
|
util.HttpPostForm(url, req, &ret, nil)
|
||
|
|
log.Debug("sexy CreateMember resp:%+v", ret)
|
||
|
|
// if str, ok := ret.Data.(string); ok {
|
||
|
|
// return str
|
||
|
|
// }
|
||
|
|
return ret.Status == "0000"
|
||
|
|
}
|