first commit
This commit is contained in:
1
moehu/moehu_fontend/lib/service/.pydio
Normal file
1
moehu/moehu_fontend/lib/service/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
a7babd43-d3bc-49f7-b9a7-38a5d05e261e
|
||||
22
moehu/moehu_fontend/lib/service/CommentService.dart
Normal file
22
moehu/moehu_fontend/lib/service/CommentService.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/CommenListEntity.dart';
|
||||
import 'package:peach/entity/EmptyEntity.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/http/Dio.dart';
|
||||
|
||||
class CommentService {
|
||||
// 发评论
|
||||
static Future<Null> commentAdd(Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['commentAdd'], params: params);
|
||||
return EmptyEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 评论列表
|
||||
static Future<CommenListEntityData> getCommentList(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['commentList'], params: params);
|
||||
return CommenListEntityList.fromJson(res).data;
|
||||
}
|
||||
}
|
||||
54
moehu/moehu_fontend/lib/service/DynamicService.dart
Normal file
54
moehu/moehu_fontend/lib/service/DynamicService.dart
Normal file
@@ -0,0 +1,54 @@
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/entity/EmptyEntity.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
import 'package:peach/http/Dio.dart';
|
||||
|
||||
class DynamicService {
|
||||
// 动态列表
|
||||
static Future<DynamicPersonalDynamicEntityData> dynamicPersonalDynamic(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi().post(
|
||||
url: Config.ApiUrl['ApiList']['dynamicPersonalDynamic'],
|
||||
params: params);
|
||||
return DynamicPersonalDynamicEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
/*
|
||||
* 发布动态
|
||||
*/
|
||||
static Future<Null> dynamicPush(Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['dynamicPush'], params: params);
|
||||
return EmptyEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
/*
|
||||
* 底部tabbar的动态列表
|
||||
*/
|
||||
static Future<DynamicTabsDynamicEntityData> dynamicTabsDynamic(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi().post(
|
||||
url: Config.ApiUrl['ApiList']['dynamicTabsDynamic'], params: params);
|
||||
return DynamicTabsDynamicEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
/*
|
||||
* 【需要Token】获取【最常访问】用户列表
|
||||
*/
|
||||
static Future<DynamicDynamicHistoryEntityData> dynamicDynamicHistory(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi().post(
|
||||
url: Config.ApiUrl['ApiList']['dynamicDynamicHistory'], params: params);
|
||||
return DynamicDynamicHistoryEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
/*
|
||||
* 动态详情
|
||||
*/
|
||||
static Future<DynamicInfoEntityData> dynamicInfo(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['dynamicInfo'], params: params);
|
||||
return DynamicInfoEntityList.fromJson(res).data;
|
||||
}
|
||||
}
|
||||
108
moehu/moehu_fontend/lib/service/OpusService.dart
Normal file
108
moehu/moehu_fontend/lib/service/OpusService.dart
Normal file
@@ -0,0 +1,108 @@
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/http/Dio.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
|
||||
class OpusService {
|
||||
// 获取首页推荐列表
|
||||
static Future<OpusRecommendData> getOpusRecommend(
|
||||
Map<String, int> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['opusRecommend'], params: params);
|
||||
return OpusRecommendList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 获取作品详情
|
||||
static Future<OpusOpusInfoEntityData> getOpusOpusInfo(
|
||||
Map<String, int> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['opusOpusInfo'], params: params);
|
||||
return OpusOpusInfoEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 判断当前用户是否被关注
|
||||
static Future<bool> isCheckUserIsFollow(Map<String, int> params) async {
|
||||
var res = await HttpApi().post(
|
||||
url: Config.ApiUrl['ApiList']['checkUserIsFollow'], params: params);
|
||||
return CheckUserIsFollowEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 关注和取消关注
|
||||
static Future<bool> opusFollowUser(Map<String, int> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['opusFollowUser'], params: params);
|
||||
return EmptyEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 检查作品是否被点赞
|
||||
static Future<bool> opusCheckOpusIsUpvote(Map<String, int> params) async {
|
||||
var res = await HttpApi().post(
|
||||
url: Config.ApiUrl['ApiList']['opusCheckOpusIsUpvote'], params: params);
|
||||
return CheckUserIsFollowEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 点赞和取消点赞
|
||||
static Future<bool> opusUpvoteOpus(Map<String, int> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['opusUpvoteOpus'], params: params);
|
||||
return EmptyEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 发布作品
|
||||
static Future<Null> opusPushOpus(Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['opusPushOpus'], params: params);
|
||||
return EmptyEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 检查作品是否被收藏
|
||||
static Future<bool> opusCheckOpusIsCollection(Map<String, int> params) async {
|
||||
var res = await HttpApi().post(
|
||||
url: Config.ApiUrl['ApiList']['opusCheckOpusIsCollection'],
|
||||
params: params);
|
||||
return CheckUserIsFollowEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 作品收藏和取消收藏
|
||||
static Future<bool> opusCollectionOpus(Map<String, int> params) async {
|
||||
var res = await HttpApi().post(
|
||||
url: Config.ApiUrl['ApiList']['opusCollectionOpus'], params: params);
|
||||
return EmptyEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 排行列表
|
||||
static Future<OpusRankingEntityData> opusRanking(
|
||||
Map<String, int> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['opusRanking'], params: params);
|
||||
return OpusRankingEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 搜索接口
|
||||
static Future<dynamic> opusSearch(Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['opusOpusSearch'], params: params);
|
||||
return res;
|
||||
}
|
||||
|
||||
// 收藏列表
|
||||
static Future<CollectionOpusListEntityData> collectionOpusList(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi().post(
|
||||
url: Config.ApiUrl['ApiList']['CollectionOpusList'], params: params);
|
||||
return CollectionOpusListEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 获取关注用户的作品
|
||||
static Future<FollowData> getFollow(Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['Follow'], params: params);
|
||||
return FollowList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 获取个人空间的投稿列表,用的首页推荐的实体
|
||||
static Future<OpusListEntityData> getOpusList(Map<String, int> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['getOpusList'], params: params);
|
||||
return OpusListEntityList.fromJson(res).data;
|
||||
}
|
||||
}
|
||||
23
moehu/moehu_fontend/lib/service/PublicService.dart
Normal file
23
moehu/moehu_fontend/lib/service/PublicService.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/http/Dio.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
|
||||
class PublicService {
|
||||
// 上传文件
|
||||
static Future<ToolUploadFileEntityData> toolUploadFile(
|
||||
FormData params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['toolUploadFile'], params: params);
|
||||
return ToolUploadFileEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
/// App更新接口
|
||||
static Future<Data> update({ Map<String, dynamic> params }) async {
|
||||
var res = await HttpApi().post(
|
||||
url: Config.ApiUrl['ApiList']['Update'],
|
||||
params: params
|
||||
);
|
||||
return UpdateVersionEntity.fromJson(res).data;
|
||||
}
|
||||
}
|
||||
45
moehu/moehu_fontend/lib/service/TagService.dart
Normal file
45
moehu/moehu_fontend/lib/service/TagService.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:peach/config/_.dart';
|
||||
import 'package:peach/http/Dio.dart';
|
||||
import 'package:peach/entity/_.dart';
|
||||
|
||||
class TagService {
|
||||
// 推荐话题
|
||||
static Future<List<TagRecommendTagEntityData>> tagRecommendTag(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['tagRecommendTag'], params: params);
|
||||
return TagRecommendTagEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 作品标签
|
||||
static Future<List<OpusTagEntityData>> tagOpusTag(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['OpusTag'], params: params);
|
||||
return OpusTagEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 新增标签
|
||||
static Future<Null> tagOpusInfoCreatedTags(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi().post(
|
||||
url: Config.ApiUrl['ApiList']['OpusInfoCreatedTags'], params: params);
|
||||
return EmptyEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 修改当前标签编辑状态
|
||||
static Future<Null> tagUpdateTagsEditStatus(
|
||||
Map<String, dynamic> params) async {
|
||||
var res = await HttpApi().post(
|
||||
url: Config.ApiUrl['ApiList']['UpdateTagsEditStatus'], params: params);
|
||||
return EmptyEntityList.fromJson(res).data;
|
||||
}
|
||||
|
||||
// 删除标签
|
||||
static Future<Null> tagDeleteTag(Map<String, dynamic> params) async {
|
||||
var res = await HttpApi()
|
||||
.post(url: Config.ApiUrl['ApiList']['DeleteTag'], params: params);
|
||||
return EmptyEntityList.fromJson(res).data;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
8
moehu/moehu_fontend/lib/service/_.dart
Normal file
8
moehu/moehu_fontend/lib/service/_.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
library Service;
|
||||
|
||||
export 'UserService.dart';
|
||||
export 'OpusService.dart';
|
||||
export 'CommentService.dart';
|
||||
export 'DynamicService.dart';
|
||||
export 'TagService.dart';
|
||||
export 'PublicService.dart';
|
||||
Reference in New Issue
Block a user