Commit 7b40e5a5e427add46cf94b3b4ed0b258d114bbf0

Authored by xingyu4j
1 parent 92bcaa04

refactor: api type

yudao-ui-admin-vue3/src/api/infra/config/index.ts
1 import request from '@/config/axios' 1 import request from '@/config/axios'
2 2
3 -export type ConfigVO = { 3 +export interface ConfigVO {
4 id: number 4 id: number
5 group: string 5 group: string
6 name: string 6 name: string
yudao-ui-admin-vue3/src/api/infra/dataSourceConfig/index.ts
1 import request from '@/config/axios' 1 import request from '@/config/axios'
2 2
3 -export type DataSourceConfigVO = { 3 +export interface DataSourceConfigVO {
4 id: number 4 id: number
5 name: string 5 name: string
6 url: string 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 import request from '@/config/axios' 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 export const getFileConfigPageApi = (params) => { 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 import request from '@/config/axios' 1 import request from '@/config/axios'
2 2
3 -export type FileVO = { 3 +export interface FileVO {
4 id: number 4 id: number
5 path: string 5 path: string
6 url: string 6 url: string
yudao-ui-admin-vue3/src/api/infra/job/index.ts
1 import request from '@/config/axios' 1 import request from '@/config/axios'
2 2
3 -export type JobVO = { 3 +export interface JobVO {
4 id: number 4 id: number
5 name: string 5 name: string
6 status: number 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 import request from '@/config/axios' 1 import request from '@/config/axios'
2 2
3 -export type JobLogVO = { 3 +export interface JobLogVO {
4 id: number 4 id: number
5 jobId: number 5 jobId: number
6 handlerName: string 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 import request from '@/config/axios' 1 import request from '@/config/axios'
2 -export type DeptVO = { 2 +
  3 +export interface DeptVO {
3 id?: number 4 id?: number
4 name: string 5 name: string
5 parentId: number 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 import request from '@/config/axios' 1 import request from '@/config/axios'
  2 +
2 export interface ErrorCodeVO { 3 export interface ErrorCodeVO {
3 id: number 4 id: number
4 type: number 5 type: number
yudao-ui-admin-vue3/src/api/system/notice/index.ts
1 import request from '@/config/axios' 1 import request from '@/config/axios'
  2 +
2 export interface NoticeVO { 3 export interface NoticeVO {
3 id: number 4 id: number
4 title: string 5 title: string
yudao-ui-admin-vue3/src/api/system/oauth2/client.ts
1 import request from '@/config/axios' 1 import request from '@/config/axios'
  2 +
2 export interface OAuth2ClientVO { 3 export interface OAuth2ClientVO {
3 id: number 4 id: number
4 clientId: string 5 clientId: string
yudao-ui-admin-vue3/src/api/system/operatelog/index.ts
@@ -22,6 +22,7 @@ export type OperateLogVO = { @@ -22,6 +22,7 @@ export type OperateLogVO = {
22 resultMsg: string 22 resultMsg: string
23 resultData: string 23 resultData: string
24 } 24 }
  25 +
25 export interface OperateLogPageReqVO extends PageParam { 26 export interface OperateLogPageReqVO extends PageParam {
26 module?: string 27 module?: string
27 userNickname?: string 28 userNickname?: string
yudao-ui-admin-vue3/src/api/system/role/index.ts
1 import request from '@/config/axios' 1 import request from '@/config/axios'
2 2
3 -export type RoleVO = { 3 +export interface RoleVO {
4 id: number 4 id: number
5 name: string 5 name: string
6 code: string 6 code: string
yudao-ui-admin-vue3/src/api/system/sensitiveWord/index.ts
1 import request from '@/config/axios' 1 import request from '@/config/axios'
2 2
3 -export type SensitiveWordVO = { 3 +export interface SensitiveWordVO {
4 id: number 4 id: number
5 name: string 5 name: string
6 status: number 6 status: number
yudao-ui-admin-vue3/src/api/system/sms/smsChannel/index.ts
1 import request from '@/config/axios' 1 import request from '@/config/axios'
2 -export type SmsChannelVO = { 2 +
  3 +export interface SmsChannelVO {
3 id: number 4 id: number
4 status: number 5 status: number
5 signature: string 6 signature: string
yudao-ui-admin-vue3/src/api/system/sms/smsLog/index.ts
1 import request from '@/config/axios' 1 import request from '@/config/axios'
2 -export type SmsLogVO = { 2 +
  3 +export interface SmsLogVO {
3 id: number 4 id: number
4 idchannelId: number 5 idchannelId: number
5 templateId: number 6 templateId: number
yudao-ui-admin-vue3/src/api/system/sms/smsTemplate/index.ts
1 import request from '@/config/axios' 1 import request from '@/config/axios'
2 -export type SmsTemplateVO = { 2 +
  3 +export interface SmsTemplateVO {
3 id: number 4 id: number
4 type: number 5 type: number
5 status: number 6 status: number
yudao-ui-admin-vue3/src/api/system/user/index.ts
1 import request from '@/config/axios' 1 import request from '@/config/axios'
2 -export type UserVO = { 2 +
  3 +export interface UserVO {
3 id: number 4 id: number
4 username: string 5 username: string
5 nickname: string 6 nickname: string
yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue
@@ -86,14 +86,13 @@ import { VxeGridInstance } from 'vxe-table' @@ -86,14 +86,13 @@ import { VxeGridInstance } from 'vxe-table'
86 import { FormExpose } from '@/components/Form' 86 import { FormExpose } from '@/components/Form'
87 // 业务相关的 import 87 // 业务相关的 import
88 import * as FileConfigApi from '@/api/infra/fileConfig' 88 import * as FileConfigApi from '@/api/infra/fileConfig'
89 -import type { FileConfigVO } from '@/api/infra/fileConfig/types'  
90 import { rules, allSchemas } from './fileConfig.data' 89 import { rules, allSchemas } from './fileConfig.data'
91 90
92 const { t } = useI18n() // 国际化 91 const { t } = useI18n() // 国际化
93 const message = useMessage() // 消息弹窗 92 const message = useMessage() // 消息弹窗
94 // 列表相关的变量 93 // 列表相关的变量
95 const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref 94 const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
96 -const { gridOptions, getList, deleteData } = useVxeGrid<FileConfigVO>({ 95 +const { gridOptions, getList, deleteData } = useVxeGrid<FileConfigApi.FileConfigVO>({
97 allSchemas: allSchemas, 96 allSchemas: allSchemas,
98 getListApi: FileConfigApi.getFileConfigPageApi, 97 getListApi: FileConfigApi.getFileConfigPageApi,
99 deleteApi: FileConfigApi.deleteFileConfigApi 98 deleteApi: FileConfigApi.deleteFileConfigApi
@@ -135,7 +134,7 @@ const handleDetail = async (rowId: number) =&gt; { @@ -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 message 138 message
140 .confirm('是否确认修改配置【 ' + row.name + ' 】为主配置?', t('common.reminder')) 139 .confirm('是否确认修改配置【 ' + row.name + ' 】为主配置?', t('common.reminder'))
141 .then(async () => { 140 .then(async () => {
@@ -158,7 +157,7 @@ const submitForm = async () =&gt; { @@ -158,7 +157,7 @@ const submitForm = async () =&gt; {
158 actionLoading.value = true 157 actionLoading.value = true
159 // 提交请求 158 // 提交请求
160 try { 159 try {
161 - const data = unref(formRef)?.formModel as FileConfigVO 160 + const data = unref(formRef)?.formModel as FileConfigApi.FileConfigVO
162 if (actionType.value === 'create') { 161 if (actionType.value === 'create') {
163 await FileConfigApi.createFileConfigApi(data) 162 await FileConfigApi.createFileConfigApi(data)
164 message.success(t('common.createSuccess')) 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,7 +55,6 @@ import { useI18n } from &#39;@/hooks/web/useI18n&#39;
55 import { useVxeGrid } from '@/hooks/web/useVxeGrid' 55 import { useVxeGrid } from '@/hooks/web/useVxeGrid'
56 import { VxeGridInstance } from 'vxe-table' 56 import { VxeGridInstance } from 'vxe-table'
57 import * as JobLogApi from '@/api/infra/jobLog' 57 import * as JobLogApi from '@/api/infra/jobLog'
58 -import { JobLogVO } from '@/api/infra/jobLog/types'  
59 import { allSchemas } from './jobLog.data' 58 import { allSchemas } from './jobLog.data'
60 59
61 const { t } = useI18n() // 国际化 60 const { t } = useI18n() // 国际化
@@ -74,7 +73,7 @@ const dialogTitle = ref(&#39;&#39;) // 弹出层标题 @@ -74,7 +73,7 @@ const dialogTitle = ref(&#39;&#39;) // 弹出层标题
74 const detailRef = ref() // 详情 Ref 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 const res = JobLogApi.getJobLogApi(row.id) 78 const res = JobLogApi.getJobLogApi(row.id)
80 detailRef.value = res 79 detailRef.value = res