资源切换接口
<h2>1. 概述</h2>
<p>资源切换接口是客户关联了多个不同的资源库时进行资源库切换功能的。该部分的接口入口类为 <strong>basesdk</strong> 中的 <strong>VTBaseSDKManagerExt</strong> 。</p>
<h3>1. 获取当前书本的资源库列表</h3>
<p><strong>接口名称:</strong></p>
<pre><code class="language-java"> public void getListBookRepoPriority(int bookId, ListBookRepoPriorityCallback callback) </code></pre>
<p><strong>参数:</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>bookId</td>
<td>String</td>
<td>bookId</td>
</tr>
<tr>
<td>callback</td>
<td>ListBookRepoPriorityCallback</td>
<td>获取资源库列表回调</td>
</tr>
</tbody>
</table>
<p><strong>备注:</strong></p>
<p>bookId必须是关联的资源库信息,不然该接口会返回失败。</p>
<h3>1.1. ListBookRepoPriorityCallback资源库列表回调</h3>
<p>该回调用于监听获取该书本的资源库列表信息,接口类如下:</p>
<pre><code class="language-java">/**
* 初始化失败
*
* @param errCode 错误码
* @param msg
*/
void onGetListBookResourceFailure(int code, String msg);
/**
* 获取资源库列表信息
* @param data 资源库列表信息
*/
void onGetListBookResourceSuccess(List<BookResourceLibraryInfoEntity> data);</code></pre>
<h3>1.2. BookResourceLibraryInfoEntity资源库信息类</h3>
<table>
<thead>
<tr>
<th>属性</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>int</td>
<td>书本资源的资源库id</td>
</tr>
<tr>
<td>name</td>
<td>String</td>
<td>资源库名称</td>
</tr>
<tr>
<td>bookId</td>
<td>String</td>
<td>书本的资源的资源ID</td>
</tr>
<tr>
<td>language</td>
<td>int</td>
<td>语言 (0表示未知,1表示中文,2表示英文)</td>
</tr>
<tr>
<td>soundRay</td>
<td>int</td>
<td>声线(0表示未知,1表示人声,2表示TTS)</td>
</tr>
</tbody>
</table>
<h3>2. 更新当前资源库信息</h3>
<p><strong>接口名称:</strong></p>
<pre><code class="language-java"> public void updateBookRepo(int bookId, int repoId, BookResourceLibraryUpdateCallback callback) </code></pre>
<p><strong>参数:</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>bookId</td>
<td>String</td>
<td>书本资源的资源ID</td>
</tr>
<tr>
<td>repoId</td>
<td>int</td>
<td>书本资源的资源库ID</td>
</tr>
<tr>
<td>callback</td>
<td>BookResourceLibraryUpdateCallback</td>
<td>更新资源库信息列表回调</td>
</tr>
</tbody>
</table>
<p><strong>备注:</strong></p>
<p>repoId是资源库信息列表中BookResourceLibraryInfoEntity中的id。更新成功后,重新识别时,系统会返回这个资源库的信息。</p>
<h3>1.1. BookResourceLibraryUpdateCallback更新当前资源库信息回调</h3>
<p>该回调用于更新资源库信息,接口类如下:</p>
<pre><code class="language-java">/**
* 初始化失败
*
* @param errCode 错误码
* @param msg
*/
void updateBookResourceLibraryFailure(int code, String msg);
/**
* 更新资源库信息成功
*/
void updateBookResourceLibrarySuccess();</code></pre>