更新时间:2024-06-28 GMT+08:00
场景5: 编辑会议
描述
在华为云会议账号登录后,调用会议详情接口获取会议详情后调用接口编辑会议。
业务流程
使用SDK发起会议时,先调用editConf接口,然后处理回调hwmCallback。
- 接口调用
调用editConf编辑会议。
- 处理回调
处理回调hwmCallback。
示例代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
// 编辑会议参数组装 //会议主题 String subject = getSubject(); //会议开始时间、时区、会议时长 String startTimeLocal = startTimeText.getText().toString(); String startTime = BaseDateUtil.transTimeZone(startTimeLocal, TimeZone.getTimeZone("GMT+08:00"), TimeZone.getTimeZone("GMT+00:00"), BaseDateUtil.FMT_YMDHMS); long startTimeStamp = BaseDateUtil.dateToTimeStamp(startTime, BaseDateUtil.FMT_YMDHMS); String timeZomeStr = timezomeText.getText().toString(); String timedurStr = timeDuartionText.getText().toString(); int timeZone = Integer.parseInt(timeZomeStr); int timeDuration = Integer.parseInt(timedurStr); //会议类型 MeetingType confType = audioBtn.isChecked() ? MeetingType.CONF_AUDIO : MeetingType.CONF_VIDEO; String joinConfTypeStr = joinConfPerText.getText().toString(); //入会范围限制 int joinConfPermission = Integer.parseInt(joinConfTypeStr); JoinConfPermissionType permissionType = JoinConfPermissionType.valueOf(joinConfPermission); //是否录制 boolean needRecord = recordSwitch.isChecked(); //是否需要邮件通知 boolean needEmail = sendEmailSwitch.isChecked(); //是否需要短信通知 boolean needSms = sendSmsSwitch.isChecked(); //是否需要发邮件日历 boolean needEmailCalendar = sendEmailCalendarSwitch.isChecked(); //与会者列表 List<AttendeeModel> attendeeInfos = this.confDetailModel.getAttendeeModels(); Switch needWithMemberSwitch = findViewById(R.id.edit_switch_with_attend); boolean needWithMember = needWithMemberSwitch.isChecked(); if (needWithMember) { //以下三种方式可选 String name = getName(); String number = getNumber(); String thirdAccount = getThirdAccount(); if (!TextUtils.isEmpty(thirdAccount)) { if (LoginStatusCache.getsLoginAccountInfo() instanceof AppIdAuthParam) { //如果是appid的方式登录 attendeeList.add(AttendeeModel.buildAttendeeByThirdAccountId(thirdAccount,name)); } } else if (number.startsWith("+99")){ //sip 号码入会 attendeeList.add(AttendeeModel.buildAttendeeBySipNumber(number, name)); } else { //电话号码入会(手机和座机) attendeeList.add(AttendeeModel.buildAttendeeByPhone(number, name)); } } EditConfParam editConfParam = new EditConfParam() .setConfId(this.confDetailModel.getConfId()) .setVmrIdFlag(1 == this.confDetailModel.getVmrFlag()) .setVmrId(this.confDetailModel.getVmrId()) .setConfSubject(subject) .setStartTime(startTimeStamp) .setTimeZone(timeZone) .setDuration(timeDuration) .setConfType(confType) .setNeedConfPwd(!this.confDetailModel.getIsGuestFreePwd()) .setJoinConfRestrictionType(permissionType) .setRecordOn(needRecord) .setMailOn(needEmail) .setSmsOn(needSms) .setEmailCalenderOn(needEmailCalendar) .setAttendees(attendeeInfos); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
// 编辑会议接口调用 HWMBizSdk.getBizOpenApi().editConf(editConfParam, new HwmCallback<Integer>() { @Override public void onSuccess(Integer integer) { dismissLoading(); DemoUtil.showToast("编辑会议成功:" + integer); } @Override public void onFailed(int retCode, String desc) { dismissLoading(); String err = ErrorMessageFactory.create(Utils.getApp(), retCode); if (TextUtils.isEmpty(err)) { err = Utils.getApp().getString(R.string.hwmconf_edit_failed); } DemoUtil.showToast("编辑会议失败:" + retCode + ",desc: " + err); } }); |
父主题: 典型场景