first commit
This commit is contained in:
43
moehu/moehu_fontend/lib/service/UserService.dart
Normal file
43
moehu/moehu_fontend/lib/service/UserService.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/http/Dio.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
|
||||
class UserService {
|
||||
// 登录接口
|
||||
static Future<LoginData> Login(Map<String, String> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['login'], params: params);
|
||||
return LoginList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 注册接口
|
||||
static Future<RegData> Reg(Map<String, String> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['reg'], params: params);
|
||||
return RegList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 获取个人信息
|
||||
static Future<UserInfoPersonalEntityData> UserInfo(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['UserInfo'], params: params);
|
||||
return UserInfoPersonalEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 获取粉丝列表
|
||||
static Future<FansUserListEntityData> getFansUserList(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['FansUserList'], params: params);
|
||||
return FansUserListEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 获取关注列表
|
||||
static Future<FollowUserListEntityData> getFollowUserList(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['FollowUserList'], params: params);
|
||||
return FollowUserListEntityList.fromJson(res).data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user