refactor(apps): 主题系统迁移至 ColorScheme + 扩展架构并支持 Dark Mode
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import 'dart:io';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:social_app/core/network/i_api_client.dart';
|
||||
import 'models/user_response.dart';
|
||||
import 'package:social_app/data/models/user_profile.dart';
|
||||
|
||||
class UserBasicInfo {
|
||||
final String id;
|
||||
@@ -30,14 +30,14 @@ class UsersApi {
|
||||
return UserBasicInfo.fromJson(response.data);
|
||||
}
|
||||
|
||||
Future<UserResponse> getMe() async {
|
||||
Future<UserProfile> getMe() async {
|
||||
final response = await _client.get('$_prefix/me');
|
||||
return UserResponse.fromJson(response.data);
|
||||
return UserProfile.fromJson(response.data);
|
||||
}
|
||||
|
||||
Future<UserResponse> updateMe(UserUpdateRequest request) async {
|
||||
Future<UserProfile> updateMe(UserUpdateRequest request) async {
|
||||
final response = await _client.patch('$_prefix/me', data: request.toJson());
|
||||
return UserResponse.fromJson(response.data);
|
||||
return UserProfile.fromJson(response.data);
|
||||
}
|
||||
|
||||
Future<String> uploadAvatar(File file) async {
|
||||
@@ -62,12 +62,12 @@ class UsersApi {
|
||||
return url;
|
||||
}
|
||||
|
||||
Future<List<UserResponse>> searchUsers(String query) async {
|
||||
Future<List<UserProfile>> searchUsers(String query) async {
|
||||
final response = await _client.post(
|
||||
'$_prefix/search',
|
||||
data: {'query': query},
|
||||
);
|
||||
final List<dynamic> data = response.data;
|
||||
return data.map((json) => UserResponse.fromJson(json)).toList();
|
||||
return data.map((json) => UserProfile.fromJson(json)).toList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user