mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 19:16:44 +08:00
feat: member cheese
feat: fav pugv Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -850,6 +850,12 @@ class Api {
|
||||
|
||||
static const String dynReserve = '/x/dynamic/feed/reserve/click';
|
||||
|
||||
static const String favPugv = '/pugv/app/web/favorite/page';
|
||||
|
||||
static const String addFavPugv = '/pugv/app/web/favorite/add';
|
||||
|
||||
static const String delFavPugv = '/pugv/app/web/favorite/del';
|
||||
|
||||
static const String favTopicList = '/x/topic/web/fav/list';
|
||||
|
||||
static const String addFavTopic = '/x/topic/fav/sub/add';
|
||||
@@ -920,6 +926,8 @@ class Api {
|
||||
|
||||
static const String spaceAudio = '/audio/music-service/web/song/upper';
|
||||
|
||||
static const String spaceCheese = '/pugv/app/web/season/page';
|
||||
|
||||
static const String dynMention = '/x/polymer/web-dynamic/v1/mention/search';
|
||||
|
||||
static const String createVote = '/x/vote/create';
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:PiliPlus/models_new/fav/fav_folder/list.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_note/list.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_pgc/data.dart';
|
||||
import 'package:PiliPlus/models_new/fav/fav_topic/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_cheese/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_fav/data.dart';
|
||||
import 'package:PiliPlus/models_new/sub/sub_detail/data.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
@@ -142,6 +143,58 @@ class FavHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<SpaceCheeseData>> favPugv({
|
||||
required int mid,
|
||||
required int page,
|
||||
}) async {
|
||||
var res = await Request().get(
|
||||
Api.favPugv,
|
||||
queryParameters: {
|
||||
'mid': mid,
|
||||
'ps': 20,
|
||||
'pn': page,
|
||||
'web_location': 333.1387,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(SpaceCheeseData.fromJson(res.data['data']));
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future addFavPugv(seasonId) async {
|
||||
var res = await Request().post(
|
||||
Api.addFavPugv,
|
||||
data: {
|
||||
'season_id': seasonId,
|
||||
'csrf': Accounts.main.csrf,
|
||||
},
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
static Future delFavPugv(seasonId) async {
|
||||
var res = await Request().post(
|
||||
Api.delFavPugv,
|
||||
data: {
|
||||
'season_id': seasonId,
|
||||
'csrf': Accounts.main.csrf,
|
||||
},
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return {'status': true};
|
||||
} else {
|
||||
return {'status': false, 'msg': res.data['message']};
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<FavTopicData>> favTopic({
|
||||
required int page,
|
||||
}) async {
|
||||
|
||||
@@ -20,6 +20,7 @@ import 'package:PiliPlus/models_new/space/space/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_archive/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_article/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_audio/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_cheese/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_opus/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_season_series/item.dart';
|
||||
import 'package:PiliPlus/models_new/upower_rank/data.dart';
|
||||
@@ -186,6 +187,26 @@ class MemberHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<SpaceCheeseData>> spaceCheese({
|
||||
required int page,
|
||||
required mid,
|
||||
}) async {
|
||||
var res = await Request().get(
|
||||
Api.spaceCheese,
|
||||
queryParameters: {
|
||||
'pn': page,
|
||||
'ps': 30,
|
||||
'mid': mid,
|
||||
'web_location': 333.1387,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(SpaceCheeseData.fromJson(res.data['data']));
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState> spaceStory({
|
||||
required mid,
|
||||
required aid,
|
||||
|
||||
Reference in New Issue
Block a user