fine:()修改存在异常的东西
parent
6c23f33ec0
commit
042566eb3c
|
@ -10,7 +10,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>cloud-property-common</artifactId>
|
<artifactId>cloud-property-common</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package com.muyu.common.domain;
|
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.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,10 +18,11 @@ import java.util.function.Supplier;
|
||||||
* @Date:2024/8/21 1:00
|
* @Date:2024/8/21 1:00
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class Connect extends BaseEntity {
|
@TableName("connect")
|
||||||
|
public class Connect {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
|
@ -58,6 +59,11 @@ public class Connect extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String databaseName;
|
private String databaseName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据接入类型
|
||||||
|
*/
|
||||||
|
private String dataAccType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
*/
|
*/
|
||||||
|
@ -103,6 +109,7 @@ public class Connect extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 客户最近5条支付单
|
* 客户最近5条支付单
|
||||||
*/
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
private List<Connect> connectList;
|
private List<Connect> connectList;
|
||||||
|
|
||||||
public static Connect connectBuild(Connect connect1, Supplier<List<Connect>> function) {
|
public static Connect connectBuild(Connect connect1, Supplier<List<Connect>> function) {
|
||||||
|
|
|
@ -16,11 +16,11 @@ import java.util.function.Supplier;
|
||||||
* @Date:2024/8/23 11:39
|
* @Date:2024/8/23 11:39
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@Builder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName("TableFie")
|
@TableName("tablefie")
|
||||||
public class TableFie extends BaseEntity {
|
public class TableFie{
|
||||||
|
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@TableField(value = "field")
|
@TableField(value = "field")
|
||||||
|
@ -29,7 +29,7 @@ public class TableFie extends BaseEntity {
|
||||||
private String collation;
|
private String collation;
|
||||||
private String nullable;
|
private String nullable;
|
||||||
@TableField(value = "primarys")
|
@TableField(value = "primarys")
|
||||||
private String primary;
|
private String primarys;
|
||||||
private String annotation;
|
private String annotation;
|
||||||
|
|
||||||
public static TableFie customerBuild(TableFie tableFie, Supplier<TableFie> function) {
|
public static TableFie customerBuild(TableFie tableFie, Supplier<TableFie> function) {
|
||||||
|
@ -38,7 +38,7 @@ public class TableFie extends BaseEntity {
|
||||||
.type(tableFie.getType())
|
.type(tableFie.getType())
|
||||||
.collation(tableFie.getCollation())
|
.collation(tableFie.getCollation())
|
||||||
.nullable(tableFie.getNullable())
|
.nullable(tableFie.getNullable())
|
||||||
.primary(tableFie.getPrimary())
|
.primarys(tableFie.getPrimarys())
|
||||||
.annotation(tableFie.getAnnotation())
|
.annotation(tableFie.getAnnotation())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public class TableFie extends BaseEntity {
|
||||||
.type(req.getType())
|
.type(req.getType())
|
||||||
.collation(req.getCollation())
|
.collation(req.getCollation())
|
||||||
.nullable(req.getNullable())
|
.nullable(req.getNullable())
|
||||||
.primary(req.getPrimary())
|
.primarys(req.getPrimarys())
|
||||||
.annotation(req.getAnnotation())
|
.annotation(req.getAnnotation())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ public class TableFie extends BaseEntity {
|
||||||
.type(req.getType())
|
.type(req.getType())
|
||||||
.collation(req.getCollation())
|
.collation(req.getCollation())
|
||||||
.nullable(req.getNullable())
|
.nullable(req.getNullable())
|
||||||
.primary(req.getPrimary())
|
.primarys(req.getPrimarys())
|
||||||
.annotation(req.getAnnotation())
|
.annotation(req.getAnnotation())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ public class TableFie extends BaseEntity {
|
||||||
.type(this.getType())
|
.type(this.getType())
|
||||||
.collation(this.getCollation())
|
.collation(this.getCollation())
|
||||||
.nullable(this.getNullable())
|
.nullable(this.getNullable())
|
||||||
.primary(this.getPrimary())
|
.primarys(this.getPrimarys())
|
||||||
.annotation(this.getAnnotation())
|
.annotation(this.getAnnotation())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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];
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
@ -38,7 +39,11 @@ public class ConnectController {
|
||||||
public Result<List<Connect>> selectConnect(
|
public Result<List<Connect>> selectConnect(
|
||||||
@Validated @RequestBody Connect connect
|
@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,"查询失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class TableFieldController {
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@Operation(summary = "数据字段添加",description = "添加数据字段信息,添加成功之后才可以使用数据字段")
|
@Operation(summary = "数据字段添加",description = "添加数据字段信息,添加成功之后才可以使用数据字段")
|
||||||
public Result<String> save(@Validated @RequestBody TableFie tableFie){
|
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,"操作成功");
|
return Result.success(null,"操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ public class DataSourceServiceImpl
|
||||||
.type(rs.getString("Type"))
|
.type(rs.getString("Type"))
|
||||||
.collation(rs.getString("Collation"))
|
.collation(rs.getString("Collation"))
|
||||||
.nullable(rs.getString("Null")) // 转换为布尔值,假设你想要这个字段
|
.nullable(rs.getString("Null")) // 转换为布尔值,假设你想要这个字段
|
||||||
.primary(rs.getString("Key"))
|
.primarys(rs.getString("Key"))
|
||||||
.annotation(rs.getString("Comment"))
|
.annotation(rs.getString("Comment"))
|
||||||
.build();
|
.build();
|
||||||
tableFIES.add(tableFie);
|
tableFIES.add(tableFie);
|
||||||
|
@ -209,10 +209,11 @@ public class DataSourceServiceImpl
|
||||||
ResultSet rs = preparedStatement.executeQuery();
|
ResultSet rs = preparedStatement.executeQuery();
|
||||||
TableNames tableNames = new TableNames();
|
TableNames tableNames = new TableNames();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
String[] dataName = tableNames.getDataName();
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
String database = rs.getString("Database");
|
String database = rs.getString("Database");
|
||||||
|
System.out.println(database);
|
||||||
tableNames.getDataName()[count] = database;
|
dataName[count] = database;
|
||||||
count++;
|
count++;
|
||||||
System.out.println(tableNames);
|
System.out.println(tableNames);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.muyu.server.service.impl;
|
package com.muyu.server.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.domain.Connect;
|
import com.muyu.common.domain.Connect;
|
||||||
import com.muyu.server.mapper.OrderConnectMapper;
|
import com.muyu.server.mapper.OrderConnectMapper;
|
||||||
|
@ -24,7 +23,7 @@ public class OrderConnectServiceImpl extends ServiceImpl<OrderConnectMapper, Con
|
||||||
|
|
||||||
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Connect> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(Connect::getId,id);
|
queryWrapper.eq(Connect::getId,id);
|
||||||
queryWrapper.orderBy(true,false,Connect::getCreateTime);
|
queryWrapper.orderBy(true,false,Connect::getId);
|
||||||
queryWrapper.last("limit "+limit);
|
queryWrapper.last("limit "+limit);
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class TableFieldServiceImpl
|
||||||
public List<TableFie> selectList(TableFie tableFie) {
|
public List<TableFie> selectList(TableFie tableFie) {
|
||||||
LambdaQueryWrapper<TableFie> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<TableFie> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.like(
|
queryWrapper.like(
|
||||||
StringUtils.isNotEmpty(tableFie.getType()),
|
StringUtils.isNotBlank(tableFie.getType()),
|
||||||
com.muyu.common.domain.TableFie::getType, tableFie.getType()
|
com.muyu.common.domain.TableFie::getType, tableFie.getType()
|
||||||
);
|
);
|
||||||
List<TableFie> tableFieList = this.list(queryWrapper);
|
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
Loading…
Reference in New Issue