63 lines
1.3 KiB
Dart
63 lines
1.3 KiB
Dart
import 'dart:typed_data';
|
|
|
|
import 'package:dio/dio.dart';
|
|
|
|
import 'server.dart';
|
|
|
|
Future<Map<String, dynamic>> getMyProfile(String id) async {
|
|
Response response = await request.get(
|
|
'/user_profile/my',
|
|
queryParameters: {'id': id},
|
|
);
|
|
|
|
return response.data;
|
|
}
|
|
|
|
Future<Map<String, dynamic>> modifyBasic(
|
|
String id,
|
|
String nickname,
|
|
String location,
|
|
String birthday,
|
|
String gender,
|
|
) async {
|
|
Response response = await request.post('/user_profile/modify/basic', data: {
|
|
'id': id,
|
|
'nickname': nickname,
|
|
'location': location,
|
|
'birthday': birthday,
|
|
'gender': gender,
|
|
});
|
|
return response.data;
|
|
}
|
|
|
|
Future<Map<String, dynamic>> modifySign(
|
|
String id,
|
|
String sign,
|
|
) async {
|
|
Response response = await request.post('/user_profile/modify/sign', data: {
|
|
'id': id,
|
|
'sign': sign,
|
|
});
|
|
return response.data;
|
|
}
|
|
|
|
Future<Map<String, dynamic>> modifyAvatar(String id, Uint8List avatar) async {
|
|
Response response = await request.post(
|
|
'/user_profile/modify/avatar',
|
|
data: {'file': avatar},
|
|
queryParameters: {
|
|
'id': id,
|
|
},
|
|
);
|
|
return response.data;
|
|
}
|
|
|
|
Future<dynamic> downloadMyAvatar(String id) async {
|
|
Response response = await request.get(
|
|
'/user_porfile/avatar',
|
|
queryParameters: {'id': id},
|
|
);
|
|
|
|
return response.data;
|
|
}
|