Files
flutter_init_template/lib/data/api/common_api.dart
2026-03-10 13:36:40 +08:00

23 lines
774 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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);
}