mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-20 00:56:31 +08:00
opt pub page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -14,6 +14,7 @@ import 'package:PiliPlus/models_new/article/article_view/data.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_mention/data.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_mention/group.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_reserve/data.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_reserve_info/data.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_topic_feed/topic_card_list.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_topic_top/top_details.dart';
|
||||
import 'package:PiliPlus/models_new/dynamic/dyn_topic_top/topic_item.dart';
|
||||
@@ -131,6 +132,7 @@ class DynamicsHttp {
|
||||
List<Map<String, dynamic>>? extraContent,
|
||||
Pair<int, String>? topic,
|
||||
String? title,
|
||||
Map? attachCard,
|
||||
}) async {
|
||||
var res = await Request().post(
|
||||
Api.createDynamic,
|
||||
@@ -171,7 +173,7 @@ class DynamicsHttp {
|
||||
? 2
|
||||
: 1,
|
||||
if (pics != null) 'pics': pics,
|
||||
"attach_card": null,
|
||||
"attach_card": attachCard,
|
||||
"upload_id":
|
||||
"${rid != null ? 0 : mid}_${DateTime.now().millisecondsSinceEpoch ~/ 1000}_${Utils.random.nextInt(9000) + 1000}",
|
||||
"meta": {
|
||||
@@ -555,4 +557,72 @@ class DynamicsHttp {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<int?>> createReserve({
|
||||
int subType = 0,
|
||||
required String title,
|
||||
required int livePlanStartTime,
|
||||
}) async {
|
||||
final res = await Request().post(
|
||||
Api.createReserve,
|
||||
data: {
|
||||
'type': 2,
|
||||
'sub_type': subType,
|
||||
'from': 1,
|
||||
'title': title,
|
||||
'live_plan_start_time': livePlanStartTime,
|
||||
'csrf': Accounts.main.csrf,
|
||||
},
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(res.data['data']?['sid']);
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<int?>> updateReserve({
|
||||
int subType = 0,
|
||||
required String title,
|
||||
required int livePlanStartTime,
|
||||
required int sid,
|
||||
}) async {
|
||||
final res = await Request().post(
|
||||
Api.updateReserve,
|
||||
data: {
|
||||
'type': 2,
|
||||
'sub_type': subType,
|
||||
'from': 1,
|
||||
'title': title,
|
||||
'live_plan_start_time': livePlanStartTime,
|
||||
'id': sid,
|
||||
'csrf': Accounts.main.csrf,
|
||||
},
|
||||
options: Options(contentType: Headers.formUrlEncodedContentType),
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(res.data['data']?['sid']);
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<ReserveInfoData>> reserveInfo({
|
||||
required dynamic sid,
|
||||
}) async {
|
||||
final res = await Request().get(
|
||||
Api.reserveInfo,
|
||||
queryParameters: {
|
||||
'from': 1,
|
||||
'id': sid,
|
||||
'web_location': 333.1365,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(ReserveInfoData.fromJson(res.data['data']));
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user