Article.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. import { IStudio } from "../auth/StudioName";
  2. import { IUser } from "../auth/User";
  3. import { ITocPathNode } from "../corpus/TocPath";
  4. import type { IStudioApiResponse, TRole } from "./Auth";
  5. export interface IArticleListApiResponse {
  6. article: string;
  7. title: string;
  8. level: string;
  9. children: number;
  10. }
  11. export interface IAnthologyDataRequest {
  12. title: string;
  13. subtitle: string;
  14. summary?: string;
  15. article_list?: IArticleListApiResponse[];
  16. lang: string;
  17. status: number;
  18. }
  19. export interface IAnthologyDataResponse {
  20. uid: string;
  21. title: string;
  22. subtitle: string;
  23. summary: string;
  24. article_list: IArticleListApiResponse[];
  25. studio: IStudioApiResponse;
  26. lang: string;
  27. status: number;
  28. childrenNumber: number;
  29. created_at: string;
  30. updated_at: string;
  31. }
  32. export interface IAnthologyResponse {
  33. ok: boolean;
  34. message: string;
  35. data: IAnthologyDataResponse;
  36. }
  37. export interface IAnthologyListResponse {
  38. ok: boolean;
  39. message: string;
  40. data: {
  41. rows: IAnthologyDataResponse[];
  42. count: number;
  43. };
  44. }
  45. export interface IAnthologyStudioListApiResponse {
  46. ok: boolean;
  47. message: string;
  48. data: {
  49. count: number;
  50. rows: IAnthologyStudioListDataApiResponse[];
  51. };
  52. }
  53. export interface IAnthologyStudioListDataApiResponse {
  54. count: number;
  55. studio: IStudioApiResponse;
  56. }
  57. export interface IArticleDataRequest {
  58. uid: string;
  59. title: string;
  60. subtitle: string;
  61. summary?: string | null;
  62. content?: string;
  63. content_type?: string;
  64. status: number;
  65. lang: string;
  66. }
  67. export interface IChapterToc {
  68. key?: string;
  69. book: number;
  70. paragraph: number;
  71. level: number;
  72. pali_title: string /**巴利文标题 */;
  73. title?: string /**译文文标题 */;
  74. progress?: number[];
  75. }
  76. export interface IArticleDataResponse {
  77. uid: string;
  78. title: string;
  79. subtitle: string;
  80. summary: string | null;
  81. _summary?: string;
  82. content?: string;
  83. content_type?: string;
  84. toc?: IChapterToc[];
  85. html?: string;
  86. path?: ITocPathNode[];
  87. status: number;
  88. lang: string;
  89. anthology_count?: number;
  90. anthology_first?: { uid: string; title: string };
  91. role?: TRole;
  92. studio?: IStudio;
  93. editor?: IUser;
  94. created_at: string;
  95. updated_at: string;
  96. from?: number;
  97. to?: number;
  98. mode?: string;
  99. paraId?: string;
  100. parent_uid?: string;
  101. channels?: string;
  102. }
  103. export interface IArticleResponse {
  104. ok: boolean;
  105. message: string;
  106. data: IArticleDataResponse;
  107. }
  108. export interface IArticleListResponse {
  109. ok: boolean;
  110. message: string;
  111. data: {
  112. rows: IArticleDataResponse[];
  113. count: number;
  114. };
  115. }
  116. export interface IArticleCreateRequest {
  117. title: string;
  118. lang: string;
  119. studio: string;
  120. anthologyId?: string;
  121. parentId?: string;
  122. }
  123. export interface IAnthologyCreateRequest {
  124. title: string;
  125. lang: string;
  126. studio: string;
  127. }
  128. export interface IArticleMapRequest {
  129. id?: string;
  130. collect_id?: string;
  131. article_id?: string;
  132. level: number;
  133. title: string;
  134. editor?: IUser;
  135. children?: number;
  136. deleted_at?: string | null;
  137. created_at?: string;
  138. updated_at?: string;
  139. }
  140. export interface IArticleMapListResponse {
  141. ok: boolean;
  142. message: string;
  143. data: {
  144. rows: IArticleMapRequest[];
  145. count: number;
  146. };
  147. }
  148. export interface IArticleMapAddRequest {
  149. anthology_id: string;
  150. article_id: string[];
  151. operation: string;
  152. }
  153. export interface IArticleMapUpdateRequest {
  154. data: IArticleMapRequest[];
  155. operation: string;
  156. }
  157. export interface IArticleMapAddResponse {
  158. ok: boolean;
  159. message: string;
  160. data: number;
  161. }
  162. export interface IDeleteResponse {
  163. ok: boolean;
  164. message: string;
  165. data: number;
  166. }