所有一级页面和不分二级页面
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import 'package:fpdart/fpdart.dart';
|
||||
import '../../../../../../core/error/failure.dart';
|
||||
import '../../domain/entities/report_entity.dart';
|
||||
import '../../domain/repositories/report_repository.dart';
|
||||
import '../datasources/report_remote_datasource.dart';
|
||||
import '../models/report_model.dart';
|
||||
|
||||
/// 上报仓储实现
|
||||
class ReportRepositoryImpl implements ReportRepository {
|
||||
final ReportRemoteDataSource remoteDataSource;
|
||||
|
||||
ReportRepositoryImpl({required this.remoteDataSource});
|
||||
|
||||
@override
|
||||
Future<Either<Failure, bool>> submitReport(ReportEntity report) async {
|
||||
// 将实体转换为模型
|
||||
final reportModel = ReportModel.fromEntity(report);
|
||||
|
||||
// 调用远程数据源
|
||||
return await remoteDataSource.submitReport(reportModel);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user