feat: 整体常用控件封装,常用工具类。首页数据对接
This commit is contained in:
1 parent
d90d023e85
commit
fbcd33ea2b
50 files changed
+4558
-264
No files matched your search
@@ -0,0 +1,21 @@
|
||||
|
||||
import 'package:skywood/global/request/api_const.dart';
|
||||
import 'package:skywood/global/request/app_request.dart';
|
||||
import 'package:skywood/utils/models/drama/skywood_home.dart';
|
||||
|
||||
class PlayClient {
|
||||
|
||||
static Future<List<SkywoodHome>> getHomeData() {
|
||||
return AppRequest.get(ApiStringPlay.getHomeModules).then((value) {
|
||||
if (value.isSuccess) {
|
||||
List? list = value.data['data']['list'];
|
||||
List<SkywoodHome> homeList = [];
|
||||
if (list != null) {
|
||||
homeList = list.map((e) => SkywoodHome.fromJson(e)).toList();
|
||||
}
|
||||
return homeList;
|
||||
}
|
||||
return [];
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
|
||||
import 'package:skywood/global/request/api_const.dart';
|
||||
import 'package:skywood/global/request/app_request.dart';
|
||||
import 'package:skywood/global/tool/sky_log.dart';
|
||||
import 'package:skywood/utils/models/user/register_bean.dart';
|
||||
|
||||
class UserClient {
|
||||
|
||||
static Future login() {
|
||||
final body = <String, dynamic>{
|
||||
"avator": '',
|
||||
"email": '123456@qq.com',
|
||||
"family_name": 'test1',
|
||||
"platform": 'android',
|
||||
"third_id": '32434',
|
||||
};
|
||||
return AppRequest.post(ApiString.login, data: body).then((value) {
|
||||
SkyLog.print(value.data, tag: 'loginnnn');
|
||||
});
|
||||
}
|
||||
|
||||
static Future<RegisterBean?> register() {
|
||||
return AppRequest.post(ApiString.register).then((value) {
|
||||
if (value.isSuccess) {
|
||||
return RegisterBean.fromJson(value.data['data']);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user