执行历史关联数据源,执行时长和影响条数展示
This commit is contained in:
@@ -23,6 +23,11 @@ public class DbHistory implements Serializable {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 数据源ID
|
||||
*/
|
||||
private Long datasourceId;
|
||||
|
||||
/**
|
||||
* sql内容
|
||||
*/
|
||||
@@ -102,4 +107,12 @@ public class DbHistory implements Serializable {
|
||||
", yn=" + yn +
|
||||
"}";
|
||||
}
|
||||
|
||||
public Long getDatasourceId() {
|
||||
return datasourceId;
|
||||
}
|
||||
|
||||
public void setDatasourceId(Long datasourceId) {
|
||||
this.datasourceId = datasourceId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface DbHistoryService extends IService<DbHistory> {
|
||||
|
||||
void saveHistory(String content);
|
||||
void saveHistory(String content, Long datasourceId);
|
||||
|
||||
}
|
||||
|
||||
@@ -26,9 +26,10 @@ public class DbHistoryServiceImpl extends ServiceImpl<DbHistoryMapper, DbHistory
|
||||
DbHistoryMapper dbHistoryMapper;
|
||||
|
||||
@Override
|
||||
public void saveHistory(String content) {
|
||||
public void saveHistory(String content, Long datasourceId) {
|
||||
DocUserDetails currentUser = DocUserUtil.getCurrentUser();
|
||||
DbHistory dbHistory = new DbHistory();
|
||||
dbHistory.setDatasourceId(datasourceId);
|
||||
dbHistory.setContent(content);
|
||||
dbHistory.setCreateTime(new Date());
|
||||
dbHistory.setCreateUserId(currentUser.getUserId());
|
||||
|
||||
Reference in New Issue
Block a user