重构:🔥 基于阿里巴巴 Java 开发手册(黄山版)重构各表基本结构(简化列名)

1.MySQL数据库>建表规约>第9条:
【强制】表必备三字段:id,create_time,update_time。
说明:其中 id 必为主键,类型为 bigint unsigned、单表时自增、步长为 1。create_time,update_time 的类型均为datetime 类型,如果要记录时区信息,那么类型设置为 timestamp。
个人理解:简化列名的目的是为了后续能抽取更多公共能力
2.MySQL数据库>SQL语句>第10条:
【推荐】SQL 语句中表的别名前加 as,并且以 t1、t2、t3、...的顺序依次命名。
说明:
  1)别名可以是表的简称,或者是依照表在 SQL 语句中出现的顺序,以 t1、t2、t3 的方式命名。
  2)别名前加 as 使别名更容易识别。
正例:select t1.name from first_table as t1 , second_table as t2 where t1.id = t2.id;
This commit is contained in:
2023-03-06 00:09:11 +08:00
parent 4cd4ad1f82
commit 405c821e2a
61 changed files with 560 additions and 651 deletions

View File

@@ -36,7 +36,7 @@
<!-- 列表区域 -->
<a-table
ref="tableRef"
row-key="logId"
row-key="id"
:loading="loading"
:pagination="{
showTotal: true,
@@ -113,12 +113,14 @@
*/
const getList = (params: LoginLogParam = { ...queryParams.value }) => {
loading.value = true;
listLoginLog(params).then((res) => {
loginLogList.value = res.data.list;
total.value = res.data.total;
}).finally(() => {
loading.value = false;
});
listLoginLog(params)
.then((res) => {
loginLogList.value = res.data.list;
total.value = res.data.total;
})
.finally(() => {
loading.value = false;
});
};
getList();

View File

@@ -45,7 +45,7 @@
<!-- 列表区域 -->
<a-table
ref="tableRef"
row-key="logId"
row-key="id"
:loading="loading"
:pagination="{
showTotal: true,

View File

@@ -27,7 +27,7 @@
<!-- 列表区域 -->
<a-table
ref="tableRef"
row-key="logId"
row-key="id"
:loading="loading"
:pagination="{
showTotal: true,
@@ -74,7 +74,7 @@
<a-table-column title="创建时间" data-index="createTime" />
<a-table-column title="操作" align="center">
<template #cell="{ record }">
<a-button type="text" size="small" title="查看详情" @click="toDetail(record.logId)">
<a-button type="text" size="small" title="查看详情" @click="toDetail(record.id)">
<template #icon><icon-eye /></template>详情
</a-button>
<a-button v-if="record.exceptionDetail" type="text" size="small" title="查看异常详情" @click="toExceptionDetail(record)">
@@ -285,12 +285,14 @@
*/
const getList = (params: SystemLogParam = { ...queryParams.value }) => {
loading.value = true;
listSystemLog(params).then((res) => {
systemLogList.value = res.data.list;
total.value = res.data.total;
}).finally(() => {
loading.value = false;
});
listSystemLog(params)
.then((res) => {
systemLogList.value = res.data.list;
total.value = res.data.total;
})
.finally(() => {
loading.value = false;
});
};
getList();
@@ -302,11 +304,13 @@
const toDetail = async (id: string) => {
visible.value = true;
loading.value = true;
getSystemLog(id).then((res) => {
systemLog.value = res.data;
}).finally(() => {
loading.value = false;
});
getSystemLog(id)
.then((res) => {
systemLog.value = res.data;
})
.finally(() => {
loading.value = false;
});
};
/**
@@ -314,7 +318,7 @@
*/
const handleCancel = () => {
visible.value = false;
}
};
/**
* 查看异常详情
@@ -332,7 +336,7 @@
const handleExceptionDetailCancel = () => {
exceptionDetail.value = '';
exceptionDetailVisible.value = false;
}
};
/**
* 查询