保利威文档中心

幫助中心

userBillService

更新時間:2025-09-11 15:18:09

1、查詢用戶帳單使用詳情資料

描述

查询用户账单使用详情数据
接口地址(仅做说明使用):https://api.polyv.net/live//v4/channel/use-detail/list

呼叫限制

1、介面呼叫有頻率限制,詳細請查看,呼叫常見異常,詳細請查看

單元測試

    @Test
    public void testGetBillUseDetailData() throws IOException, NoSuchAlgorithmException {
        LiveGetBillUseDetailRequest liveGetBillUseDetailRequest = new LiveGetBillUseDetailRequest();
        LiveGetBillUseDetailResponse liveGetBillUseDetailResponse;
        try {
            liveGetBillUseDetailRequest.setItemCategory("duration")
                    .setStartDate(super.getDate(2025, 2, 1))
                    .setEndDate(super.getDate(2025, 2, 31));
            liveGetBillUseDetailResponse = new LiveUserBillServiceImpl().getBillUseDetail(liveGetBillUseDetailRequest);
            Assert.assertNotNull(liveGetBillUseDetailResponse);
            if (liveGetBillUseDetailResponse != null) {
                log.debug("测试查询用户账单使用详情数据成功 {}", JSON.toJSONString(liveGetBillUseDetailResponse));
            }
        } catch (PloyvSdkException e) {
            //参数校验不合格 或者 请求服务器端500错误,错误信息见PloyvSdkException.getMessage()
            log.error(e.getMessage(), e);
            // 异常返回做B端异常的业务逻辑,记录log 或者 上报到ETL 或者回滚事务
            throw e;
        } catch (Exception e) {
            log.error("SDK调用异常", e);
            throw e;
        }
    }
}

單元測試說明

1、請求正確,回傳LiveGetBillUseDetailResponse物件,B端依據此物件處理業務邏輯;

2、請求參數驗證不合格,拋出PloyvSdkException,錯誤訊息見PloyvSdkException.getMessage(),如 [ 輸入參數 [xxx.chat.LivexxxRequest]物件驗證失敗,失敗欄位 [pic不能為空 / msg不能為空] ]

3、伺服器處理異常,拋出PloyvSdkException,錯誤訊息見PloyvSdkException.getMessage(),如 [ 保利威請求回傳資料錯誤,請求流水號:66e7ad29fd04425a84c2b2b562d2025b,錯誤原因:invalid signature. ]

請求入參描述

參數名 必選 類型 說明
itemCategory true String 計費項目,必填;
duration:直播分鐘數;
concurrence:直播並發;
mic_duration:連麥分鐘數;
ppt_anim:PPT動效轉碼;
guide_duration:導播台;
ppt_composite:重製課件;
distribute:雲端分發;
aiPPTVideoEnabled:智慧製課(不含數位人);
aiPPTVideoWithDigital:智慧製課(含數位人);
aiAssistantEnabled:AI助手答疑;
aiSmartClipEnabled:智慧裁剪
startDate true Date 開始日期,必填,格式:yyyy-MM-dd,不允許跨月查詢
endDate true Date 結束日期,必填,格式:yyyy-MM-dd,不允許跨月查詢
channelId false String 頻道號
currentPage false Integer 頁數,預設為1【對應api文件的pageNumber欄位】
pageSize false Integer 每頁顯示的資料筆數,預設每頁顯示20筆資料
appId false String POLYV用戶APP_ID,多帳號呼叫時該參數必填(即呼叫了initMultiAccount()設定多帳號呼叫),透過註冊保利威官網取得,路徑:官網->登入->直播(開發設定)
appSecret false String POLYV用戶APP_SECRET,多帳號呼叫時該參數必填(即呼叫了initMultiAccount()設定多帳號呼叫),透過註冊保利威官網取得,路徑:官網->登入->直播(開發設定)

回傳物件描述

參數名 類型 說明
contents Array 帳單使用詳情【詳見BillUseDetail參數描述
pageSize Integer 每頁顯示的資料筆數,預設每頁顯示20筆資料
currentPage Integer 目前頁【對應api文件的pageNumber欄位】
totalItems Integer 記錄總筆數
totalPage Integer 總頁數【對應api文件的totalPages欄位】
BillUseDetail參數描述
參數名 類型 說明
channelId String 頻道號
consumed Integer 用量
consumeUnit String 用量單位
endTime Date 結束時間
itemCategory String 計費項目,
duration:直播分鐘數;
concurrence:直播並發;
mic_duration:連麥分鐘數;
ppt_anim:PPT動效轉碼;
guide_duration:導播台;
ppt_composite:重製課件;
distribute:雲端分發
itemName String 項目明細,如:國內觀看時長、1v1~6 連麥等
production String 產品,如:live
recordId String 記錄id
remark String 備註
startTime Date 開始時間
statDate String 出帳日期

联系客服,在线咨询