fix: improve baishun catalog sync and room filtering
This commit is contained in:
parent
d00216ebbc
commit
0364a608f5
@ -28,6 +28,7 @@ const (
|
|||||||
baishunVendorType = "BAISHUN"
|
baishunVendorType = "BAISHUN"
|
||||||
baishunLaunchModeRemote = "H5_REMOTE"
|
baishunLaunchModeRemote = "H5_REMOTE"
|
||||||
baishunLaunchModeLocalZip = "H5_ZIP_LOCAL"
|
baishunLaunchModeLocalZip = "H5_ZIP_LOCAL"
|
||||||
|
baishunGameListTypeGame = 2
|
||||||
baishunCatalogEnabled = "ENABLED"
|
baishunCatalogEnabled = "ENABLED"
|
||||||
baishunRoomStateIdle = "IDLE"
|
baishunRoomStateIdle = "IDLE"
|
||||||
baishunRoomStatePlaying = "PLAYING"
|
baishunRoomStatePlaying = "PLAYING"
|
||||||
@ -886,7 +887,7 @@ func (s *BaishunService) listRoomGames(ctx context.Context, sysOrigin, roomID, c
|
|||||||
Joins("JOIN sys_game_list_vendor_ext ext ON ext.game_list_config_id = cfg.id AND ext.enabled = 1").
|
Joins("JOIN sys_game_list_vendor_ext ext ON ext.game_list_config_id = cfg.id AND ext.enabled = 1").
|
||||||
Joins("LEFT JOIN baishun_game_catalog cat ON cat.sys_origin = cfg.sys_origin AND CAST(cat.vendor_game_id AS CHAR) = ext.vendor_game_id").
|
Joins("LEFT JOIN baishun_game_catalog cat ON cat.sys_origin = cfg.sys_origin AND CAST(cat.vendor_game_id AS CHAR) = ext.vendor_game_id").
|
||||||
Where("cfg.sys_origin = ? AND cfg.is_showcase = 1 AND ext.vendor_type = ?", sysOrigin, baishunVendorType)
|
Where("cfg.sys_origin = ? AND cfg.is_showcase = 1 AND ext.vendor_type = ?", sysOrigin, baishunVendorType)
|
||||||
if strings.TrimSpace(category) != "" {
|
if strings.TrimSpace(category) != "" && !strings.EqualFold(strings.TrimSpace(category), "CHAT_ROOM") {
|
||||||
query = query.Where("cfg.category = ?", category)
|
query = query.Where("cfg.category = ?", category)
|
||||||
}
|
}
|
||||||
if strings.TrimSpace(roomID) != "" {
|
if strings.TrimSpace(roomID) != "" {
|
||||||
@ -1013,6 +1014,7 @@ func (s *BaishunService) fetchPlatformGames(ctx context.Context) ([]baishunPlatf
|
|||||||
timestamp := time.Now().Unix()
|
timestamp := time.Now().Unix()
|
||||||
nonce := s.randomNonce()
|
nonce := s.randomNonce()
|
||||||
payload := map[string]any{
|
payload := map[string]any{
|
||||||
|
"game_list_type": baishunGameListTypeGame,
|
||||||
"app_channel": s.cfg.BaishunAppChannel,
|
"app_channel": s.cfg.BaishunAppChannel,
|
||||||
"app_id": s.cfg.BaishunAppID,
|
"app_id": s.cfg.BaishunAppID,
|
||||||
"signature": s.signBAISHUN(timestamp, nonce),
|
"signature": s.signBAISHUN(timestamp, nonce),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user