223 lines
6.7 KiB
Go
223 lines
6.7 KiB
Go
package domain
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
)
|
|
|
|
type BaseResultResponse struct {
|
|
Success int `json:"success"`
|
|
Results []json.RawMessage `json:"results"`
|
|
}
|
|
type FootballResultResponse struct {
|
|
ID string `json:"id"`
|
|
SportID string `json:"sport_id"`
|
|
Time string `json:"time"`
|
|
TimeStatus string `json:"time_status"`
|
|
League struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
CC string `json:"cc"`
|
|
} `json:"league"`
|
|
Home struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
ImageID string `json:"image_id"`
|
|
CC string `json:"cc"`
|
|
} `json:"home"`
|
|
Away struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
ImageID string `json:"image_id"`
|
|
CC string `json:"cc"`
|
|
} `json:"away"`
|
|
SS string `json:"ss"`
|
|
Scores struct {
|
|
FirstHalf Score `json:"1"`
|
|
SecondHalf Score `json:"2"`
|
|
} `json:"scores"`
|
|
Stats struct {
|
|
Attacks []string `json:"attacks"`
|
|
Corners []string `json:"corners"`
|
|
DangerousAttacks []string `json:"dangerous_attacks"`
|
|
Goals []string `json:"goals"`
|
|
OffTarget []string `json:"off_target"`
|
|
OnTarget []string `json:"on_target"`
|
|
Penalties []string `json:"penalties"`
|
|
PossessionRT []string `json:"possession_rt"`
|
|
RedCards []string `json:"redcards"`
|
|
Substitutions []string `json:"substitutions"`
|
|
YellowCards []string `json:"yellowcards"`
|
|
} `json:"stats"`
|
|
Extra struct {
|
|
HomePos string `json:"home_pos"`
|
|
AwayPos string `json:"away_pos"`
|
|
StadiumData map[string]string `json:"stadium_data"`
|
|
Round string `json:"round"`
|
|
} `json:"extra"`
|
|
Events []map[string]string `json:"events"`
|
|
HasLineup int `json:"has_lineup"`
|
|
ConfirmedAt string `json:"confirmed_at"`
|
|
Bet365ID string `json:"bet365_id"`
|
|
}
|
|
|
|
type BasketballResultResponse struct {
|
|
ID string `json:"id"`
|
|
SportID string `json:"sport_id"`
|
|
Time string `json:"time"`
|
|
TimeStatus string `json:"time_status"`
|
|
League struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
CC string `json:"cc"`
|
|
} `json:"league"`
|
|
Home struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
ImageID string `json:"image_id"`
|
|
CC string `json:"cc"`
|
|
} `json:"home"`
|
|
Away struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
ImageID string `json:"image_id"`
|
|
CC string `json:"cc"`
|
|
} `json:"away"`
|
|
SS string `json:"ss"`
|
|
Scores struct {
|
|
FirstQuarter Score `json:"1"`
|
|
SecondQuarter Score `json:"2"`
|
|
FirstHalf Score `json:"3"`
|
|
ThirdQuarter Score `json:"4"`
|
|
FourthQuarter Score `json:"5"`
|
|
TotalScore Score `json:"7"`
|
|
} `json:"scores"`
|
|
Stats struct {
|
|
TwoPoints []string `json:"2points"`
|
|
ThreePoints []string `json:"3points"`
|
|
BiggestLead []string `json:"biggest_lead"`
|
|
Fouls []string `json:"fouls"`
|
|
FreeThrows []string `json:"free_throws"`
|
|
FreeThrowRate []string `json:"free_throws_rate"`
|
|
LeadChanges []string `json:"lead_changes"`
|
|
MaxpointsInarow []string `json:"maxpoints_inarow"`
|
|
Possession []string `json:"possession"`
|
|
SuccessAttempts []string `json:"success_attempts"`
|
|
TimeSpendInLead []string `json:"timespent_inlead"`
|
|
Timeuts []string `json:"time_outs"`
|
|
} `json:"stats"`
|
|
Extra struct {
|
|
HomePos string `json:"home_pos"`
|
|
AwayPos string `json:"away_pos"`
|
|
AwayManager map[string]string `json:"away_manager"`
|
|
HomeManager map[string]string `json:"home_manager"`
|
|
NumberOfPeriods string `json:"numberofperiods"`
|
|
PeriodLength string `json:"periodlength"`
|
|
StadiumData map[string]string `json:"stadium_data"`
|
|
Length string `json:"length"`
|
|
Round string `json:"round"`
|
|
} `json:"extra"`
|
|
Events []map[string]string `json:"events"`
|
|
HasLineup int `json:"has_lineup"`
|
|
ConfirmedAt string `json:"confirmed_at"`
|
|
Bet365ID string `json:"bet365_id"`
|
|
}
|
|
type IceHockeyResultResponse struct {
|
|
ID string `json:"id"`
|
|
SportID string `json:"sport_id"`
|
|
Time string `json:"time"`
|
|
TimeStatus string `json:"time_status"`
|
|
League struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
CC string `json:"cc"`
|
|
} `json:"league"`
|
|
Home struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
ImageID string `json:"image_id"`
|
|
CC string `json:"cc"`
|
|
} `json:"home"`
|
|
Away struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
ImageID string `json:"image_id"`
|
|
CC string `json:"cc"`
|
|
} `json:"away"`
|
|
SS string `json:"ss"`
|
|
Scores struct {
|
|
FirstPeriod Score `json:"1"`
|
|
SecondPeriod Score `json:"2"`
|
|
ThirdPeriod Score `json:"3"`
|
|
TotalScore Score `json:"5"`
|
|
} `json:"scores"`
|
|
|
|
Stats struct {
|
|
Shots []string `json:"shots"`
|
|
Penalties []string `json:"penalties"`
|
|
GoalsOnPowerPlay []string `json:"goals_on_power_play"`
|
|
SSeven []string `json:"s7"`
|
|
} `json:"stats"`
|
|
Extra struct {
|
|
HomePos string `json:"home_pos"`
|
|
AwayPos string `json:"away_pos"`
|
|
AwayManager map[string]string `json:"away_manager"`
|
|
HomeManager map[string]string `json:"home_manager"`
|
|
NumberOfPeriods string `json:"numberofperiods"`
|
|
PeriodLength string `json:"periodlength"`
|
|
StadiumData map[string]string `json:"stadium_data"`
|
|
Length string `json:"length"`
|
|
Round string `json:"round"`
|
|
} `json:"extra"`
|
|
Events []map[string]string `json:"events"`
|
|
HasLineup int `json:"has_lineup"`
|
|
ConfirmedAt string `json:"confirmed_at"`
|
|
Bet365ID string `json:"bet365_id"`
|
|
}
|
|
|
|
type Score struct {
|
|
Home string `json:"home"`
|
|
Away string `json:"away"`
|
|
}
|
|
|
|
type MarketConfig struct {
|
|
Sport string
|
|
MarketCategories map[string]bool
|
|
MarketTypes map[int64]bool
|
|
}
|
|
|
|
type Result struct {
|
|
ID int64
|
|
BetOutcomeID int64
|
|
EventID int64
|
|
OddID int64
|
|
MarketID int64
|
|
Status OutcomeStatus
|
|
Score string
|
|
FullTimeScore string
|
|
HalfTimeScore string
|
|
SS string
|
|
Scores map[string]Score
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type CreateResult struct {
|
|
BetOutcomeID int64
|
|
EventID int64
|
|
OddID int64
|
|
MarketID int64
|
|
Status OutcomeStatus
|
|
Score string
|
|
}
|
|
|
|
type OutcomeStatus int32
|
|
|
|
const (
|
|
OUTCOME_STATUS_PENDING OutcomeStatus = 0
|
|
OUTCOME_STATUS_WIN OutcomeStatus = 1
|
|
OUTCOME_STATUS_LOSS OutcomeStatus = 2
|
|
OUTCOME_STATUS_VOID OutcomeStatus = 3 //Give Back
|
|
OUTCOME_STATUS_HALF OutcomeStatus = 4 //Half Win and Half Given Back
|
|
)
|