feat:更新个人主页模块
This commit is contained in:
@@ -24,6 +24,13 @@ Future<List<Moment>> queryMomentListApi() {
|
||||
);
|
||||
}
|
||||
|
||||
Future<List<Moment>> queryMomentListByUserIdApi(int userId) {
|
||||
return httpUtil.get<List<Moment>>(
|
||||
"/moment/$userId",
|
||||
converter: (data) => convertList<Moment>(data, Moment.fromJson),
|
||||
);
|
||||
}
|
||||
|
||||
Future<PageMoment> queryMomentByPageApi(int currentPage, int pageSize) {
|
||||
return httpUtil.get<PageMoment>(
|
||||
"/moment/page",
|
||||
|
||||
12
lib/apis/user.dart
Normal file
12
lib/apis/user.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
import 'package:flutter_common/utils/http_utils.dart';
|
||||
import 'package:food_hub_app/config/app_config.dart';
|
||||
import 'package:food_hub_app/models/session.dart';
|
||||
|
||||
final httpUtil = HttpUtil(baseUrl: AppConfig.baseApiUrl);
|
||||
|
||||
Future<User> queryUserApi(int number) {
|
||||
return httpUtil.get<User>(
|
||||
"/user/$number",
|
||||
converter: (data) => User.fromJson(data),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user