|
@@ -10,6 +10,7 @@ import com.cooleshow.base.data.net.RetrofitFactory;
|
|
|
import com.cooleshow.base.rx.BaseObserver;
|
|
|
import com.cooleshow.base.utils.DateUtil;
|
|
|
import com.cooleshow.base.utils.FileUtils;
|
|
|
+import com.cooleshow.base.utils.RequestBodyUtil;
|
|
|
import com.cooleshow.base.utils.SystemUtils;
|
|
|
import com.daya.live_teaching.api.LiveTeachingApi;
|
|
|
import com.daya.live_teaching.api.WhiteBoardApi;
|
|
@@ -52,6 +53,8 @@ import com.daya.live_teaching.model.WhiteCreateBean;
|
|
|
import com.daya.live_teaching.rtc.RtcManager;
|
|
|
import com.daya.live_teaching.utils.log.SLog;
|
|
|
|
|
|
+import org.json.JSONObject;
|
|
|
+
|
|
|
import java.io.File;
|
|
|
import java.lang.annotation.Retention;
|
|
|
import java.util.ArrayList;
|
|
@@ -168,15 +171,13 @@ public class ClassRepository extends BaseRepository {
|
|
|
|
|
|
public void sendImPlayMidiMessage(String userId, String roomId, boolean enable, int rate, int customType, int playVolume, ResultCallback<Boolean> callBack) {
|
|
|
HashMap<String, Object> bodyMap = new HashMap<>();
|
|
|
- HashMap<String, Object> contentMap = new HashMap<>();
|
|
|
- contentMap.put(PARAM_USER_ID, userId);
|
|
|
- contentMap.put("enable", enable);
|
|
|
- contentMap.put("rate", rate);
|
|
|
- contentMap.put("customType", customType);
|
|
|
- contentMap.put("playVolume", playVolume);
|
|
|
+ bodyMap.put(PARAM_USER_ID, userId);
|
|
|
+ bodyMap.put("enable", enable);
|
|
|
+ bodyMap.put("rate", rate);
|
|
|
+ bodyMap.put("customType", customType);
|
|
|
+ bodyMap.put("playVolume", playVolume);
|
|
|
bodyMap.put(PARAM_ROOM_ID, roomId);
|
|
|
bodyMap.put(PARAM_USER_ID, userId);
|
|
|
- bodyMap.put("content", contentMap);
|
|
|
sealClassService.sendImPlayMidiMessage(RetrofitUtil.createJsonRequest(bodyMap)).enqueue(new CallBackWrapper<Boolean>(callBack));
|
|
|
|
|
|
}
|
|
@@ -415,7 +416,15 @@ public class ClassRepository extends BaseRepository {
|
|
|
* @param callBack
|
|
|
*/
|
|
|
public void createWhiteBoard(String roomId, ResultCallback<WhiteCreateBean> callBack) {
|
|
|
- whiteBoardService.hereWhiteCreat("Page1", 0, roomId)
|
|
|
+ JSONObject jsonObject =new JSONObject();
|
|
|
+ try{
|
|
|
+ jsonObject.put("name","Page1");
|
|
|
+ jsonObject.put("userNum",0);
|
|
|
+ jsonObject.put("courseScheduleId",roomId);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ whiteBoardService.hereWhiteCreat(RequestBodyUtil.convertToRequestBodyJson(jsonObject.toString()))
|
|
|
.subscribeOn(Schedulers.newThread())
|
|
|
.observeOn(AndroidSchedulers.mainThread())
|
|
|
.subscribeWith(new BaseObserver<WhiteCreateBean>() {
|
|
@@ -423,6 +432,11 @@ public class ClassRepository extends BaseRepository {
|
|
|
protected void onSuccess(WhiteCreateBean data) {
|
|
|
callBack.onSuccess(data);
|
|
|
}
|
|
|
+ @Override
|
|
|
+ public void onError(Throwable e) {
|
|
|
+ super.onError(e);
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
|