feat(flutter): 增加轮播自动播放与站内通知
This commit is contained in:
1 parent
b7b1c50427
commit
b870956665
24 files changed
+1398
-26
No files matched your search
@@ -0,0 +1,23 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import '../models/notice.dart';
|
||||
import 'api_client.dart';
|
||||
|
||||
/// Anonymous system notice API.
|
||||
class NoticeApi {
|
||||
const NoticeApi(this._client);
|
||||
|
||||
final ApiClient _client;
|
||||
|
||||
/// Loads one page from `GET /app/notices`.
|
||||
Future<NoticePage> page({required int pageIndex, int pageSize = 20}) async {
|
||||
final data = await _client.get(
|
||||
'/app/notices',
|
||||
query: {'pageIndex': '$pageIndex', 'pageSize': '$pageSize'},
|
||||
);
|
||||
if (data is! Map<String, dynamic>) {
|
||||
return const NoticePage(total: 0);
|
||||
}
|
||||
return NoticePage.fromJson(data);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user