import 'package:fis_i18n/i18n.dart';
import 'package:fis_jsonrpc/rpc.dart';
import 'package:flyinsono/managers/interfaces/entities/classInfo.dart';
import 'package:flyinsono/managers/interfaces/entities/media_library.dart';
import 'package:get/get.dart';

class FlyinsonoCollegeState {
  RxList<MediaLibrary> _mediaLibrarys = RxList([]);
  RxList<UserGroupDTO> _classInfos = RxList([]);
  Rx<ClassRoleType> _classRoleType = Rx(ClassRoleType.Teacher);

  ///班级信息
  List<UserGroupDTO> get classInfos => _classInfos;
  set classInfos(List<UserGroupDTO> v) => _classInfos.value = v;

  ///素材库
  List<MediaLibrary> get mediaLibrarys => _mediaLibrarys;
  set mediaLibrarys(List<MediaLibrary> v) => _mediaLibrarys.value = v;

  /// 当前角色
  ClassRoleType get classRoleType => _classRoleType.value;
  set classRoleType(ClassRoleType v) => _classRoleType.value = v;

  ///申请进入班级的学生
  List<UserGroupStudentsDTO> applayStudents = [];

  ///班级内的学生
  List<UserGroupStudentsDTO> students = [];

  final List<Course> courseAlbumList = [
    Course(
      type: i18nBook.college.screening.t,
      isCanSubscribe: true,
      title: i18nBook.college.earlyObstetricScreeningAlbumPart1.t,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-26_16-46-57.png',
    ),
    Course(
      type: i18nBook.college.screening.t,
      isCanSubscribe: false,
      title: i18nBook.college.earlyObstetricScreeningAlbumPart2.t,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-26_16-46-57.png',
    ),
    Course(
      type: i18nBook.college.echocardiogram.t,
      isCanSubscribe: true,
      title: i18nBook.college.echocardiographyAlbumPart1.t,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-27_09-49-56.png',
    ),
    Course(
      type: i18nBook.college.echocardiogram.t,
      isCanSubscribe: true,
      title: i18nBook.college.echocardiographyAlbumPart2.t,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-27_09-49-56.png',
    ),
    Course(
      type: i18nBook.college.neurology.t,
      isCanSubscribe: false,
      title: i18nBook.college.ultrasoundNeurosciencesAlbum.t,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-27_10-42-23.png',
    ),
  ];

  final List<Course> popularCourses = [
    Course(
      type: i18nBook.college.emergencyDepartment.t,
      isCanSubscribe: true,
      title: i18nBook.college.emergencyCriticalCareAlbumPart1.t,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-26_17-00-57.png',
    ),
    Course(
      type: i18nBook.college.emergencyDepartment.t,
      isCanSubscribe: true,
      title: i18nBook.college.emergencyCriticalCareAlbumPart2.t,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-26_17-00-57.png',
    ),
    Course(
      type: i18nBook.college.emergencyDepartment.t,
      isCanSubscribe: true,
      title: i18nBook.college.emergencyCriticalCareAlbumPart3.t,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-26_17-00-57.png',
    ),
    Course(
      type: i18nBook.college.softTissueAlbum.t,
      isCanSubscribe: true,
      title: i18nBook.college.softTissueUltrasoundAlbum.t,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-27_10-52-15.png',
    ),
    Course(
      type: i18nBook.college.neckAlbum.t,
      isCanSubscribe: true,
      title: i18nBook.college.neckUltrasoundAlbum.t,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-27_10-55-57.png',
    ),
  ];

  final List<Course> liveCourses = [
    Course(
      title: i18nBook.college.liverPunctureGuidedByUltrasoundAlbum.t,
      status: LiveCourseStatus.Livestreaming,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-26_17-04-35.png',
    ),
    Course(
      title: i18nBook.college.liverPunctureGuidedByUltrasoundAlbum.t,
      status: LiveCourseStatus.NotStart,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-26_17-04-35.png',
    ),
    Course(
      title: i18nBook.college.liverPunctureGuidedByUltrasoundAlbum.t,
      status: LiveCourseStatus.NotStart,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-26_17-04-35.png',
    ),
    Course(
      title: i18nBook.college.liverPunctureGuidedByUltrasoundAlbum.t,
      status: LiveCourseStatus.NotStart,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-26_17-04-35.png',
    ),
    Course(
      title: i18nBook.college.liverPunctureGuidedByUltrasoundAlbum.t,
      status: LiveCourseStatus.NotStart,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-26_17-04-35.png',
    ),
  ];

  final List<Course> thirdCourses = [
    Course(
      title: i18nBook.college.memoryTrackingContrastEnhancedTechnique.t,
      status: LiveCourseStatus.Livestreaming,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-28_13-36-20.png',
    ),
    Course(
      title: i18nBook.college.mMode.t,
      status: LiveCourseStatus.Replay,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-28_13-44-40.png',
    ),
    Course(
      title: i18nBook.college.vocalVolumeCalculationAlgorithm.t,
      status: LiveCourseStatus.Replay,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-28_13-49-07.png',
    ),
    Course(
      title: i18nBook.college.xmiRemoteConnectionInstruction.t,
      status: LiveCourseStatus.Replay,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-28_13-51-38.png',
    ),
    Course(
      title: i18nBook
          .college.amasAutomaticMeasurementOfArterialStiffnessInWholeBody.t,
      status: LiveCourseStatus.NotStart,
      cover:
          'https://flyinsono-bj-1300984704.cos.ap-beijing.myqcloud.com/Snipaste_2023-04-28_13-54-35.png',
    ),
  ];
}

class Course {
  ///标题
  String? title;

  ////类型
  String? type;

  ///封面
  String? cover;

  ///是否可订阅
  bool isCanSubscribe;

  ///直播状态（仅直播课有这个状态）
  LiveCourseStatus? status;

  Course({
    this.isCanSubscribe = false,
    this.title,
    this.type,
    this.cover,
    this.status,
  });
}

class UserGroupList {
  List<UserGroupDTO>? userGroup;
  int? totalCount;
  UserGroupList({
    this.userGroup,
    this.totalCount,
  });
}

enum LiveCourseStatus {
  NotStart,
  Replay,
  Livestreaming,
}
