压缩图片
This commit is contained in:
@@ -9,9 +9,13 @@ import 'package:dio/dio.dart';
|
||||
import '../dto/article_dto.dart';
|
||||
|
||||
///皮肤检测
|
||||
Future<SkinCheckDto> skinDetectApi(String path) async {
|
||||
Future<SkinCheckDto> skinDetectApi(List<int> bytes) async {
|
||||
FormData formData = FormData.fromMap({
|
||||
"skin_image": await MultipartFile.fromFile(path),
|
||||
"skin_image": MultipartFile.fromBytes(
|
||||
bytes,
|
||||
filename: "upload.jpg",
|
||||
contentType: DioMediaType("image", "jpeg"),
|
||||
),
|
||||
});
|
||||
var res = await Request().post("/skin/check", formData);
|
||||
return SkinCheckDto.fromJson(res);
|
||||
@@ -40,15 +44,15 @@ Future<RecordListDto> skinRecordApi({
|
||||
}
|
||||
|
||||
///获取文章列表
|
||||
Future<List<ArticleDto>> articleListApi() async{
|
||||
var res = await Request().get("/customer-health/get_articles");
|
||||
return (res['list'] as List).map((e) => ArticleDto.fromJson(e)).toList();
|
||||
Future<List<ArticleDto>> articleListApi() async {
|
||||
var res = await Request().get("/customer-health/get_articles");
|
||||
return (res['list'] as List).map((e) => ArticleDto.fromJson(e)).toList();
|
||||
}
|
||||
|
||||
///文章详情
|
||||
Future<ArticleDetailDto> articleDetailApi(String id) async{
|
||||
var res = await Request().get("/customer-health/get_article_detail", {
|
||||
"id": id,
|
||||
});
|
||||
return ArticleDetailDto.fromJson(res);
|
||||
}
|
||||
Future<ArticleDetailDto> articleDetailApi(String id) async {
|
||||
var res = await Request().get("/customer-health/get_article_detail", {
|
||||
"id": id,
|
||||
});
|
||||
return ArticleDetailDto.fromJson(res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user