初始化
This commit is contained in:
22
lib/data/api/common_api.dart
Normal file
22
lib/data/api/common_api.dart
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
import 'package:app/core/network/request.dart';
|
||||
import '../models/common/qiu_token_dto.dart';
|
||||
import '../models/common/version_dto.dart';
|
||||
|
||||
///获取七牛token
|
||||
/// - [fileKey]: 文件key
|
||||
/// - [isPrivate]: 是否私有
|
||||
Future<QiuTokenDto> getQiuTokenApi(String fileKey, {bool isPrivate = false}) async {
|
||||
var response = await Request().get("/file/get_qiniu_upload_token", {
|
||||
"file_key": fileKey,
|
||||
"is_public_bucket": isPrivate ? 2 : 1,
|
||||
});
|
||||
return QiuTokenDto.fromJson(response);
|
||||
}
|
||||
|
||||
///获取APP最新版本
|
||||
/// - [isIos] 是否获取ios最新版本,默认安卓
|
||||
Future<VersionDto> getAppVersionApi({bool isIos = false}) async {
|
||||
var response = await Request().get("/get_latest_version", {"platform": isIos ? 2 : 1});
|
||||
return VersionDto.fromJson(response);
|
||||
}
|
||||
Reference in New Issue
Block a user