Appearance
賽事詳情(開發文檔)
最後更新:2026-04-10
📖 功能說明請參考 賽事詳情
架構
相關檔案
ViewController(9 個)
| 檔案 | 說明 |
|---|---|
.../EventDetail/STEventDetailViewController.swift | 主控制器 |
.../EventDetail/STEventDetailViewController+Action.swift | Action 擴展 |
.../EventDetail/STEventDetailViewController+TableView.swift | TableView 擴展 |
.../EventDetail/STEventDetailViewController+BallView.swift | BallView 擴展 |
.../EventDetail/STEventDetailViewController+Gesture.swift | 手勢擴展 |
.../EventDetail/STEventDetailViewController+League.swift | 聯賽擴展 |
.../EventDetail/STEventDetailViewController+MoreLive.swift | 更多直播擴展 |
.../Views/EventDetailPlan/EventDetailPlanWebViewController.swift | 方案 Web |
.../Views/ChatView/ChatVote/ChatVoteViewController.swift | 競猜 VC |
基礎路徑:
BBSport/Tab/体育/Sport/EventDetail/
ViewModel(4 個)
| 檔案 | 說明 |
|---|---|
.../EventDetail/VM/STEventDetailViewModel.swift | 主 ViewModel |
.../EventDetail/VM/STEventDetailViewModel+RxSwift.swift | RxSwift 擴展 |
.../VM/BetList/BetListViewModel.swift | 盤口列表 VM |
.../VM/HotInPlayRank/STHotInPlayRankViewModel.swift | 熱門滾球排名 VM |
基礎路徑:
BBSport/Tab/体育/Sport/EventDetail/
盤口 BetList(8 個)
| 檔案 | 說明 |
|---|---|
.../VM/BetList/DataSource/BetGroupDataSource.swift | 盤口資料源 Protocol |
.../VM/BetList/DataSource/General/EventBetGroupDataSource.swift | 一般賽事 |
.../VM/BetList/DataSource/RiskFree/RiskFreeBetGroupDataSource.swift | 包賠投注 |
.../VM/BetList/DataSource/RiskFree/RiskFreeBetUseCase.swift | 包賠邏輯 |
.../Views/Cell/OneColumnDetailCell.swift | 1 欄賠率 Cell |
.../Views/Cell/TwoColumnDetailCell.swift | 2 欄賠率 Cell |
.../Views/Cell/ThreeColumnDetailCell.swift | 3 欄賠率 Cell |
.../Views/Cell/EventDetailBaseCell.swift | 盤口基底 Cell |
基礎路徑:
BBSport/Tab/体育/Sport/EventDetail/
直播 / 影片 / 動畫(18 個)
| 檔案 | 說明 |
|---|---|
.../VideoAndStream/BaseVideoView.swift | 基底 View |
.../VideoAndStream/BaseVideoViewModel.swift | 基底 ViewModel |
.../VideoAndStream/Stream/EventDetailLiveView.swift | 直播 View |
.../VideoAndStream/Stream/More/MoreLiveView.swift | 更多主播(橫屏) |
.../VideoAndStream/Stream/More/HostInfoViewController.swift | 主播資訊 VC |
.../VideoAndStream/Video/EventDetailVideoView.swift | 影片 View |
.../VideoAndStream/Video/M/EventDetailVideoModel.swift | 影片 Model |
.../VideoAndStream/Video/DropdownList/EventDetailLiveDropDownView.swift | 影片線路選單 |
.../VideoAndStream/Animation/EventDetailAnimationView.swift | 動畫 View |
.../VideoAndStream/RealTimeData/EventDetailRealTimeDataView.swift | 即時數據覆蓋 |
.../VideoAndStream/RealTimeData/FullScreenEventInfoView.swift | 全螢幕賽事資訊 |
.../VideoAndStream/AirPlay/AirPlayAlertView.swift | AirPlay 提示 |
.../VideoAndStream/AirPlay/AirPlayFloatingView.swift | AirPlay 浮窗 |
.../VideoAndStream/Models/LiveInfoModel.swift | 直播資訊 Model |
.../VideoAndStream/Models/LiveInfoMessageModel.swift | 直播訊息 Model |
基礎路徑:
BBSport/Tab/体育/Sport/EventDetail/Views/
更多主播 MoreStreamer(13 個)
| 檔案 | 說明 |
|---|---|
.../MoreStreamer/M/EventDetailMoreLiveModel.swift | Model |
.../MoreStreamer/V/NewNormalMoreLiveView.swift | 豎屏主 View |
.../MoreStreamer/V/NewFullScreenMoreLiveView.swift | 全螢幕 View |
.../MoreStreamer/V/NewMoreLiveDataView.swift | Data View |
.../MoreStreamer/V/NewMoreLiveHeaderView.swift | Header View |
.../MoreStreamer/V/NewMoreLiveComponent.swift | Component |
.../MoreStreamer/V/NewMoreLiveCellPlugin.swift | Cell Plugin |
.../MoreStreamer/V/NewMoreLiveCurrentCell.swift | 當前主播 Cell |
.../MoreStreamer/V/NewMoreLiveCurrentSubCell.swift | 當前主播 SubCell |
.../MoreStreamer/V/NewMoreLiveMoreCell.swift | 更多主播 Cell |
.../MoreStreamer/V/NewMoreLiveButton.swift | 更多主播按鈕 |
.../MoreStreamer/V/EventDetailMoreLiveView.swift | 舊版 View |
.../MoreStreamer/V/MoreLivingLayerView.swift | 正在直播圖層 |
基礎路徑:
BBSport/Tab/体育/Sport/EventDetail/Views/
統計模組(30 個)
| 檔案 | 說明 |
|---|---|
.../Statistics/StatisticsSegmentedViewModel.swift | 分段 VM |
.../Statistics/StatisticsSegmentedView.swift | 分段 View |
.../Statistics/Protocol/StatisticsProvider.swift | Provider Protocol |
.../Statistics/Protocol/StatisticsViewModel.swift | ViewModel Protocol |
.../Statistics/Protocol/StatisticsView.swift | View Protocol |
.../Statistics/Protocol/IntelligenceUpdatable.swift | 情報可更新 |
.../Statistics/Protocol/TechnicViewModel.swift | 技術統計 VM |
.../Statistics/Shared/StatisticsSegmentedControl.swift | 共用分段控制 |
.../Statistics/Shared/Exponent/ExponentStatisticsProvider.swift | 指數 Provider |
.../Statistics/Shared/Exponent/ExponentViewModel.swift | 指數 VM |
.../Statistics/Shared/Exponent/ExponentView.swift | 指數 View |
.../Statistics/Shared/Intelligence/IntelligenceView.swift | 情報 View |
.../Statistics/Shared/Analyze/AnalyzeContentBaseView.swift | 分析基底 |
.../Statistics/Shared/Analyze/AnalyzeVSView.swift | 分析 VS |
.../Statistics/Shared/Analyze/AnalyzeHistoryView.swift | 分析歷史 |
.../Statistics/Shared/Analyze/AnalyzeEventCell.swift | 分析賽事 Cell |
.../Statistics/Football/FootballStatisticsProviders.swift | 足球 Providers |
.../Statistics/Football/TextStream/FootballTextStreamViewModel.swift | 足球文字直播 VM |
.../Statistics/Football/Squad/FootballSquadViewModel.swift | 足球陣容 VM |
.../Statistics/Football/Technic/FootballTechnicViewModel.swift | 足球技術統計 VM |
.../Statistics/Football/Analyze/FootballAnalyzeViewModel.swift | 足球分析 VM |
.../Statistics/Football/Intelligence/FootballIntelligenceViewModel.swift | 足球情報 VM |
.../Statistics/Basketball/BasketballStatisticsProviders.swift | 籃球 Providers |
.../Statistics/Basketball/TextStream/BasketballTextStreamViewModel.swift | 籃球文字直播 VM |
.../Statistics/Basketball/Technic/BasketballTechnicViewModel.swift | 籃球技術統計 VM |
.../Statistics/Basketball/Analyze/BasketballAnalyzeViewModel.swift | 籃球分析 VM |
.../Statistics/Basketball/Intelligence/BasketballIntelligenceViewModel.swift | 籃球情報 VM |
.../Statistics/OtherSport/OtherSportStatisticsProvider.swift | 其他球類 Provider |
.../Statistics/OtherSport/OtherSportStatisticsViewModel.swift | 其他球類 VM |
.../Statistics/OtherSport/OtherSportStatisticsView.swift | 其他球類 View |
基礎路徑:
BBSport/Tab/体育/Sport/EventDetail/Views/
Header / 計分板 / Tab(24 個)
| 檔案 | 說明 |
|---|---|
.../Header/EventDetailHeaderView.swift | Header 主視圖 |
.../Header/EventDetailHeaderViewModel.swift | Header VM |
.../Header/EventDetailHeaderCardView.swift | Header 卡片 |
.../Header/EventDetailHeaderMenuView.swift | Header 選單 |
.../Header/EventDetailHeaderScoreBlock.swift | 比分區塊 |
.../Header/EventDetailHeaderScoreView.swift | 比分 View |
.../Header/EventDetailTipsView.swift | 提示 View |
.../Header/BBChatBarrageView.swift | 彈幕 |
.../Header/LiveMenuButton.swift | 直播選單按鈕 |
.../Scoreboard/EventDetailBaseView.swift | 計分板基底 |
.../Scoreboard/EventDetailScoreboardFootball.swift | 足球計分板 |
.../Scoreboard/EventDetailScoreboardBasketball.swift | 籃球計分板 |
.../Scoreboard/EventDetailScoreboardTennisball.swift | 網球計分板 |
.../Scoreboard/EventDetailScoreboardVolleyball.swift | 排球計分板 |
.../Scoreboard/EventDetailScoreboardIcehockeyBall.swift | 冰球計分板 |
.../Scoreboard/EventDetailScoreboardTableTennis.swift | 乒乓球計分板 |
.../Scoreboard/EventDetailScoreboardBadminton.swift | 羽毛球計分板 |
.../Scoreboard/EventDetailScoreboardAmericanFootball.swift | 美式足球計分板 |
.../Scoreboard/EventDetailScoreboardBechVolleyBall.swift | 沙灘排球計分板 |
.../Tab/EventDetailTabView.swift | Tab 切換 |
.../Cell/EventDetailGroupView.swift | 盤口分組 |
.../EmptyView/MarketSearchEmptyView.swift | 盤口搜尋空狀態 |
.../League/BBLeagueView.swift | 聯賽 View |
.../League/ChargeBetTypeView.swift | 充電投注類型 |
基礎路徑:
BBSport/Tab/体育/Sport/EventDetail/Views/
聊天 / 禮物 / 互動(35 個)
| 檔案 | 說明 |
|---|---|
.../ChatView/Models/ChatMessageModel.swift | 聊天訊息 Model |
.../ChatView/Models/EmojiModel.swift | 表情 Model |
.../ChatView/Models/GiftModel.swift | 禮物 Model |
.../ChatView/Models/GiftRankTopModel.swift | 禮物排名 Model |
.../ChatView/Models/RedInfoModel.swift | 紅包資訊 Model |
.../ChatView/Header/EventDetailChatHeaderView.swift | 聊天 Header |
.../ChatView/Header/EventDetailChatLiveView.swift | 聊天直播 |
.../ChatView/Header/EventLiveHeaderView.swift | 直播 Header |
.../ChatView/Entrance/ChatEntranceView.swift | 聊天入口 |
.../ChatView/Keyboards/MenuTextField.swift | 選單輸入框 |
.../ChatView/Keyboards/Cell/CustomEmojiCell.swift | 自訂表情 Cell |
.../ChatView/Keyboards/Cell/EmojiListCellCollectionViewCell.swift | 表情列表 Cell |
.../ChatView/FeedBack/EventDetailChatFeedback.swift | 聊天回饋 |
.../ChatView/Reply/EventDetailChatViewReplyTipView.swift | 回覆提示 |
.../ChatView/Gift/Animation/GiftChannelView.swift | 禮物頻道動畫 |
.../ChatView/Gift/Animation/GiftContainerView.swift | 禮物容器 |
.../ChatView/Gift/Animation/GiftDigitLabel.swift | 禮物數字標籤 |
.../ChatView/Gift/Animation/GiftFullScreenView.swift | 禮物全螢幕 |
.../ChatView/OrderShare/EventDetailOrderShareView.swift | 注單分享 |
.../ChatView/OrderShare/EventDetailOrderShareTabView.swift | 注單分享 Tab |
.../ChatView/OrderShare/OrderShareHelper.swift | 分享 Helper |
.../ChatView/RedPacket/EventRedPacketView.swift | 紅包 View |
.../ChatView/StreamerPush/LivePushOrderView.swift | 主播推單 |
.../ChatView/Approval/ChatApprovalView.swift | 聊天審核 |
.../ChatView/ChatCustomService/EventDetailCustomServiceView.swift | 客服 |
.../ChatView/ChatEventView/ChatEventEntryView.swift | 活動入口 |
.../ChatView/ChatEventView/ChatEventListView.swift | 活動列表 |
.../ChatView/ChatEventView/EventDetailEventAdapter.swift | 活動 Adapter |
.../ChatView/TurnTable/TurnTableGameViewController.swift | 轉盤遊戲 VC |
.../ChatView/TurnTable/TurnTableGameViewModel.swift | 轉盤 VM |
.../ChatView/TurnTable/TurnTableView.swift | 轉盤 View |
.../ChatView/TurnTable/TurnTableGameView.swift | 轉盤遊戲 View |
.../ChatView/TurnTable/SmallTurnTableView.swift | 小轉盤 |
.../ChatView/ChatVote/Model/ChatVoteModel.swift | 競猜 Model |
.../ChatView/ChatVote/ViewModel/ChatVoteViewModel.swift | 競猜 VM |
基礎路徑:
BBSport/Tab/体育/Sport/EventDetail/Views/
方案 / 專家方案(8 個)
| 檔案 | 說明 |
|---|---|
.../EventDetailPlan/EventDetailPlanViewController.swift | 方案 VC |
.../EventDetailPlan/EventDetailPayPlanViewController.swift | 付費 VC |
.../EventDetailPlan/VM/EventDetailPlanViewModel.swift | 方案 VM |
.../EventDetailPlan/M/EventPlanModel.swift | 方案 Model |
.../EventDetailPlan/Cell/EventDetailPlanTableViewCell.swift | 方案 Cell |
.../ExpertPlan/ExpertPlanDetailView.swift | 專家方案詳情 |
.../ExpertPlan/ExpertPlanBetItemView.swift | 專家方案投注項 |
.../ExpertPlan/ExpertPlanItemContainerView.swift | 專家方案容器 |
基礎路徑:
BBSport/Tab/体育/Sport/EventDetail/Views/
Adapter / Helper(5 個)
| 檔案 | 說明 |
|---|---|
.../Adapter/DetailConstants.swift | 常數定義 |
.../Adapter/DetailHelper.swift | 工具 Helper |
.../Adapter/TimerBox.swift | Timer 工具 |
.../Adapter/UIViewController+Modal.swift | Modal 擴展 |
.../Service/PushMatchDetailService.swift | 推送賽事詳情 |
基礎路徑:
BBSport/Tab/体育/Sport/EventDetail/
API Request(22 個)
| 檔案 | 說明 |
|---|---|
BBSport/API/FBSportAPI/FBSportAPI+MatchDetailRequest.swift | FB 賽事詳情 |
BBSport/API/FBSportAPI/FBSportAPI+MerchantDetailRequest.swift | FB 主播詳情 |
BBSport/API/UPSportAPI/UPSportAPI+MatchDetailRequest.swift | UP 賽事詳情 |
BBSport/API/UPSportAPI/UPSportAPI+MerchantDetailRequest.swift | UP 主播詳情 |
BBSport/API/DBSportAPI/Sport/DBSportAPI+EventDetailRequest.swift | DB 賽事詳情 |
BBSport/API/DBSportAPI/Sport/DBSportAPI+DBEventInfoRequest.swift | DB 賽事資訊 |
BBSport/API/DBSportAPI/Sport/DBSportAPI+MatchOddsInfoRequest.swift | DB 盤口賠率 |
BBSport/API/DBSportAPI/Sport/DBSportAPI+CategoryListRequest.swift | DB 玩法分類 |
BBSport/API/DBSportAPI/Bet/DBSportAPI+LatestMarketInfoRequest.swift | DB 最新盤口 |
BBSport/API/LeisuSportAPI/LeisuSportAPI.swift | 雷速基底 |
BBSport/API/LeisuSportAPI/LeisuSportAPI+AnalyzeRequest.swift | 雷速分析 |
BBSport/API/LeisuSportAPI/Football/LeisuSportAPI+FootballIntelligenceRequest.swift | 足球情報 |
BBSport/API/LeisuSportAPI/Football/LeisuSportAPI+FootballLineupRequest.swift | 足球陣容 |
BBSport/API/LeisuSportAPI/Football/LeisuSportAPI+FootballMatchInfoRequest.swift | 足球賽事 |
BBSport/API/LeisuSportAPI/Football/LeisuSportAPI+FootballTextLiveRequest.swift | 足球文字直播 |
BBSport/API/LeisuSportAPI/Basketball/LeisuSportAPI+BasketballIntelligenceRequest.swift | 籃球情報 |
BBSport/API/LeisuSportAPI/Basketball/LeisuSportAPI+BasketballLineupRequest.swift | 籃球陣容 |
BBSport/API/LeisuSportAPI/Basketball/LeisuSportAPI+BasketballTeahnicRequest.swift | 籃球技術統計 |
BBSport/API/LeisuSportAPI/Basketball/LeisuSportAPI+BasketballTextLiveRequest.swift | 籃球文字直播 |
BBSport/API/STAPI/Sport/STAPI+InPlayMatchRank.swift | 滾球排名 |
BBSport/API/STAPI/Sport/STAPI+PlanBuyCountRequest.swift | 方案購買數 |
BBSport/API/STAPI/Sport/STAPI+PlanListRequest.swift | 方案列表 |
API
賽事詳情
FB/UP 賽事詳情
POST v1/match/getMatchDetail — JSON — 來源:FBSportAPI / UPSportAPI
TIP
FB 與 UP endpoint 相同,分屬不同 namespace。另有 MatchDetailJsonStringRequest 回傳 JSON String 格式。
Request:
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| matchId | string | ✅ | 賽事 ID |
| languageType | string | ✅ | 固定 "CMN" |
Response:(success=true 時 data,型別 STEventModel)
| 欄位 | 型別 | 說明 |
|---|---|---|
| id | Int | 賽事 ID |
| sid | Int | 球類 ID |
| lg | STLeagueModel | 聯賽資料 |
| ts | [STLeagueModel] | 球隊陣列(ts[0]=主隊、ts[1]=客隊) |
| mg | [STMarketGroupModel] | 盤口集合 |
| sg | [STEventResultModel] | 比分資訊 |
| mc | STTimeModel | 比賽時鐘 |
| bt | Double | 開賽時間 |
| ms | MatchStatus | 賽事狀態 |
| vs | VsParameterModel? | 動畫/直播串流資訊 |
| tms | Int | 盤口統計數量 |
| ...及其他 10+ 個欄位 |
FB/UP 主播詳情
POST v1/merchant/detail — JSON — 來源:FBSportAPI / UPSportAPI
無參數,靠 Header token/uid 認證。
Response:(success=true 時 data,型別 FBMerchantDetailModel)
| 欄位 | 型別 | 說明 |
|---|---|---|
| bo | Int? | 單關預約投注開關 |
| co | Int? | 單關提前結算開關 |
| boc | Int? | 單關預約提前結算開關 |
| pco | Int? | 串關提前結算開關 |
| pbc | Int? | 串關預約提前結算開關 |
DB 賽事詳情
GET yewu11/v1/w/matchDetail/getMatchDetailPB — JSON — 來源:DBSportAPI
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| mid | string | ✅ | 賽事 ID |
Response:(code="0000000" 時 data,型別 OBEventModel?)
| 欄位 | 型別 | 說明 |
|---|---|---|
| mid | String | 賽事 ID |
| tid | String | 聯賽 ID |
| tn | String | 聯賽名稱 |
| mhn | String | 主隊名稱 |
| man | String | 客隊名稱 |
| mgt | String | 開賽時間 |
| ms | Int? | 賽事狀態 |
| mc | Int | 玩法數量 |
| hps | [OBOddInfoModel] | 玩法集合 |
| msc | [String] | 比分 |
| ...及其他 30+ 個欄位 |
DB 玩法集(盤口分類列表)
GET yewu11/v1/w/category/getCategoryList — JSON — 來源:DBSportAPI
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| sportId | string | ✅ | 球類 ID |
| mid | string | ✅ | 賽事 ID |
Response:(code="0000000" 時 data,型別 [OBCategoryModel]?)
| 欄位 | 型別 | 說明 |
|---|---|---|
| id | String | 玩法集 ID |
| marketName | String | 玩法集名稱 |
| orderNo | Int | 排序值 |
| plays | [Int] | 玩法 ID 列表 |
DB 盤口賠率
GET yewu11/v1/m/matchDetail/getMatchOddsInfoPB — JSON — 來源:DBSportAPI
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| mid | string | ✅ | 賽事 ID |
| mcid | string | ✅ | 盤口分類 ID |
| cuid | string | ✅ | 使用者 ID |
Response: JSON String,由 DBSportParseJSONStringDecision 處理,解碼後型別為 [OBOddInfoModel]。
OBOddInfoModel 完整欄位
| 欄位 | 型別 | 說明 |
|---|---|---|
| hlid | String | 所屬玩法集 ID |
| hmm | Int | 是否多玩法 |
| hids | Int | 是否支持串關(1=支持、0=不支持) |
| hpid | String | 玩法 ID |
| hpn | String | 玩法名稱 |
| hpnb | String | 玩法名稱(備用) |
| hpon | Int | 玩法排序值 |
| hpt | Int | 玩法展示模板 ID |
| hps | String | 基準分(如 S1|1:1) |
| hmed | String | 截止時間 |
| hshow | String | 是否展示 |
| hsw | String | 支持賠率類型(1=六種、2=三種) |
| hton | String | 置頂排序值 |
| mid | String | 賽事 ID |
| title | [OBOddTitleModel] | 展示 Title 列表(osn=內容、otd=模板ID) |
| hl | [OBOddHLModel] | 盤口集合 |
| ol | [OBOddOLModel] | 投注項集合(冠軍專用) |
| hid | String | 冠軍盤口 ID |
OBOddHLModel(盤口):
| 欄位 | 型別 | 說明 |
|---|---|---|
| hid | String | 盤口 ID |
| hmt | Int | 盤口類型 |
| hon | String | 盤口級別 |
| hn | Int | 盤口坑位 |
| hv | String | 盤口值 |
| ol | [OBOddOLModel] | 投注項集合 |
| hs | Int | 是否開盤(-1=未知) |
| ad1 | String | 附加字段 1 |
| ad2 | String | 附加字段 2 |
OBOddOLModel(投注項):
| 欄位 | 型別 | 說明 |
|---|---|---|
| oid | String | 投注項 ID |
| on | String | 投注名稱展示值 |
| onb | String | 列表頁名稱展示值 |
| os | Int | 投注項狀態(1=開盤、2=封盤) |
| ot | String | 投注項類型 |
| otd | Int | 展示模板 ID(對應 title.otd) |
| ots | String | 投注給哪方(T1=主隊、T2=客隊) |
| otv | String | 投注時展示內容 |
| ov | Int64 | 賠率(需除以 100000 得實際值) |
DB 最新盤口資料
POST yewu13/v1/betOrder/client/queryLatestMarketInfo — JSON — 來源:DBSportAPI
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| (body dict) | [String: Any] | ✅ | 含 matchIdList、playOptionIdList 等 |
Response:(code="0000000" 時 data,型別 [DBQueryLatestMarketInfoModel]?)
| 欄位 | 型別 | 說明 |
|---|---|---|
| id | String | 盤口 ID |
| matchInfoId | String | 賽事 ID |
| marketValue | String | 盤口值 |
| status | Int | 盤口狀態(0=開盤、1=封盤、2=關盤、11=鎖盤) |
| playId | Int | 玩法 ID |
| playName | String | 玩法名稱 |
| marketOddsList | [DBQueryMarketOddsListItemModel] | 投注項集合 |
方案 / 餘額
方案(Plan):由專家或用戶發布的賽事預測推薦,包含投注建議和賠率分析。其他用戶可用金幣購買查看完整方案內容,方案可包含單場或多場賽事推薦。
購買方案計數
POST api/forehead/live/sports/message/v2/buy/count — urlForm — 來源:STAPI
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| messageId | int | ✅ | 方案訊息 ID |
Response:(code=1 時 data,型別 Decimal)
金幣商城餘額
POST api/forehead/activity/goldmall/balance — urlForm — 來源:STAPI
無參數,靠 Header token/uid 認證。
Response:(code=1 時 data,型別 GlodmallBalanceModel)
| 欄位 | 型別 | 說明 |
|---|---|---|
| coinBalance | Int | 用戶金幣餘額 |
熱門滾球排名
POST api/forehead/data/betting/inPlayMatchRank — urlForm — 來源:STAPI
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| isInPlay | string | ✅ | 固定 "true" |
| sportIds | string | ✅ | 預設 "1,3" |
| marketTypes | string | ✅ | 預設 "3002,3003,3004,1000,1005,1007" |
Response: 同體育賽事列表。
包賠投注配置
包賠投注(Risk-Free Bet):平台提供的一種活動型投注方式,使用者在符合活動條件的賽事中投注,若投注失敗可獲得部分或全額賠償(通常以優惠券或獎金返還),降低使用者首次投注的風險。
POST api/forehead/activity/compensation/info — urlForm — 來源:STAPI
無參數,靠 Header token/uid 認證。
Response:(code=1 時 data,型別 RiskFreeBetConfigurationRequest.Response)
| 欄位 | 型別 | 說明 |
|---|---|---|
| actId | Int | 活動 ID |
| actName | String | 活動名稱 |
| status | Int | 是否有包賠 |
| template | String | 活動模板 |
| gameRuleConfig | [GameRuleConfig] | 盤口設置 |
| amountSettingConfig | [AmountSettingConfig] | 條件設定 |
包賠投注確認
POST api/forehead/activity/act/get — urlForm — 來源:STAPI
| 參數 | 型別 | 必填 | 說明 |
|---|---|---|---|
| actId | int | ✅ | 活動 ID |
| template | string | ✅ | 活動模板 |
| json | string | ✅ | 投注詳情 JSON(含 betTime、betAmount、betOrderNo、matchDate、matchName、matchId) |
Response: 無 data(STEmptyResponse)。
三平台功能差異
| 功能 | FB | UP | DB |
|---|---|---|---|
| 賽事詳情 API | getMatchDetail(POST) | getMatchDetail(POST) | getMatchDetailPB(GET)+ getEventInfo |
| Response Model | STEventModel | STEventModel | OBEventModel |
| 盤口更新方式 | Socket 推送 | Socket 推送 | LatestMarketInfoRequest 輪詢 |
| 投注方式 | 直接彈出面板 | 直接彈出面板 | 串關購物車模式 |
| 包賠投注 | 有 | 有 | 有 |
| 主播詳情 API | merchant/detail | merchant/detail | 無(透過 getEventInfo) |
| 串關購物車 | 無 | 無 | 有 |
統計數據各球類 Provider 組合
各 Provider 實作 StatisticsProvider 協議(定義於 StatisticsProvider.swift),提供 title、buildView() 和 requestForDetailStatisticsIfNeeded(by:) 方法。
| Provider | 功能說明 |
|---|---|
| TextStream | 文字直播,即時顯示賽事進行中的事件描述(進球、犯規、換人等),資料來源為雷速 API |
| Squad | 陣容,展示雙方先發/替補球員名單與位置圖(僅足球有) |
| Exponent | 指數,展示賠率走勢與盤口變化圖表,追蹤各平台賠率波動 |
| Analyze | 分析,提供雙方歷史交鋒記錄、近期戰績與勝負統計,含 VS 對比與歷史數據 |
| Intelligence | 情報,展示賽前情報摘要,如傷停、天氣、戰意等影響比賽的因素 |
| 球類 | Providers |
|---|---|
| 足球 | TextStream、Squad、Exponent、Analyze、Intelligence |
| 籃球/電競籃球 | TextStream、Exponent、Analyze、Intelligence |
| 其他球類 | OtherSportStatisticsProvider(僅比分版) |
實作重點
- 多平台盤口處理:
BetListViewModel整合三平台;EventBetGroupDataSource(一般)、RiskFreeBetGroupDataSource(包賠) - 直播/影片/動畫:三者皆繼承
BaseVideoView,共用BaseVideoViewModel - 主播切換:切換時重置活動(紅包/轉盤/抽獎)、彈幕、禁言狀態
- 統計數據分離:各球類獨立 Provider 和 ViewModel,共用
StatisticsSegmentedViewModel
關鍵數字
- 滾球輪詢間隔:5 秒
- 非滾球輪詢間隔:20 秒
- DB 並行請求佇列:
com.ob.detail.group