Course.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. import { IStudio } from "../auth/StudioName";
  2. import { IUser } from "../auth/User";
  3. import { IUserRequest, TRole } from "./Auth";
  4. export interface ICourseListApiResponse {
  5. article: string;
  6. title: string;
  7. level: string;
  8. children: number;
  9. }
  10. export interface ICourseDataRequest {
  11. id?: string; //课程ID
  12. title: string; //标题
  13. subtitle?: string; //副标题
  14. summary?: string; //副标题
  15. content?: string;
  16. cover?: string; //封面图片文件名
  17. teacher_id?: string; //UserID
  18. publicity: number; //类型-公开/内部
  19. anthology_id?: string; //文集ID
  20. channel_id?: string; //标准答案channel
  21. start_at?: string; //课程开始时间
  22. end_at?: string; //课程结束时间
  23. join: string;
  24. request_exp: string;
  25. }
  26. export type TCourseJoinMode = "invite" | "manual" | "open";
  27. export type TCourseExpRequest = "none" | "begin-end" | "daily";
  28. export interface ICourseDataResponse {
  29. id: string; //课程ID
  30. title: string; //标题
  31. subtitle: string; //副标题
  32. summary?: string; //副标题
  33. teacher?: IUser; //UserID
  34. course_count?: number; //课程数
  35. publicity: number; //类型-公开/内部
  36. anthology_id?: string; //文集ID
  37. anthology_title?: string; //文集标题
  38. anthology_owner?: IStudio; //文集拥有者
  39. channel_id: string; //标准答案ID
  40. channel_name?: string; //文集标题
  41. channel_owner?: IStudio; //文集拥有者
  42. start_at: string; //课程开始时间
  43. end_at: string; //课程结束时间
  44. content: string; //简介
  45. cover: string; //封面图片文件名
  46. member_count: number;
  47. join: TCourseJoinMode;
  48. request_exp: TCourseExpRequest;
  49. my_status: TCourseMemberStatus;
  50. count_progressing?: number;
  51. created_at: string; //创建时间
  52. updated_at: string; //修改时间
  53. }
  54. export interface ICourseResponse {
  55. ok: boolean;
  56. message: string;
  57. data: ICourseDataResponse;
  58. }
  59. export interface ICourseListResponse {
  60. ok: boolean;
  61. message: string;
  62. data: {
  63. rows: ICourseDataResponse[];
  64. count: number;
  65. };
  66. }
  67. export interface ICourseCreateRequest {
  68. title: string;
  69. lang: string;
  70. studio: string;
  71. }
  72. export interface IAnthologyCreateRequest {
  73. title: string;
  74. lang: string;
  75. studio: string;
  76. }
  77. export interface ICourseNumberResponse {
  78. ok: boolean;
  79. message: string;
  80. data: {
  81. create: number;
  82. teach: number;
  83. study: number;
  84. };
  85. }
  86. export type TCourseMemberStatus =
  87. | "normal"
  88. | "progressing"
  89. | "accepted"
  90. | "rejected"
  91. | "left"
  92. | "blocked";
  93. export interface ICourseMemberData {
  94. id?: string;
  95. user_id: string;
  96. course_id: string;
  97. channel_id?: string;
  98. role?: string;
  99. user?: IUserRequest;
  100. status?: TCourseMemberStatus;
  101. created_at?: string;
  102. updated_at?: string;
  103. }
  104. export interface ICourseMemberResponse {
  105. ok: boolean;
  106. message: string;
  107. data: ICourseMemberData;
  108. }
  109. export interface ICourseMemberListResponse {
  110. ok: boolean;
  111. message: string;
  112. data: {
  113. rows: ICourseMemberData[];
  114. role: TRole;
  115. count: number;
  116. };
  117. }
  118. export interface ICourseMemberDeleteResponse {
  119. ok: boolean;
  120. message: string;
  121. data: boolean;
  122. }
  123. export interface ICourseCurrUserResponse {
  124. ok: boolean;
  125. message: string;
  126. data: {
  127. role: string;
  128. channel_id: string;
  129. };
  130. }
  131. export interface IExerciseListData {
  132. user: IUser;
  133. wbw: number;
  134. translation: number;
  135. question: number;
  136. html: string;
  137. }
  138. export interface ICourseExerciseResponse {
  139. ok: boolean;
  140. message: string;
  141. data: {
  142. rows: IExerciseListData[];
  143. count: number;
  144. };
  145. }