Dict.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. import type { IStudio } from "../auth/Studio"
  2. import type { IUser } from "../auth/User"
  3. import type { ICaseListData } from "../dict/CaseList"
  4. export interface IDictRequest {
  5. id?: number;
  6. word: string;
  7. type?: string | null;
  8. grammar?: string | null;
  9. mean?: string | null;
  10. parent?: string | null;
  11. parent2?: string | null;
  12. note?: string | null;
  13. factors?: string | null;
  14. factormean?: string | null;
  15. confidence: number;
  16. dict_id?: string;
  17. dict_name?: string;
  18. language?: string;
  19. creator_id?: number;
  20. editor?: IUser;
  21. studio?: IStudio;
  22. status?: number;
  23. updated_at?: string;
  24. }
  25. export interface IUserDictCreate {
  26. data: string;
  27. view: string;
  28. }
  29. export interface IDictResponse {
  30. ok: boolean;
  31. message: string;
  32. data: number[];
  33. }
  34. export interface IDictInfo {
  35. id: string;
  36. name: string;
  37. shortname: string;
  38. }
  39. export interface IApiResponseDictData {
  40. id: string;
  41. sn?: number;
  42. word: string;
  43. type?: string | null;
  44. grammar?: string | null;
  45. mean?: string | null;
  46. parent?: string | null;
  47. note?: string | null;
  48. factors?: string | null;
  49. factormean?: string | null;
  50. source: string | null;
  51. language: string;
  52. dict?: IDictInfo;
  53. dict_id: string;
  54. dict_name?: string;
  55. dict_shortname?: string;
  56. shortname?: string;
  57. confidence: number;
  58. creator_id: number;
  59. updated_at: string;
  60. exp?: number;
  61. editor?: IUser;
  62. status?: number;
  63. count?: number;
  64. created_at?: string;
  65. }
  66. export interface IApiResponseDict {
  67. ok: boolean;
  68. message: string;
  69. data: IApiResponseDictData;
  70. }
  71. export interface IApiResponseDictList {
  72. ok: boolean;
  73. message: string;
  74. data: {
  75. rows: IApiResponseDictData[];
  76. count: number;
  77. time?: number;
  78. };
  79. }
  80. export interface IVocabularyData {
  81. word: string;
  82. count: number;
  83. meaning?: string;
  84. strlen: number;
  85. }
  86. export interface IVocabularyListResponse {
  87. ok: boolean;
  88. message: string;
  89. data: {
  90. rows: IVocabularyData[];
  91. count: number;
  92. };
  93. }
  94. export interface IUserDictDeleteRequest {
  95. id: string;
  96. }
  97. export interface ICaseItem {
  98. word: string;
  99. case: ICaseListData[];
  100. count: number;
  101. }
  102. export interface ICaseListResponse {
  103. ok: boolean;
  104. message: string;
  105. data: {
  106. rows: ICaseItem[];
  107. count: number;
  108. };
  109. }
  110. export interface IFirstMeaning {
  111. word?: string;
  112. meaning?: string;
  113. }
  114. export interface IDictFirstMeaningResponse {
  115. ok: boolean;
  116. message: string;
  117. data: IFirstMeaning[];
  118. }
  119. export interface IPreferenceListResponse {
  120. ok: boolean;
  121. message: string;
  122. data: { rows: IApiResponseDictData[]; count: number };
  123. }
  124. export interface IPreferenceRequest {
  125. id?: string;
  126. word?: string;
  127. factors?: string | null;
  128. parent?: string | null;
  129. confidence?: number;
  130. }
  131. export interface IPreferenceResponse {
  132. ok: boolean;
  133. message: string;
  134. data: IApiResponseDictData;
  135. }