ソースを参照

feat: 增加请求响应数据类型文件

lanjianrong 4 年 前
コミット
5c82e98391
2 ファイル変更33 行追加0 行削除
  1. 11 0
      src/pages/Customer/Email/index.tsx
  2. 22 0
      src/services/typding.d.ts

+ 11 - 0
src/pages/Customer/Email/index.tsx

@@ -0,0 +1,11 @@
+import { PageContainer } from '@ant-design/pro-layout'
+
+const Email = () => {
+  return (
+    <PageContainer title={false} breadcrumb={false}>
+      111
+    </PageContainer>
+  )
+}
+
+export default Email

+ 22 - 0
src/services/typding.d.ts

@@ -0,0 +1,22 @@
+/** API请求类型定义 */
+// 格式: MenuRoleList:MenuRoleItem[] 所有参数需带上 可选符-?
+// UpdateParams(add/update/delete): MenuRoleParams: { id?: string, ....}
+// 新增:剔除id Omit<MenuRoleParams, 'id' | ...>   删除: {id: string}
+declare namespace API {
+  /** @description Basic Params */
+  type PageParams = {
+    current?: number
+    pageSize?: number
+  }
+
+  /** @description Request泛型-基础请求 */
+  type BasicFetchResult<T extends any> = {
+    data: T
+  }
+
+  /** @description Request泛型-列表请求 */
+  type BasicFetchListResult<T extends any> = {
+    list: T[]
+    total: number
+  }
+}