You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
140 lines
4.7 KiB
140 lines
4.7 KiB
import 'package:dating_touchme_app/model/discover/rtc_channel_model.dart';
|
|
import 'package:dating_touchme_app/model/live/gift_product_model.dart';
|
|
import 'package:dating_touchme_app/model/rtc/chat_audio_product_model.dart';
|
|
import 'package:dating_touchme_app/model/rtc/consume_rtc_channel_response.dart';
|
|
import 'package:dating_touchme_app/model/rtc/link_mic_card_model.dart';
|
|
import 'package:dating_touchme_app/model/rtc/rtc_channel_data.dart';
|
|
import 'package:dating_touchme_app/model/rtc/rtc_channel_detail.dart';
|
|
import 'package:dating_touchme_app/network/api_urls.dart';
|
|
import 'package:dating_touchme_app/network/response_model.dart';
|
|
import 'package:dio/dio.dart';
|
|
import 'package:retrofit/retrofit.dart';
|
|
|
|
part 'rtc_api.g.dart';
|
|
|
|
/// RTC 相关接口
|
|
@RestApi(baseUrl: '')
|
|
abstract class RtcApi {
|
|
factory RtcApi(Dio dio) = _RtcApi;
|
|
|
|
/// 创建实时音视频频道
|
|
@GET(ApiUrls.getSwRtcToken)
|
|
Future<HttpResponse<BaseResponse<RtcChannelData>>> getSwRtcToken(
|
|
@Query('channelId') String channelId,
|
|
);
|
|
|
|
/// 获取声网 RTM Token
|
|
@GET(ApiUrls.getSwRtmToken)
|
|
Future<HttpResponse<BaseResponse<RtcChannelData>>> getSwRtmToken();
|
|
|
|
/// 创建实时音视频频道(返回字符串)
|
|
@POST(ApiUrls.createRtcChannel)
|
|
Future<HttpResponse<BaseResponse<RtcChannelData>>> createRtcChannel();
|
|
|
|
/// 创建一对一RTC频道(type: 1为音频,2为视频)
|
|
@POST(ApiUrls.createOneOnOneRtcChannel)
|
|
Future<HttpResponse<BaseResponse<RtcChannelData>>> createOneOnOneRtcChannel(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
|
|
/// 获取 RTC 频道详情
|
|
@GET(ApiUrls.getRtcChannelDetail)
|
|
Future<HttpResponse<BaseResponse<RtcChannelDetail>>> getRtcChannelDetail(
|
|
@Query('channelId') String channelId,
|
|
);
|
|
|
|
/// 连接 RTC 频道
|
|
@POST(ApiUrls.connectRtcChannel)
|
|
Future<HttpResponse<BaseResponse<dynamic>>> connectRtcChannel(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
|
|
/// 获取 RTC 频道用户详情
|
|
@GET(ApiUrls.getDatingRtcChannelUserDetail)
|
|
Future<HttpResponse<BaseResponse<RtcSeatUserInfo>>> getDatingRtcChannelUserDetail(
|
|
@Query('channelId') String channelId,
|
|
@Query('uId') int uId,
|
|
);
|
|
|
|
/// 启用/禁用 RTC 频道用户音频
|
|
@POST(ApiUrls.enableRtcChannelUserAudio)
|
|
Future<HttpResponse<BaseResponse<dynamic>>> enableRtcChannelUserAudio(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
|
|
/// 断开 RTC 频道连接
|
|
@POST(ApiUrls.disconnectRtcChannel)
|
|
Future<HttpResponse<BaseResponse<dynamic>>> disconnectRtcChannel(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
|
|
/// 销毁 RTC 频道
|
|
@POST(ApiUrls.destroyRtcChannel)
|
|
Future<HttpResponse<BaseResponse<dynamic>>> destroyRtcChannel();
|
|
|
|
/// 获取 RTC 频道分页列表
|
|
@GET(ApiUrls.getRtcChannelPage)
|
|
Future<HttpResponse<BaseResponse<PaginatedResponse<RtcChannelModel>>>> getRtcChannelPage();
|
|
|
|
/// 获取礼物产品列表
|
|
@GET(ApiUrls.listGiftProduct)
|
|
Future<HttpResponse<BaseResponse<List<GiftProductModel>>>> listGiftProduct();
|
|
|
|
/// 频道礼物/添加好友消费
|
|
@POST(ApiUrls.costChannelGift)
|
|
Future<HttpResponse<BaseResponse<dynamic>>> costChannelGift(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
|
|
/// IM 聊天送礼
|
|
@POST(ApiUrls.costImGift)
|
|
Future<HttpResponse<BaseResponse<dynamic>>> costImGift(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
|
|
/// 踢出 RTC 频道用户
|
|
@POST(ApiUrls.kickingRtcChannelUser)
|
|
Future<HttpResponse<BaseResponse<dynamic>>> kickingRtcChannelUser(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
|
|
/// 获取用户道具连麦卡片
|
|
@GET(ApiUrls.getUserPropLinkMicCard)
|
|
Future<HttpResponse<BaseResponse<LinkMicCardModel>>> getUserPropLinkMicCard();
|
|
|
|
/// 拒绝一对一RTC频道
|
|
@POST(ApiUrls.refuseOneOnOneRtcChannel)
|
|
Future<HttpResponse<BaseResponse<dynamic>>> refuseOneOnOneRtcChannel(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
|
|
/// 取消一对一RTC频道
|
|
@POST(ApiUrls.cancelOneOnOneRtcChannel)
|
|
Future<HttpResponse<BaseResponse<dynamic>>> cancelOneOnOneRtcChannel(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
|
|
/// 连接一对一RTC频道
|
|
@POST(ApiUrls.connectOneOnOneRtcChannel)
|
|
Future<HttpResponse<BaseResponse<dynamic>>> connectOneOnOneRtcChannel(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
|
|
/// 终止一对一RTC频道
|
|
@POST(ApiUrls.terminateOneOnOneRtcChannel)
|
|
Future<HttpResponse<BaseResponse<dynamic>>> terminateOneOnOneRtcChannel(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
|
|
/// 获取聊天音频产品列表
|
|
@GET(ApiUrls.listChatAudioProduct)
|
|
Future<HttpResponse<BaseResponse<List<ChatAudioProductModel>>>> listChatAudioProduct(
|
|
@Query('toUserId') String toUserId,
|
|
);
|
|
|
|
/// 消费一对一RTC频道
|
|
@POST(ApiUrls.consumeOneOnOneRtcChannel)
|
|
Future<HttpResponse<BaseResponse<ConsumeRtcChannelResponse>>> consumeOneOnOneRtcChannel(
|
|
@Body() Map<String, dynamic> data,
|
|
);
|
|
}
|