Article.ts 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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;
  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;
  81. content?: string;
  82. content_type?: string;
  83. toc?: IChapterToc[];
  84. html?: string;
  85. path?: ITocPathNode[];
  86. status: number;
  87. lang: string;
  88. anthology_count?: number;
  89. anthology_first?: { uid: string; title: string };
  90. role?: TRole;
  91. studio?: IStudio;
  92. editor?: IUser;
  93. created_at: string;
  94. updated_at: string;
  95. from?: number;
  96. to?: number;
  97. mode?: string;
  98. paraId?: string;
  99. channels?: string;
  100. }
  101. export interface IArticleResponse {
  102. ok: boolean;
  103. message: string;
  104. data: IArticleDataResponse;
  105. }
  106. export interface IArticleListResponse {
  107. ok: boolean;
  108. message: string;
  109. data: {
  110. rows: IArticleDataResponse[];
  111. count: number;
  112. };
  113. }
  114. export interface IArticleCreateRequest {
  115. title: string;
  116. lang: string;
  117. studio: string;
  118. }
  119. export interface IAnthologyCreateRequest {
  120. title: string;
  121. lang: string;
  122. studio: string;
  123. }
  124. export interface IArticleMapRequest {
  125. id?: string;
  126. collect_id?: string;
  127. article_id?: string;
  128. level: number;
  129. title: string;
  130. children?: number;
  131. deleted_at?: string;
  132. }
  133. export interface IArticleMapListResponse {
  134. ok: boolean;
  135. message: string;
  136. data: {
  137. rows: IArticleMapRequest[];
  138. count: number;
  139. };
  140. }
  141. export interface IArticleMapAddRequest {
  142. anthology_id: string;
  143. article_id: string[];
  144. operation: string;
  145. }
  146. export interface IArticleMapUpdateRequest {
  147. data: IArticleMapRequest[];
  148. operation: string;
  149. }
  150. export interface IArticleMapAddResponse {
  151. ok: boolean;
  152. message: string;
  153. data: number;
  154. }
  155. export interface IDeleteResponse {
  156. ok: boolean;
  157. message: string;
  158. data: number;
  159. }