update 优化代码生成中的Lock4j锁

This commit is contained in:
AprilWind
2025-12-02 18:18:00 +08:00
parent 8cf324b936
commit 4bd3467595

View File

@@ -91,10 +91,12 @@ public class GenController extends BaseController {
* 导入表结构(保存)
*
* @param tables 表名串
* @param dataName 数据源名称
*/
@RepeatSubmit()
@SaCheckPermission("tool:gen:import")
@Log(title = "代码生成", businessType = BusinessType.IMPORT)
@Lock4j(keys = {"#dataName"}, acquireTimeout = 10000)
@RepeatSubmit()
@PostMapping("/importTable")
public R<Void> importTableSave(String tables, String dataName) {
String[] tableNames = Convert.toStrArray(tables);
@@ -107,9 +109,9 @@ public class GenController extends BaseController {
/**
* 修改保存代码生成业务
*/
@RepeatSubmit()
@SaCheckPermission("tool:gen:edit")
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping
public R<Void> editSave(@Validated @RequestBody GenTable genTable) {
genTableService.validateEdit(genTable);
@@ -175,7 +177,7 @@ public class GenController extends BaseController {
*/
@SaCheckPermission("tool:gen:edit")
@Log(title = "代码生成", businessType = BusinessType.UPDATE)
@Lock4j
@Lock4j(keys = {"#tableId"}, acquireTimeout = 5000)
@GetMapping("/synchDb/{tableId}")
public R<Void> synchDb(@PathVariable("tableId") Long tableId) {
genTableService.synchDb(tableId);