This commit is contained in:
My-Responsitories
2025-12-13 14:45:19 +08:00
parent 17883eb77e
commit 2b4b1debe6
2 changed files with 20 additions and 16 deletions

View File

@@ -72,8 +72,8 @@ abstract final class LiveHttp {
} }
static Future<LoadingState<RoomPlayInfoData>> liveRoomInfo({ static Future<LoadingState<RoomPlayInfoData>> liveRoomInfo({
roomId, required Object roomId,
qn, Object? qn,
bool onlyAudio = false, bool onlyAudio = false,
}) async { }) async {
var res = await Request().get( var res = await Request().get(
@@ -83,7 +83,7 @@ abstract final class LiveHttp {
'protocol': '0,1', 'protocol': '0,1',
'format': '0,1,2', 'format': '0,1,2',
'codec': '0,1,2', 'codec': '0,1,2',
'qn': qn, 'qn': ?qn,
'platform': 'web', 'platform': 'web',
'ptype': 8, 'ptype': 8,
'dolby': 5, 'dolby': 5,
@@ -99,7 +99,9 @@ abstract final class LiveHttp {
} }
} }
static Future liveRoomInfoH5({roomId, qn}) async { static Future<LoadingState<RoomInfoH5Data>> liveRoomInfoH5({
required Object roomId,
}) async {
var res = await Request().get( var res = await Request().get(
Api.liveRoomInfoH5, Api.liveRoomInfoH5,
queryParameters: { queryParameters: {
@@ -113,7 +115,7 @@ abstract final class LiveHttp {
} }
} }
static Future liveRoomDanmaPrefetch({roomId}) async { static Future liveRoomDanmaPrefetch({required Object roomId}) async {
var res = await Request().get( var res = await Request().get(
Api.liveRoomDmPrefetch, Api.liveRoomDmPrefetch,
queryParameters: {'roomid': roomId}, queryParameters: {'roomid': roomId},
@@ -131,7 +133,9 @@ abstract final class LiveHttp {
} }
} }
static Future liveRoomGetDanmakuToken({roomId}) async { static Future<LoadingState<LiveDmInfoData>> liveRoomGetDanmakuToken({
required Object roomId,
}) async {
var res = await Request().get( var res = await Request().get(
Api.liveRoomDmToken, Api.liveRoomDmToken,
queryParameters: await WbiSign.makSign({ queryParameters: await WbiSign.makSign({
@@ -479,7 +483,7 @@ abstract final class LiveHttp {
} }
static Future<LoadingState<ShieldInfo?>> getLiveInfoByUser( static Future<LoadingState<ShieldInfo?>> getLiveInfoByUser(
dynamic roomId, Object roomId,
) async { ) async {
var res = await Request().get( var res = await Request().get(
Api.getLiveInfoByUser, Api.getLiveInfoByUser,
@@ -559,9 +563,9 @@ abstract final class LiveHttp {
} }
} }
static Future liveShieldUser({ static Future<LoadingState<ShieldUserList>> liveShieldUser({
required dynamic uid, required Object uid,
required dynamic roomid, required Object roomid,
required int type, required int type,
}) async { }) async {
final csrf = Accounts.main.csrf; final csrf = Accounts.main.csrf;
@@ -585,9 +589,9 @@ abstract final class LiveHttp {
static Future<LoadingState<Null>> liveLikeReport({ static Future<LoadingState<Null>> liveLikeReport({
required int clickTime, required int clickTime,
required dynamic roomId, required Object roomId,
required dynamic uid, required Object uid,
required dynamic anchorId, Object? anchorId,
}) async { }) async {
var res = await Request().post( var res = await Request().post(
Api.liveLikeReport, Api.liveLikeReport,
@@ -595,7 +599,7 @@ abstract final class LiveHttp {
'click_time': clickTime, 'click_time': clickTime,
'room_id': roomId, 'room_id': roomId,
'uid': uid, 'uid': uid,
'anchor_id': anchorId, 'anchor_id': ?anchorId,
'web_location': 444.8, 'web_location': 444.8,
'csrf': Accounts.heartbeat.csrf, 'csrf': Accounts.heartbeat.csrf,
}), }),

View File

@@ -7,7 +7,7 @@ import 'package:get/get.dart';
class LiveDmBlockController extends GetxController class LiveDmBlockController extends GetxController
with GetSingleTickerProviderStateMixin { with GetSingleTickerProviderStateMixin {
final roomId = Get.parameters['roomId']; final roomId = Get.parameters['roomId']!;
@override @override
void onInit() { void onInit() {
@@ -128,7 +128,7 @@ class LiveDmBlockController extends GetxController
assert(item is ShieldUserList || item is String); assert(item is ShieldUserList || item is String);
if (item is ShieldUserList) { if (item is ShieldUserList) {
var res = await LiveHttp.liveShieldUser( var res = await LiveHttp.liveShieldUser(
uid: item.uid, uid: item.uid!,
roomid: roomId, roomid: roomId,
type: 0, type: 0,
); );