#服務投注限額 REST API 參考
本文檔描述了用於管理投注限額邏輯的微服務。
版本:0.0.0 基礎URL:{{API_BASE_URL}}/api/bet-limit 方案:HTTPS
#端點
#1. 自動分配玩家限制
總結:當使用者進入遊戲並且沒有分配任何玩家限制時,自動為使用者分配玩家限制。
需要設定:商戶必須聯絡PetaX設定用於自動指派的玩家限制ID清單。
API 可用性:沒有公開 API 可用於設定自動分配玩家限制。
觸發:使用者進入遊戲。
條件:使用者的玩家限制清單為空。
行為:
- 如果使用者已經分配了一個或多個玩家限制,系統將不會自動分配任何額外的限制。
- 如果使用者的玩家限制清單為空,系統將為商戶分配PetaX配置的玩家限制ID。
- 配置的玩家限制ID必須存在於PetaX中才能用於自動分配。
- 此功能僅適用於配置啟用後進入遊戲的使用者。
設定流程:
- 商戶向PetaX提供玩家限制ID清單以啟用自動分配。 -PetaX為商戶設定自動分配玩家限制。
- 啟用配置後,當符合條件的使用者進入遊戲時,將套用自動分配。
#2. 為使用者指派玩家限制
端點:POST /a/player-limits/assign
摘要:為使用者指派玩家限制。
權限:betLimit.playerLimits.assignUser
消耗:application/json
產生:application/json
安全:BearerAuth(授權:承載abcde12345)
註釋:
- 透過使用者 ID 或指定的使用者名稱將多個玩家限制分配給多個使用者。
- 錯誤代碼 24004:為使用者指派玩家限制,但未找到限制。
- 錯誤代碼 24005:清單玩家限制已將項目指派給使用者。
#請求
CURL:
curl -X POST "{{API_BASE_URL}}/api/bet-limit/a/player-limits/assign" \
-H "Authorization: Bearer abcde12345" \
-H "Content-Type: application/json" \
-d '{
"limitIds": [1, 2],
"userIds": ["user-uuid-123", "user-uuid-124"],
"username": "testuser"
}'
參數:
- 內文:資料(必填)
類型:對象
Schema:
範例:{ limitIds: number[]; // Required, minItems: 1, maxItems: 50 userIds?: string[]; // Optional, minItems: 1, maxItems: 50 username?: string; // Required if userIds is empty }{ "limitIds": [1, 2], "userIds": ["user-uuid-123", "user-uuid-124"], "username": "testuser" }
#回應
200 好 描述:空 類型:字串 範例:
""有關錯誤狀態(4xx、5xx),請參閱 API-錯誤處理
#3. 取消為使用者指派玩家限制
端點:POST /a/player-limits/unassign
摘要:取消指派給使用者的玩家限制。
權限:betLimit.playerLimits.assignUser
消耗:application/json
產生:application/json
安全:BearerAuth(授權:承載abcde12345)
注意:如果您要刪除使用者的所有限制,請將 limitIds 設為空。
#請求
CURL:
curl -X POST "{{API_BASE_URL}}/api/bet-limit/a/player-limits/unassign" \
-H "Authorization: Bearer abcde12345" \
-H "Content-Type: application/json" \
-d '{
"limitIds": [1, 2],
"userIds": ["user-uuid-123", "user-uuid-124"],
"username": "testuser"
}'
參數:
- 內文:資料(必填)
類型:對象
Schema:
範例:{ limitIds?: number[]; // Optional, minItems: 1, maxItems: 50 userIds?: string[]; // Optional, minItems: 1, maxItems: 50 username?: string; // Required if userIds is empty }{ "limitIds": [1, 2], "userIds": ["user-uuid-123", "user-uuid-124"], "username": "testuser" }
#回應
- 200 好
描述:空
類型:字串
範例:
"" - 有關錯誤狀態(4xx、5xx),請參閱 API-錯誤處理