feat: 新增动态页面
This commit is contained in:
29
lib/http/dynamics.dart
Normal file
29
lib/http/dynamics.dart
Normal file
@ -0,0 +1,29 @@
|
||||
import 'package:pilipala/http/index.dart';
|
||||
import 'package:pilipala/models/dynamics/result.dart';
|
||||
|
||||
class DynamicsHttp {
|
||||
static Future followDynamic({
|
||||
String? type,
|
||||
int? page,
|
||||
String? offset,
|
||||
}) async {
|
||||
var res = await Request().get(Api.followDynamic, data: {
|
||||
'type': type ?? 'all',
|
||||
'page': page ?? 1,
|
||||
'offest': page == 1 ? '' : offset,
|
||||
'features': 'itemOpusStyle'
|
||||
});
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': DynamicsDataModel.fromJson(res.data['data']),
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': '请求错误 🙅',
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user