Comment.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import type { IUser } from "../auth/User"
  2. import type { TDiscussionType } from "../discussion/Discussion"
  3. import type { TContentType } from "../discussion/DiscussionCreate"
  4. import type { TResType } from "../discussion/DiscussionListCard"
  5. import type { ITagMapData } from "./Tag"
  6. export interface ICommentRequest {
  7. id?: string;
  8. res_id?: string;
  9. res_type?: string;
  10. type?: TDiscussionType;
  11. title?: string;
  12. content?: string;
  13. content_type?: TContentType;
  14. parent?: string;
  15. topicId?: string;
  16. tpl_id?: string;
  17. status?: "active" | "close";
  18. editor?: IUser;
  19. created_at?: string;
  20. updated_at?: string;
  21. }
  22. export interface ICommentApiData {
  23. id: string;
  24. res_id: string;
  25. res_type: TResType;
  26. type: TDiscussionType;
  27. title?: string;
  28. content?: string;
  29. content_type?: TContentType;
  30. html?: string;
  31. summary?: string;
  32. parent?: string;
  33. tpl_id?: string;
  34. status?: "active" | "close";
  35. children_count?: number;
  36. editor: IUser;
  37. created_at?: string;
  38. updated_at?: string;
  39. }
  40. export interface ICommentResponse {
  41. ok: boolean;
  42. message: string;
  43. data: ICommentApiData;
  44. }
  45. export interface ICommentListResponse {
  46. ok: boolean;
  47. message: string;
  48. data: {
  49. rows: ICommentApiData[];
  50. count: number;
  51. active: number;
  52. close: number;
  53. can_create: boolean;
  54. can_reply: boolean;
  55. };
  56. }
  57. export interface ICommentAnchorResponse {
  58. ok: boolean;
  59. message: string;
  60. data: string;
  61. }
  62. export interface IDiscussionCountRequest {
  63. course_id?: string | null;
  64. sentences: string[][];
  65. }
  66. export interface IDiscussionCountWbw {
  67. book_id: number;
  68. paragraph: number;
  69. wid: number;
  70. }
  71. export interface IDiscussionCountData {
  72. id: string;
  73. res_id: string;
  74. type: string;
  75. editor_uid: string;
  76. wbw?: IDiscussionCountWbw;
  77. }
  78. export interface IDiscussionCountResponse {
  79. ok: boolean;
  80. message: string;
  81. data: { discussions: IDiscussionCountData[]; tags: ITagMapData[] };
  82. }