Comment.ts 1.8 KB

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