初始化
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
import 'package:hgdj/hj_model/list_base_model.dart';
|
||||
import 'package:hgdj/hj_page/live/live_model.dart';
|
||||
import 'package:hgdj/tools_base/net/http_manager.dart';
|
||||
import 'package:hgdj/tools_base/net/net_manager.dart';
|
||||
|
||||
class LiveService {
|
||||
//获取直播模块
|
||||
static Future<LiveMainModel?> getLiveModuleList() async {
|
||||
int time =
|
||||
netManager.getFixedCurTime().toUtc().millisecondsSinceEpoch ~/ 1000;
|
||||
final param = {'time': time};
|
||||
final result = await httpManager.fetchResponseByPOST(
|
||||
'/live/module/list/91porn',
|
||||
param: param,
|
||||
jsonTransformation: (json) => LiveMainModel.fromJson(json),
|
||||
);
|
||||
return result.data;
|
||||
}
|
||||
|
||||
//获取直播模块
|
||||
static Future<ListBaseModel<LiveAnchor>?> getLiveAnchorList({
|
||||
String? id,
|
||||
int? pageNumber,
|
||||
int? pageSize,
|
||||
}) async {
|
||||
int time =
|
||||
netManager.getFixedCurTime().toUtc().millisecondsSinceEpoch ~/ 1000;
|
||||
final param = {
|
||||
'time': time,
|
||||
'id': id,
|
||||
'pageNumber': pageNumber,
|
||||
'pageSize': 20,
|
||||
};
|
||||
final result = await httpManager.fetchResponseByPOST(
|
||||
'/live/anchor/list/91porn',
|
||||
param: param,
|
||||
jsonTransformation: (json) => ListBaseModel<LiveAnchor>.fromJson(json),
|
||||
);
|
||||
return result.data;
|
||||
}
|
||||
|
||||
//获取直播详情模块
|
||||
static Future<LiveAnchor?> getLiveAnchorDetail({String? id}) async {
|
||||
int time =
|
||||
netManager.getFixedCurTime().toUtc().millisecondsSinceEpoch ~/ 1000;
|
||||
final param = {
|
||||
'time': time,
|
||||
'id': id,
|
||||
};
|
||||
final result = await httpManager.fetchResponseByPOST(
|
||||
'/live/anchor/watch/91porn',
|
||||
param: param,
|
||||
jsonTransformation: (json) => LiveAnchor.fromJson(json),
|
||||
);
|
||||
return result.data;
|
||||
}
|
||||
|
||||
//获取直播详情推荐列表
|
||||
static Future<ListBaseModel<LiveAnchor>?> getLiveAnchorRecom({
|
||||
String? country,
|
||||
int? pageNumber,
|
||||
int? pageSize,
|
||||
}) async {
|
||||
int time =
|
||||
netManager.getFixedCurTime().toUtc().millisecondsSinceEpoch ~/ 1000;
|
||||
final param = {
|
||||
'time': time,
|
||||
'country': country,
|
||||
'pageNumber': pageNumber,
|
||||
'pageSize': pageSize,
|
||||
};
|
||||
final result = await httpManager.fetchResponseByPOST(
|
||||
'/live/anchor/recom/91porn',
|
||||
param: param,
|
||||
jsonTransformation: (json) => ListBaseModel<LiveAnchor>.fromJson(json),
|
||||
);
|
||||
return result.data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user