Article.ts 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. import { IStudio } from "../auth/Studio";
  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 IArticleNavResponse {
  176. ok: boolean;
  177. data: IArticleNavData;
  178. message: string;
  179. }
  180. export interface IArticleNavData {
  181. curr?: IArticleMapRequest;
  182. prev?: IArticleMapRequest;
  183. next?: IArticleMapRequest;
  184. }
  185. export interface IPageNavResponse {
  186. ok: boolean;
  187. data: IPageNavData;
  188. message: string;
  189. }
  190. export interface IPageNavData {
  191. curr: IPageNavItem;
  192. prev: IPageNavItem;
  193. next: IPageNavItem;
  194. }
  195. export interface IPageNavItem {
  196. id: number;
  197. type: string;
  198. volume: number;
  199. page: number;
  200. book: number;
  201. paragraph: number;
  202. wid: number;
  203. pcd_book_id: number;
  204. created_at: string;
  205. updated_at: string;
  206. }
  207. export interface ICSParaNavResponse {
  208. ok: boolean;
  209. data: ICSParaNavData;
  210. message: string;
  211. }
  212. export interface ICSParaNavData {
  213. curr: ICSParaNavItem;
  214. prev?: ICSParaNavItem;
  215. next?: ICSParaNavItem;
  216. end: number;
  217. }
  218. export interface ICSParaNavItem {
  219. book: number;
  220. start: number;
  221. content: string;
  222. }