Article.ts 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. import type { IStudio } from "../auth/Studio"
  2. import type { IUser } from "../auth/User"
  3. import type { IChannel } from "../channel/Channel"
  4. import type { 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: IStudio;
  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. status?: number;
  129. }
  130. export interface IAnthologyCreateRequest {
  131. title: string;
  132. lang: string;
  133. studio: string;
  134. }
  135. export interface IArticleMapRequest {
  136. id?: string;
  137. collect_id?: string;
  138. collection?: { id: string; title: string };
  139. article_id?: string;
  140. level: number;
  141. title: string;
  142. title_text?: string;
  143. editor?: IUser;
  144. children?: number;
  145. status?: number;
  146. deleted_at?: string | null;
  147. created_at?: string;
  148. updated_at?: string;
  149. }
  150. export interface IArticleMapListResponse {
  151. ok: boolean;
  152. message: string;
  153. data: {
  154. rows: IArticleMapRequest[];
  155. count: number;
  156. };
  157. }
  158. export interface IArticleMapAddRequest {
  159. anthology_id: string;
  160. article_id: string[];
  161. operation: string;
  162. }
  163. export interface IArticleMapUpdateRequest {
  164. data: IArticleMapRequest[];
  165. operation: string;
  166. }
  167. export interface IArticleMapAddResponse {
  168. ok: boolean;
  169. message: string;
  170. data: number;
  171. }
  172. export interface IDeleteResponse {
  173. ok: boolean;
  174. message: string;
  175. data: number;
  176. }
  177. export interface IArticleNavResponse {
  178. ok: boolean;
  179. data: IArticleNavData;
  180. message: string;
  181. }
  182. export interface IArticleNavData {
  183. curr?: IArticleMapRequest;
  184. prev?: IArticleMapRequest;
  185. next?: IArticleMapRequest;
  186. }
  187. export interface IPageNavResponse {
  188. ok: boolean;
  189. data: IPageNavData;
  190. message: string;
  191. }
  192. export interface IPageNavData {
  193. curr: IPageNavItem;
  194. prev: IPageNavItem;
  195. next: IPageNavItem;
  196. }
  197. export interface IPageNavItem {
  198. id: number;
  199. type: string;
  200. volume: number;
  201. page: number;
  202. book: number;
  203. paragraph: number;
  204. wid: number;
  205. pcd_book_id: number;
  206. created_at: string;
  207. updated_at: string;
  208. }
  209. export interface ICSParaNavResponse {
  210. ok: boolean;
  211. data: ICSParaNavData;
  212. message: string;
  213. }
  214. export interface ICSParaNavData {
  215. curr: ICSParaNavItem;
  216. prev?: ICSParaNavItem;
  217. next?: ICSParaNavItem;
  218. end: number;
  219. }
  220. export interface ICSParaNavItem {
  221. book: number;
  222. start: number;
  223. content: string;
  224. }
  225. export interface IArticleFtsListResponse {
  226. ok: boolean;
  227. message: string;
  228. data: {
  229. rows: IArticleDataResponse[];
  230. page: { size: number; current: number; total: number };
  231. };
  232. }