fine:()修改存在异常的东西

master
Yueng 2024-08-26 21:49:28 +08:00
parent 6c23f33ec0
commit 042566eb3c
13 changed files with 94176 additions and 36396 deletions

View File

@ -10,7 +10,7 @@
</parent>
<artifactId>cloud-property-common</artifactId>
<version>1.0.0</version>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>

View File

@ -1,13 +1,13 @@
package com.muyu.common.domain;
import com.muyu.common.core.web.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
import java.util.Optional;
import java.util.function.Supplier;
/**
@ -18,10 +18,11 @@ import java.util.function.Supplier;
* @Date2024/8/21 1:00
*/
@Data
@SuperBuilder
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Connect extends BaseEntity {
@TableName("connect")
public class Connect {
/**
* id
@ -58,6 +59,11 @@ public class Connect extends BaseEntity {
*/
private String databaseName;
/**
*
*/
private String dataAccType;
/**
*
*/
@ -103,6 +109,7 @@ public class Connect extends BaseEntity {
/**
* 5
*/
@TableField(exist = false)
private List<Connect> connectList;
public static Connect connectBuild(Connect connect1, Supplier<List<Connect>> function) {

View File

@ -16,11 +16,11 @@ import java.util.function.Supplier;
* @Date2024/8/23 11:39
*/
@Data
@SuperBuilder
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("TableFie")
public class TableFie extends BaseEntity {
@TableName("tablefie")
public class TableFie{
private Integer id;
@TableField(value = "field")
@ -29,7 +29,7 @@ public class TableFie extends BaseEntity {
private String collation;
private String nullable;
@TableField(value = "primarys")
private String primary;
private String primarys;
private String annotation;
public static TableFie customerBuild(TableFie tableFie, Supplier<TableFie> function) {
@ -38,7 +38,7 @@ public class TableFie extends BaseEntity {
.type(tableFie.getType())
.collation(tableFie.getCollation())
.nullable(tableFie.getNullable())
.primary(tableFie.getPrimary())
.primarys(tableFie.getPrimarys())
.annotation(tableFie.getAnnotation())
.build();
}
@ -53,7 +53,7 @@ public class TableFie extends BaseEntity {
.type(req.getType())
.collation(req.getCollation())
.nullable(req.getNullable())
.primary(req.getPrimary())
.primarys(req.getPrimarys())
.annotation(req.getAnnotation())
.build();
}
@ -69,7 +69,7 @@ public class TableFie extends BaseEntity {
.type(req.getType())
.collation(req.getCollation())
.nullable(req.getNullable())
.primary(req.getPrimary())
.primarys(req.getPrimarys())
.annotation(req.getAnnotation())
.build();
}
@ -81,7 +81,7 @@ public class TableFie extends BaseEntity {
.type(this.getType())
.collation(this.getCollation())
.nullable(this.getNullable())
.primary(this.getPrimary())
.primarys(this.getPrimarys())
.annotation(this.getAnnotation())
.build();
}

View File

@ -23,9 +23,9 @@ public class TableNames extends BaseEntity {
/**
*
*/
private String[] tableName;
private String[] tableName = new String[20];
/**
*
*/
private String[] dataName;
private String[] dataName = new String[10];
}

View File

@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -38,7 +39,11 @@ public class ConnectController {
public Result<List<Connect>> selectConnect(
@Validated @RequestBody Connect connect
){
return Result.success(connectService.selectConnect(connect));
List<Connect> connects = connectService.selectConnect(connect);
if (CollectionUtils.isEmpty(connects)){
return Result.success(null,"查询成功");
}
return Result.error(null,"查询失败");
}
/**

View File

@ -49,7 +49,7 @@ public class TableFieldController {
@PostMapping("/add")
@Operation(summary = "数据字段添加",description = "添加数据字段信息,添加成功之后才可以使用数据字段")
public Result<String> save(@Validated @RequestBody TableFie tableFie){
tableFieldService.save(com.muyu.common.domain.TableFie.addBuild(tableFie));
tableFieldService.save(TableFie.addBuild(tableFie));
return Result.success(null,"操作成功");
}

View File

@ -163,7 +163,7 @@ public class DataSourceServiceImpl
.type(rs.getString("Type"))
.collation(rs.getString("Collation"))
.nullable(rs.getString("Null")) // 转换为布尔值,假设你想要这个字段
.primary(rs.getString("Key"))
.primarys(rs.getString("Key"))
.annotation(rs.getString("Comment"))
.build();
tableFIES.add(tableFie);
@ -209,10 +209,11 @@ public class DataSourceServiceImpl
ResultSet rs = preparedStatement.executeQuery();
TableNames tableNames = new TableNames();
int count = 0;
String[] dataName = tableNames.getDataName();
while (rs.next()) {
String database = rs.getString("Database");
tableNames.getDataName()[count] = database;
System.out.println(database);
dataName[count] = database;
count++;
System.out.println(tableNames);
}

View File

@ -1,7 +1,6 @@
package com.muyu.server.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.domain.Connect;
import com.muyu.server.mapper.OrderConnectMapper;
@ -24,7 +23,7 @@ public class OrderConnectServiceImpl extends ServiceImpl<OrderConnectMapper, Con
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Connect::getId,id);
queryWrapper.orderBy(true,false,Connect::getCreateTime);
queryWrapper.orderBy(true,false,Connect::getId);
queryWrapper.last("limit "+limit);
return this.list(queryWrapper);
}

View File

@ -36,7 +36,7 @@ public class TableFieldServiceImpl
public List<TableFie> selectList(TableFie tableFie) {
LambdaQueryWrapper<TableFie> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.like(
StringUtils.isNotEmpty(tableFie.getType()),
StringUtils.isNotBlank(tableFie.getType()),
com.muyu.common.domain.TableFie::getType, tableFie.getType()
);
List<TableFie> tableFieList = this.list(queryWrapper);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff