mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-12 21:49:01 +08:00
♻️ Refactoring code. close #3430 主键策略调整为 ASSIGN_ID , 增加审计字段自动填充
This commit is contained in:
1 parent
4fc541e2f4
commit
5d318f994c
110 files changed
+408
-269
No files matched your search
+2
-2
@@ -65,7 +65,7 @@ public class GenDsConfController {
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable("id") Integer id) {
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(datasourceConfService.getById(id));
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ public class GenDsConfController {
|
||||
*/
|
||||
@SysLog("删除数据源表")
|
||||
@DeleteMapping("/{id}")
|
||||
public R removeById(@PathVariable Integer id) {
|
||||
public R removeById(@PathVariable Long id) {
|
||||
return R.ok(datasourceConfService.removeByDsId(id));
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -62,7 +62,7 @@ public class GenFormConfController {
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询", notes = "通过id查询")
|
||||
@GetMapping("/{id}")
|
||||
public R getById(@PathVariable("id") Integer id) {
|
||||
public R getById(@PathVariable("id") Long id) {
|
||||
return R.ok(genRecordService.getById(id));
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class GenFormConfController {
|
||||
@SysLog("通过id删除生成记录")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@pms.hasPermission('gen_form_del')")
|
||||
public R removeById(@PathVariable Integer id) {
|
||||
public R removeById(@PathVariable Long id) {
|
||||
return R.ok(genRecordService.removeById(id));
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.pig4cloud.pigx.codegen.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@@ -41,8 +42,8 @@ public class GenDatasourceConf extends Model<GenDatasourceConf> {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
|
||||
+4
-3
@@ -17,6 +17,7 @@
|
||||
|
||||
package com.pig4cloud.pigx.codegen.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
@@ -44,9 +45,9 @@ public class GenFormConf extends Model<GenFormConf> {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "ID")
|
||||
private Integer id;
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 表名称
|
||||
@@ -82,6 +83,6 @@ public class GenFormConf extends Model<GenFormConf> {
|
||||
* 所属租户
|
||||
*/
|
||||
@ApiModelProperty(value = "所属租户", hidden = true)
|
||||
private Integer tenantId;
|
||||
private Long tenantId;
|
||||
|
||||
}
|
||||
+1
-1
@@ -60,6 +60,6 @@ public interface GenDatasourceConfService extends IService<GenDatasourceConf> {
|
||||
* @param dsId 数据源ID
|
||||
* @return
|
||||
*/
|
||||
Boolean removeByDsId(Integer dsId);
|
||||
Boolean removeByDsId(Long dsId);
|
||||
|
||||
}
|
||||
+1
-1
@@ -105,7 +105,7 @@ public class GenDatasourceConfServiceImpl extends ServiceImpl<GenDatasourceConfM
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Boolean removeByDsId(Integer dsId) {
|
||||
public Boolean removeByDsId(Long dsId) {
|
||||
DynamicRoutingDataSource dynamicRoutingDataSource = SpringContextHolder.getBean(DynamicRoutingDataSource.class);
|
||||
dynamicRoutingDataSource.removeDataSource(baseMapper.selectById(dsId).getName());
|
||||
this.baseMapper.deleteById(dsId);
|
||||
|
||||
Reference in new issue
Block a user