-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
|
||
import 'package:discuz_flutter/converter/SecondToDateTimeConverter.dart'; | ||
import 'package:json_annotation/json_annotation.dart'; | ||
|
||
part 'BilibiliVideoResult.g.dart'; | ||
|
||
@JsonSerializable() | ||
class BilibiliVideoResult{ | ||
|
||
int code = 0; | ||
String message = ""; | ||
int ttl = 0; | ||
|
||
BilibiliVideoData data = BilibiliVideoData(); | ||
|
||
|
||
|
||
BilibiliVideoResult(); | ||
|
||
factory BilibiliVideoResult.fromJson(Map<String, dynamic> json) => _$BilibiliVideoResultFromJson(json); | ||
} | ||
|
||
@JsonSerializable() | ||
class BilibiliVideoData{ | ||
@JsonKey(name: "View") | ||
BilibiliVideoViewData viewData = BilibiliVideoViewData(); | ||
|
||
BilibiliVideoData(); | ||
|
||
factory BilibiliVideoData.fromJson(Map<String, dynamic> json) => _$BilibiliVideoDataFromJson(json); | ||
} | ||
|
||
@JsonSerializable() | ||
class BilibiliVideoViewData{ | ||
|
||
String bvid = ""; | ||
int aid = 0; | ||
int videos = 0; | ||
int tid = 0; | ||
String tname = ""; | ||
int copyright = 1; | ||
String pic = ""; | ||
String title = ""; | ||
int pubdate = 0, ctime = 0; | ||
String desc = ""; | ||
int state = 0; | ||
int duration = 0, mission_id=0; | ||
|
||
BilibiliVideoViewDataOwner owner = BilibiliVideoViewDataOwner(); | ||
|
||
|
||
BilibiliVideoViewData(); | ||
|
||
factory BilibiliVideoViewData.fromJson(Map<String, dynamic> json) => _$BilibiliVideoViewDataFromJson(json); | ||
} | ||
|
||
@JsonSerializable() | ||
class BilibiliVideoViewDataOwner{ | ||
|
||
int mid = 0; | ||
String name = "", face=""; | ||
|
||
BilibiliVideoViewDataOwner(); | ||
|
||
factory BilibiliVideoViewDataOwner.fromJson(Map<String, dynamic> json) => _$BilibiliVideoViewDataOwnerFromJson(json); | ||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
|
||
import 'package:dio/dio.dart'; | ||
import 'package:discuz_flutter/JsonResult/BilibiliVideoResult.dart'; | ||
import 'package:retrofit/error_logger.dart'; | ||
import 'package:retrofit/http.dart'; | ||
|
||
part 'BilibiliApiClient.g.dart'; | ||
|
||
@RestApi(baseUrl: "https://api.bilibili.com") | ||
abstract class BilibiliApiClient { | ||
factory BilibiliApiClient(Dio dio, {required String baseUrl}) = _BilibiliApiClient; | ||
|
||
@GET("/x/web-interface/view/detail") | ||
Future<BilibiliVideoResult> getVideoResultByAid( | ||
@Query("aid") String aid, | ||
); | ||
|
||
@GET("/x/web-interface/view/detail") | ||
Future<BilibiliVideoResult> getVideoResultByBvid( | ||
@Query("bvid") String bvid, | ||
); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.