mirror of https://gitee.com/stylefeng/roses
【7.0.3】增加查询所有数据源列表的接口
parent
5cda1ad030
commit
d2f0b77bf2
|
@ -87,6 +87,11 @@ public class DatabaseInfoRequest extends BaseRequest {
|
||||||
@NotBlank(message = "数据库连接密码", groups = {add.class, edit.class})
|
@NotBlank(message = "数据库连接密码", groups = {add.class, edit.class})
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态标识:1-正常,2-无法连接
|
||||||
|
*/
|
||||||
|
private Integer statusFlag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注,摘要
|
* 备注,摘要
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -39,6 +39,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -102,6 +103,18 @@ public class DatabaseInfoController {
|
||||||
return new SuccessResponseData(pageResult);
|
return new SuccessResponseData(pageResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据源列表
|
||||||
|
*
|
||||||
|
* @author fengshuonan
|
||||||
|
* @date 2020/11/1 22:18
|
||||||
|
*/
|
||||||
|
@GetResource(name = "查询所有数据源列表", path = "/databaseInfo/list")
|
||||||
|
public ResponseData findList(DatabaseInfoRequest databaseInfoRequest) {
|
||||||
|
List<DatabaseInfo> databaseInfos = databaseInfoService.findList(databaseInfoRequest);
|
||||||
|
return new SuccessResponseData(databaseInfos);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询数据源详情
|
* 查询数据源详情
|
||||||
*
|
*
|
||||||
|
|
|
@ -258,6 +258,9 @@ public class DatabaseInfoServiceImpl extends ServiceImpl<DatabaseInfoMapper, Dat
|
||||||
// 拼接sql 条件
|
// 拼接sql 条件
|
||||||
queryWrapper.like(ObjectUtil.isNotEmpty(dbName), DatabaseInfo::getDbName, dbName);
|
queryWrapper.like(ObjectUtil.isNotEmpty(dbName), DatabaseInfo::getDbName, dbName);
|
||||||
|
|
||||||
|
// 拼接状态条件
|
||||||
|
queryWrapper.eq(ObjectUtil.isNotEmpty(databaseInfoRequest.getStatusFlag()), DatabaseInfo::getStatusFlag, databaseInfoRequest.getStatusFlag());
|
||||||
|
|
||||||
return queryWrapper;
|
return queryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue