Commit 7b40e5a5e427add46cf94b3b4ed0b258d114bbf0

Authored by xingyu4j
1 parent 92bcaa04

refactor: api type

yudao-ui-admin-vue3/src/api/infra/config/index.ts
1 1 import request from '@/config/axios'
2 2  
3   -export type ConfigVO = {
  3 +export interface ConfigVO {
4 4 id: number
5 5 group: string
6 6 name: string
... ...
yudao-ui-admin-vue3/src/api/infra/dataSourceConfig/index.ts
1 1 import request from '@/config/axios'
2 2  
3   -export type DataSourceConfigVO = {
  3 +export interface DataSourceConfigVO {
4 4 id: number
5 5 name: string
6 6 url: string
... ...
yudao-ui-admin-vue3/src/api/infra/dataSourceConfig/types.ts deleted
1   -export type DataSourceConfigVO = {
2   - id: number
3   - name: string
4   - url: string
5   - username: string
6   - password: string
7   - createTime: string
8   -}
yudao-ui-admin-vue3/src/api/infra/fileConfig/index.ts
1 1 import request from '@/config/axios'
2   -import type { FileConfigVO } from './types'
  2 +
  3 +export interface ConfigType {
  4 + basePath: string
  5 + host: string
  6 + port: string
  7 + username: string
  8 + password: string
  9 + mode: string
  10 + endpoint: string
  11 + bucket: string
  12 + accessKey: string
  13 + accessSecret: string
  14 + domain: string
  15 +}
  16 +export interface FileConfigVO {
  17 + id: number
  18 + name: string
  19 + storage: string
  20 + master: boolean
  21 + visible: boolean
  22 + config: ConfigType
  23 + remark: string
  24 + createTime: string
  25 +}
3 26  
4 27 // 查询文件配置列表
5 28 export const getFileConfigPageApi = (params) => {
... ...
yudao-ui-admin-vue3/src/api/infra/fileConfig/types.ts deleted
1   -export type ConfigType = {
2   - basePath: string
3   - host: string
4   - port: string
5   - username: string
6   - password: string
7   - mode: string
8   - endpoint: string
9   - bucket: string
10   - accessKey: string
11   - accessSecret: string
12   - domain: string
13   -}
14   -export type FileConfigVO = {
15   - id: number
16   - name: string
17   - storage: string
18   - master: boolean
19   - visible: boolean
20   - config: ConfigType
21   - remark: string
22   - createTime: string
23   -}
yudao-ui-admin-vue3/src/api/infra/fileList/index.ts
1 1 import request from '@/config/axios'
2 2  
3   -export type FileVO = {
  3 +export interface FileVO {
4 4 id: number
5 5 path: string
6 6 url: string
... ...
yudao-ui-admin-vue3/src/api/infra/job/index.ts
1 1 import request from '@/config/axios'
2 2  
3   -export type JobVO = {
  3 +export interface JobVO {
4 4 id: number
5 5 name: string
6 6 status: number
... ...
yudao-ui-admin-vue3/src/api/infra/job/types.ts deleted
1   -export type JobVO = {
2   - id: number
3   - name: string
4   - status: number
5   - handlerName: string
6   - handlerParam: string
7   - cronExpression: string
8   - retryCount: number
9   - retryInterval: number
10   - monitorTimeout: number
11   -}
yudao-ui-admin-vue3/src/api/infra/jobLog/index.ts
1 1 import request from '@/config/axios'
2 2  
3   -export type JobLogVO = {
  3 +export interface JobLogVO {
4 4 id: number
5 5 jobId: number
6 6 handlerName: string
... ...
yudao-ui-admin-vue3/src/api/infra/jobLog/types.ts deleted
1   -export type JobLogVO = {
2   - id: number
3   - jobId: number
4   - handlerName: string
5   - handlerParam: string
6   - cronExpression: string
7   - executeIndex: string
8   - beginTime: Date
9   - endTime: Date
10   - duration: string
11   - status: number
12   - createTime: string
13   -}
yudao-ui-admin-vue3/src/api/system/dept/index.ts
1 1 import request from '@/config/axios'
2   -export type DeptVO = {
  2 +
  3 +export interface DeptVO {
3 4 id?: number
4 5 name: string
5 6 parentId: number
... ...
yudao-ui-admin-vue3/src/api/system/dept/types.ts deleted
1   -export type DeptVO = {
2   - id: number
3   - name: string
4   - parentId: number
5   - status: number
6   - sort: number
7   - leaderUserId: number
8   - phone: string
9   - email: string
10   -}
11   -
12   -export type DeptListReqVO = {
13   - name: string
14   - status: number
15   -}
yudao-ui-admin-vue3/src/api/system/errorCode/index.ts
1 1 import request from '@/config/axios'
  2 +
2 3 export interface ErrorCodeVO {
3 4 id: number
4 5 type: number
... ...
yudao-ui-admin-vue3/src/api/system/notice/index.ts
1 1 import request from '@/config/axios'
  2 +
2 3 export interface NoticeVO {
3 4 id: number
4 5 title: string
... ...
yudao-ui-admin-vue3/src/api/system/oauth2/client.ts
1 1 import request from '@/config/axios'
  2 +
2 3 export interface OAuth2ClientVO {
3 4 id: number
4 5 clientId: string
... ...
yudao-ui-admin-vue3/src/api/system/operatelog/index.ts
... ... @@ -22,6 +22,7 @@ export type OperateLogVO = {
22 22 resultMsg: string
23 23 resultData: string
24 24 }
  25 +
25 26 export interface OperateLogPageReqVO extends PageParam {
26 27 module?: string
27 28 userNickname?: string
... ...
yudao-ui-admin-vue3/src/api/system/role/index.ts
1 1 import request from '@/config/axios'
2 2  
3   -export type RoleVO = {
  3 +export interface RoleVO {
4 4 id: number
5 5 name: string
6 6 code: string
... ...
yudao-ui-admin-vue3/src/api/system/sensitiveWord/index.ts
1 1 import request from '@/config/axios'
2 2  
3   -export type SensitiveWordVO = {
  3 +export interface SensitiveWordVO {
4 4 id: number
5 5 name: string
6 6 status: number
... ...
yudao-ui-admin-vue3/src/api/system/sms/smsChannel/index.ts
1 1 import request from '@/config/axios'
2   -export type SmsChannelVO = {
  2 +
  3 +export interface SmsChannelVO {
3 4 id: number
4 5 status: number
5 6 signature: string
... ...
yudao-ui-admin-vue3/src/api/system/sms/smsLog/index.ts
1 1 import request from '@/config/axios'
2   -export type SmsLogVO = {
  2 +
  3 +export interface SmsLogVO {
3 4 id: number
4 5 idchannelId: number
5 6 templateId: number
... ...
yudao-ui-admin-vue3/src/api/system/sms/smsTemplate/index.ts
1 1 import request from '@/config/axios'
2   -export type SmsTemplateVO = {
  2 +
  3 +export interface SmsTemplateVO {
3 4 id: number
4 5 type: number
5 6 status: number
... ...
yudao-ui-admin-vue3/src/api/system/user/index.ts
1 1 import request from '@/config/axios'
2   -export type UserVO = {
  2 +
  3 +export interface UserVO {
3 4 id: number
4 5 username: string
5 6 nickname: string
... ...
yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue
... ... @@ -86,14 +86,13 @@ import { VxeGridInstance } from 'vxe-table'
86 86 import { FormExpose } from '@/components/Form'
87 87 // 业务相关的 import
88 88 import * as FileConfigApi from '@/api/infra/fileConfig'
89   -import type { FileConfigVO } from '@/api/infra/fileConfig/types'
90 89 import { rules, allSchemas } from './fileConfig.data'
91 90  
92 91 const { t } = useI18n() // 国际化
93 92 const message = useMessage() // 消息弹窗
94 93 // 列表相关的变量
95 94 const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
96   -const { gridOptions, getList, deleteData } = useVxeGrid<FileConfigVO>({
  95 +const { gridOptions, getList, deleteData } = useVxeGrid<FileConfigApi.FileConfigVO>({
97 96 allSchemas: allSchemas,
98 97 getListApi: FileConfigApi.getFileConfigPageApi,
99 98 deleteApi: FileConfigApi.deleteFileConfigApi
... ... @@ -135,7 +134,7 @@ const handleDetail = async (rowId: number) =&gt; {
135 134 }
136 135  
137 136 // 主配置操作
138   -const handleMaster = (row: FileConfigVO) => {
  137 +const handleMaster = (row: FileConfigApi.FileConfigVO) => {
139 138 message
140 139 .confirm('是否确认修改配置【 ' + row.name + ' 】为主配置?', t('common.reminder'))
141 140 .then(async () => {
... ... @@ -158,7 +157,7 @@ const submitForm = async () =&gt; {
158 157 actionLoading.value = true
159 158 // 提交请求
160 159 try {
161   - const data = unref(formRef)?.formModel as FileConfigVO
  160 + const data = unref(formRef)?.formModel as FileConfigApi.FileConfigVO
162 161 if (actionType.value === 'create') {
163 162 await FileConfigApi.createFileConfigApi(data)
164 163 message.success(t('common.createSuccess'))
... ...
yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue
... ... @@ -55,7 +55,6 @@ import { useI18n } from &#39;@/hooks/web/useI18n&#39;
55 55 import { useVxeGrid } from '@/hooks/web/useVxeGrid'
56 56 import { VxeGridInstance } from 'vxe-table'
57 57 import * as JobLogApi from '@/api/infra/jobLog'
58   -import { JobLogVO } from '@/api/infra/jobLog/types'
59 58 import { allSchemas } from './jobLog.data'
60 59  
61 60 const { t } = useI18n() // 国际化
... ... @@ -74,7 +73,7 @@ const dialogTitle = ref(&#39;&#39;) // 弹出层标题
74 73 const detailRef = ref() // 详情 Ref
75 74  
76 75 // 详情操作
77   -const handleDetail = async (row: JobLogVO) => {
  76 +const handleDetail = async (row: JobLogApi.JobLogVO) => {
78 77 // 设置数据
79 78 const res = JobLogApi.getJobLogApi(row.id)
80 79 detailRef.value = res
... ...