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.
91 lines
3.0 KiB
91 lines
3.0 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/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 频道详情
|
|
@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,
|
|
);
|
|
}
|