mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: merge fav,follow,history search
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import 'package:PiliPalaX/http/loading_state.dart';
|
||||
|
||||
import '../models/dynamics/result.dart';
|
||||
import '../models/follow/result.dart';
|
||||
import '../models/member/archive.dart';
|
||||
@@ -386,7 +388,7 @@ class MemberHttp {
|
||||
}
|
||||
|
||||
// 搜索follow
|
||||
static Future getfollowSearch({
|
||||
static Future<LoadingState> getfollowSearch({
|
||||
required int mid,
|
||||
required int ps,
|
||||
required int pn,
|
||||
@@ -409,16 +411,9 @@ class MemberHttp {
|
||||
'wts': params['wts'],
|
||||
});
|
||||
if (res.data['code'] == 0) {
|
||||
return {
|
||||
'status': true,
|
||||
'data': FollowDataModel.fromJson(res.data['data'])
|
||||
};
|
||||
return LoadingState.success(FollowDataModel.fromJson(res.data['data']));
|
||||
} else {
|
||||
return {
|
||||
'status': false,
|
||||
'data': [],
|
||||
'msg': res.data['message'],
|
||||
};
|
||||
return LoadingState.error(res.data['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ class UserHttp {
|
||||
// }
|
||||
|
||||
// 搜索历史记录
|
||||
static Future searchHistory(
|
||||
static Future<LoadingState> searchHistory(
|
||||
{required int pn, required String keyword}) async {
|
||||
var res = await Request().get(
|
||||
Api.searchHistory,
|
||||
@@ -297,9 +297,9 @@ class UserHttp {
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true, 'data': HistoryData.fromJson(res.data['data'])};
|
||||
return LoadingState.success(HistoryData.fromJson(res.data['data']));
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
return LoadingState.error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user