mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-29 12:38:34 +00:00
opt pub panel
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:PiliPlus/models/pgc/info.dart';
|
||||
import 'package:PiliPlus/models/search/result.dart';
|
||||
import 'package:PiliPlus/models/search/search_trending/trending_data.dart';
|
||||
import 'package:PiliPlus/models/search/suggest.dart';
|
||||
import 'package:PiliPlus/models/topic_pub_search/data.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -259,4 +260,29 @@ class SearchHttp {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
|
||||
static Future<LoadingState<TopicPubSearchData>> topicPubSearch({
|
||||
required String keywords,
|
||||
String content = '',
|
||||
required int pageNum,
|
||||
}) async {
|
||||
final res = await Request().get(
|
||||
Api.topicPubSearch,
|
||||
queryParameters: {
|
||||
'keywords': keywords,
|
||||
'content': content,
|
||||
if (pageNum == 1) ...{
|
||||
'page_size': 20,
|
||||
'page_num': 1,
|
||||
} else
|
||||
'offset': 20 * (pageNum - 1),
|
||||
'web_location': 333.1365,
|
||||
},
|
||||
);
|
||||
if (res.data['code'] == 0) {
|
||||
return Success(TopicPubSearchData.fromJson(res.data['data']));
|
||||
} else {
|
||||
return Error(res.data['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user