Documentation
¶
Index ¶
- Variables
- func AESDecrypt(encryptedText string) (string, error)
- func AESEncrypt(plainText string) (string, error)
- func CacheTest()
- func CheckLikeByResult(resultList string, startNum int, campus float64) (int, error)
- func GenerateRandomCode(length int) (string, error)
- func GenerateRandomCodeLength(length int) string
- func GetUUID() string
- func Init()
- func MsResultInit()
- func PROlist(pro Probabilities) []string
- func UserToken(db *gorm.DB, r *http.Request) (*model.User, error)
- type BetRecommendation
- type CacheService
- type CardEV
- type ChangeMode4Resp
- type ChangeModeResp
- type Deck
- type DigitalPad
- type EVBase
- type EVPResponse
- type EvValues
- type GameCardEVRequest
- type Hand
- type History
- type JiuXiaoResponse
- type NewEVLogicResponse
- type Probabilities
- type ProbabilitiesPah
- type SWEV5030Resp
- type SWEV5031Resp
- type SWEV5036Resp
- type SWEV5038Req
- type SWEV5038Resp
- type SWRespNew
- type SuanfaResp
- type TomSuanfaReq
- type WTRequest
- type WTResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var MSResult = map[string]string{}
Functions ¶
func AESDecrypt ¶
func AESEncrypt ¶
func CheckLikeByResult ¶
检索相似度 并给出推荐结果
func GenerateRandomCode ¶
GenerateRandomCode 生成指定长度的随机字符码
func PROlist ¶
func PROlist(pro Probabilities) []string
Types ¶
type BetRecommendation ¶
type CacheService ¶
type CacheService struct {
// contains filtered or unexported fields
}
CacheService 定义了一个通用的缓存接口
func NewCache ¶
func NewCache() *CacheService
func NewCacheService ¶
func NewCacheService(defaultExpiration, cleanupInterval time.Duration) *CacheService
NewCacheService 创建一个新的缓存服务实例
func (*CacheService) GetCache ¶
func (cs *CacheService) GetCache(key string) (model.EVPredictive, bool)
GetCache 获取缓存值
func (*CacheService) SetCache ¶
func (cs *CacheService) SetCache(key string, value model.EVPredictive)
SetCache 设置缓存值
type ChangeMode4Resp ¶
type ChangeModeResp ¶
type ChangeModeResp struct {
RoomName string `json:"room_name"`
EvType int `json:"ev_type"`
SortNum int `json:"sort_num"`
}
func ChangeMode4 ¶
func ChangeMode4(gameType string) []ChangeModeResp
type DigitalPad ¶
type DigitalPad struct {
// contains filtered or unexported fields
}
DigitalPad represents the digital scoreboard that displays game statistics.
func (*DigitalPad) EnterResults ¶
func (d *DigitalPad) EnterResults(result string)
EnterResults saves the reults of the hand after bets have been paid out.
type EVPResponse ¶
type EVPResponse struct {
Code int `json:"code"` // 0:成功 1:失败
Msg string `json:"msg"` // 提示信息
Predictive int `json:"predictive"`
BetAmount decimal.Decimal `json:"bet_amount"`
EVList string `json:"ev_list"`
Probability string `json:"probability"`
}
func SwMaster ¶
func SwMaster(history *model.MSGameHistory, url string) (*EVPResponse, error)
func WqwMaster ¶
func WqwMaster(history *model.MSGameHistory, url string) (*EVPResponse, error)
type GameCardEVRequest ¶
type GameCardEVRequest struct {
EVType int `json:"ev_type"` //1. EV值大的;2. EV值大,而且概率差距大于1.47
ZP float64 `json:"zp"` //庄赢的赔率 1.95
XP float64 `json:"xp"` //闲赢的赔率 2
HP float64 `json:"hp"` //和牌的赔率 9
DP float64 `json:"dp"` //发牌对子的赔率 11
FR float64 `json:"fr"` //反水的赔率 0.01
PN int `json:"pn"` //当局一共多少副牌 8
XDZP float64 `json:"xdzp"` //闲对子的赔率
ZDZP float64 `json:"zdzp"` //庄对子的赔率
DZP float64 `json:"dzp"` //庄对子的赔率
SP float64 `json:"sp"` //小牌的赔率
BP float64 `json:"bp"` //大牌的赔率
Condition string `json:"condition"` //已出卡牌列表 逗号分隔 1,2,10,3...
}
type History ¶
type History struct {
Id uint `gorm:"column:id" json:"id"`
CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
GameUuid string `gorm:"column:game_uuid" json:"game_uuid"`
Pukes string `gorm:"column:pukes" json:"pukes"`
Result string `gorm:"column:result" json:"result"`
ZNum uint `gorm:"column:z_num" json:"z_num"`
XNum uint `gorm:"column:x_num" json:"x_num"`
FileUrl string `gorm:"column:file_url" json:"file_url"`
Sort int `gorm:"column:sort" json:"sort"`
Isev int `gorm:"column:isev" json:"isev"`
Dz int `gorm:"column:dz" json:"dz"`
Zdz int `gorm:"column:zdz" json:"zdz"`
Xdz int `gorm:"column:xdz" json:"xdz"`
SmallAndBig int `gorm:"column:small_and_big" json:"small_and_big"`
ZPukes string `gorm:"column:z_pukes" json:"z_pukes"`
XPukes string `gorm:"column:x_pukes" json:"x_pukes"`
RoomName string `gorm:"column:room_name" json:"room_name"`
CardList string `gorm:"column:card_list" json:"card_list"`
GameFrom string `gorm:"column:game_from" json:"game_from"`
GameType string `gorm:"column:game_type" json:"game_type"`
BeforeId int `gorm:"column:before_id" json:"before_id"`
ResultList string `gorm:"column:result_list" json:"result_list"`
}
type JiuXiaoResponse ¶
type JiuXiaoResponse struct {
Predictive int `json:"predictive"` //1庄 2闲 3和
}
func JiuXiao92 ¶
func JiuXiao92(history *model.MSGameHistory) (*JiuXiaoResponse, error)
type NewEVLogicResponse ¶
type NewEVLogicResponse struct {
Prob []EVBase `json:"prob"` //概率
EV []EVBase `json:"ev"` //EV值
RecommendResult int `json:"recommendResult"` //推荐的结果 0-不推荐 1-闲赢 2-庄赢 3-和牌
}
func NewEvLogic ¶
func NewEvLogic(req *GameCardEVRequest) (resp *NewEVLogicResponse, err error)
NewEvLogic ev预测 新的ev
type Probabilities ¶
type ProbabilitiesPah ¶
type SWEV5030Resp ¶
type SWEV5030Resp struct {
PredictedResult string `json:"predicted_result"`
RoomName string `json:"room_name"`
}
func SWEV5030 ¶
func SWEV5030() ([]SWEV5030Resp, error)
type SWEV5031Resp ¶
func SWEV5031 ¶
func SWEV5031() ([]SWEV5031Resp, error)
type SWEV5036Resp ¶
type SWEV5036Resp struct {
Pre string `json:"Pre"`
BetAmount int `json:"bet_amount"`
RoomName string `json:"room_name"`
}
策略94
func SWEV5036 ¶
func SWEV5036() ([]SWEV5036Resp, error)
type SWEV5038Req ¶
type SWEV5038Resp ¶
type SWEV5038Resp struct {
BetRecommendation BetRecommendation `json:"bet_recommendation"`
EvValues EvValues `json:"ev_values"`
GameInfo struct {
CardsPlayed int `json:"cards_played"`
CreatedAt string `json:"created_at"`
GameType string `json:"game_type"`
GameUuid string `json:"game_uuid"`
RoomName string `json:"room_name"`
Sort int `json:"sort"`
} `json:"game_info"`
Probabilities ProbabilitiesPah `json:"probabilities"`
RemainingCards struct {
Field1 int `json:"0"`
Field2 int `json:"1"`
Field3 int `json:"2"`
Field4 int `json:"3"`
Field5 int `json:"4"`
Field6 int `json:"5"`
Field7 int `json:"6"`
Field8 int `json:"7"`
Field9 int `json:"8"`
Field10 int `json:"9"`
} `json:"remaining_cards"`
Summary string `json:"summary"`
}
func SWEV77 ¶
func SWEV77(history *model.MSGameHistory) (*SWEV5038Resp, error)
func SWEV5038 ¶
func SWEV5038(history *model.MSGameHistory) (*SWEV5038Resp, error)
type SWRespNew ¶
type SWRespNew struct {
Prediction string `json:"prediction"`
Probabilities Probabilities
}
type SuanfaResp ¶
type SuanfaResp struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data struct {
Predictive int `json:"predictive"`
Probability string `json:"probability"`
} `json:"data"`
}
func TomSuanfa ¶
func TomSuanfa(history *model.MSGameHistory, evType int) (*SuanfaResp, error)
type TomSuanfaReq ¶
type WTResponse ¶
Click to show internal directories.
Click to hide internal directories.