Article.ts 4.1 KB

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