Blame view

lib/common/request/dao/lesson_dao.dart 1.52 KB
13e6d11d   liangchengyou   feat:首页课程模块接口
1
  import 'package:wow_english/common/request/request_client.dart';
8988aa69   liangchengyou   feat:首页+课程列表数据获取
2
  import 'package:wow_english/models/course_entity.dart';
2187c85f   吴启风   feat:课程结构调整
3
  import 'package:wow_english/models/course_section_entity.dart';
13e6d11d   liangchengyou   feat:首页课程模块接口
4
  
bcd47f52   Key   fixed: 接口list范型支持
5
  import '../../../models/course_module_entity.dart';
2a3621f8   吴启风   feat:课程层级调整(增加unit层)
6
  import '../../../models/course_unit_entity.dart';
bcd47f52   Key   fixed: 接口list范型支持
7
  
2187c85f   吴启风   feat:课程结构调整
8
  class LessonDao {
2a3621f8   吴启风   feat:课程层级调整(增加unit层)
9
    ///获取课程模块(列表)信息
bcd47f52   Key   fixed: 接口list范型支持
10
11
    static Future<List<CourseModuleEntity?>?> courseModule() async {
      var data = await requestClient.get<List<CourseModuleEntity>>(Apis.courseModule);
13e6d11d   liangchengyou   feat:首页课程模块接口
12
13
14
      return data;
    }
  
2a3621f8   吴启风   feat:课程层级调整(增加unit层)
15
    ///课程单元列表
1e22b7d1   吴启风   feat:儿歌/视频环节接口请求时机优化
16
    ///@param moduleId 模块id
2187c85f   吴启风   feat:课程结构调整
17
    static Future<CourseUnitEntity?> courseUnit(int? moduleId) async {
2a3621f8   吴启风   feat:课程层级调整(增加unit层)
18
      Map<String, dynamic> mapData = {};
2187c85f   吴启风   feat:课程结构调整
19
20
21
      if (moduleId != null) {
        mapData['moduleId'] = moduleId;
      }
2a3621f8   吴启风   feat:课程层级调整(增加unit层)
22
23
24
25
      var data = await requestClient.get<CourseUnitEntity>(Apis.courseUnit, queryParameters: mapData);
      return data;
    }
  
13e6d11d   liangchengyou   feat:首页课程模块接口
26
    ///课程列表
2187c85f   吴启风   feat:课程结构调整
27
    static Future<CourseEntity?> courseLesson({int? courseUnitId}) async {
8988aa69   liangchengyou   feat:首页+课程列表数据获取
28
      Map<String, dynamic> mapData = {};
2187c85f   吴启风   feat:课程结构调整
29
30
      if (courseUnitId != null) {
        mapData['courseUnitId'] = courseUnitId;
8988aa69   liangchengyou   feat:首页+课程列表数据获取
31
      }
4b2c2f07   Key   feat: 三种修改密码的类型及接口
32
      var data = await requestClient.get<CourseEntity>(Apis.courseLesson, queryParameters: mapData);
13e6d11d   liangchengyou   feat:首页课程模块接口
33
34
      return data;
    }
2187c85f   吴启风   feat:课程结构调整
35
  
1e22b7d1   吴启风   feat:儿歌/视频环节接口请求时机优化
36
    ///课程(环节)列表
2187c85f   吴启风   feat:课程结构调整
37
38
39
40
41
42
    static Future<List<CourseSectionEntity>?> courseSection({required int courseUnitId}) async {
      Map<String, dynamic> mapData = {};
      mapData['courseUnitId'] = courseUnitId;
      var data = await requestClient.get<List<CourseSectionEntity>?>(Apis.courseSection, queryParameters: mapData);
      return data;
    }
13e6d11d   liangchengyou   feat:首页课程模块接口
43
  }