重写复现方法

This commit is contained in:
2025-08-29 18:08:32 +08:00
parent 6ae8afc284
commit 6acd466db3
15 changed files with 1083 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
package com.mini.capi.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* VIEW 前端控制器
* </p>
*
* @author gaoxq
* @since 2025-08-29
*/
@RestController
@RequestMapping("/biz/syncTablesView")
public class SyncTablesViewController {
}

View File

@@ -0,0 +1,96 @@
package com.mini.capi.biz.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
/**
* <p>
* VIEW
* </p>
*
* @author gaoxq
* @since 2025-08-29
*/
@Getter
@Setter
@TableName("biz_sync_tables_view")
public class SyncTablesView implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 记录创建时间
*/
@TableField("create_time")
private LocalDateTime createTime;
/**
* 同步任务唯一标识
*/
@TableField("task_id")
private String taskId;
/**
* 同步任务名称
*/
@TableField("task_name")
private String taskName;
/**
* 源数据库配置ID关联biz_db_config表
*/
@TableField("source_db_id")
private String sourceDbId;
/**
* 源数据库表名
*/
@TableField("source_table")
private String sourceTable;
/**
* 目标数据库表名
*/
@TableField("target_table")
private String targetTable;
/**
* 是否激活(任务启用状态标识)
*/
@TableField("is_active")
private String isActive;
/**
* 最后一次同步时间
*/
@TableField("last_sync_time")
private LocalDateTime lastSyncTime;
/**
* 记录最后更新时间
*/
@TableField("update_time")
private LocalDateTime updateTime;
/**
* 数据库类型如mysql、oracle、postgresql等
*/
@TableField("db_type")
private String dbType;
/**
* 数据库配置唯一标识
*/
@TableField("db_id")
private String dbId;
/**
* 成功同步记录数
*/
@TableField("success_rows")
private Long successRows;
}

View File

@@ -0,0 +1,16 @@
package com.mini.capi.biz.mapper;
import com.mini.capi.biz.domain.SyncTablesView;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* VIEW Mapper 接口
* </p>
*
* @author gaoxq
* @since 2025-08-29
*/
public interface SyncTablesViewMapper extends BaseMapper<SyncTablesView> {
}

View File

@@ -0,0 +1,16 @@
package com.mini.capi.biz.service;
import com.mini.capi.biz.domain.SyncTablesView;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* VIEW 服务类
* </p>
*
* @author gaoxq
* @since 2025-08-29
*/
public interface SyncTablesViewService extends IService<SyncTablesView> {
}

View File

@@ -0,0 +1,20 @@
package com.mini.capi.biz.service.impl;
import com.mini.capi.biz.domain.SyncTablesView;
import com.mini.capi.biz.mapper.SyncTablesViewMapper;
import com.mini.capi.biz.service.SyncTablesViewService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* VIEW 服务实现类
* </p>
*
* @author gaoxq
* @since 2025-08-29
*/
@Service
public class SyncTablesViewServiceImpl extends ServiceImpl<SyncTablesViewMapper, SyncTablesView> implements SyncTablesViewService {
}

View File

@@ -29,7 +29,7 @@ public class demo {
.pathInfo(Collections.singletonMap(OutputFile.xml, System.getProperty("user.dir") + "/src/main/resources/mapper"));
})
.strategyConfig(builder -> {
builder.addInclude("biz_api_module,biz_api_menus")
builder.addInclude("biz_sync_tables_view")
.addTablePrefix("biz_")
.entityBuilder()
.enableLombok()

View File

@@ -27,4 +27,7 @@ public class LoginPageController {
public String homePage() {
return "forward:/views/home.html";
}
}

View File

@@ -0,0 +1,18 @@
package com.mini.capi.sys.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class dataController {
@GetMapping("/Sys/data/list")
public String listPage() {
return "forward:/views/data/list.html";
}
@GetMapping("/Sys/data/getTableDetail")
public String getTableDetail(String taskId) {
return "forward:/views/data/detail.html";
}
}

View File

@@ -0,0 +1,40 @@
package com.mini.capi.sys.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mini.capi.biz.domain.DbConfig;
import com.mini.capi.biz.domain.SyncTablesView;
import com.mini.capi.biz.service.DbConfigService;
import com.mini.capi.biz.service.SyncTablesViewService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController // ← 关键
@RequestMapping("/Sys/data")
public class dataPageController {
@Resource
private DbConfigService configService;
@Resource
private SyncTablesViewService tablesViewService;
@GetMapping("/getDbList")
public List<DbConfig> getDbList() {
return configService.list();
}
@GetMapping("/getTableList")
public List<SyncTablesView> getTableList(String dbId, String targetTable) {
QueryWrapper<SyncTablesView> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(dbId != null && !dbId.isBlank(), "db_id", dbId)
.like(targetTable != null && !targetTable.isBlank(), "target_table", targetTable);
return tablesViewService.list(queryWrapper);
}
}