feat: 修改主机额外配置.
This commit is contained in:
@@ -58,7 +58,7 @@ public class HostExtraController {
|
||||
return hostExtraService.getHostExtraList(request);
|
||||
}
|
||||
|
||||
@GetMapping("/update")
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "修改主机拓展信息")
|
||||
public Integer updateHostExtra(@Validated @RequestBody HostExtraUpdateRequest request) {
|
||||
return hostExtraService.updateHostExtra(request);
|
||||
|
||||
@@ -15,14 +15,14 @@ public enum HostExtraSshAuthTypeEnum {
|
||||
DEFAULT,
|
||||
|
||||
/**
|
||||
* 秘钥验证
|
||||
* 自定义秘钥验证
|
||||
*/
|
||||
KEY,
|
||||
CUSTOM_KEY,
|
||||
|
||||
/**
|
||||
* 身份验证
|
||||
* 自定义身份验证
|
||||
*/
|
||||
IDENTITY,
|
||||
CUSTOM_IDENTITY,
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -55,9 +55,9 @@ public class HostSshExtraStrategy implements MapDataStrategy<HostSshExtraModel>
|
||||
Long keyId = model.getKeyId();
|
||||
Long identityId = model.getIdentityId();
|
||||
// 必填验证
|
||||
if (HostExtraSshAuthTypeEnum.KEY.equals(authType)) {
|
||||
if (HostExtraSshAuthTypeEnum.CUSTOM_KEY.equals(authType)) {
|
||||
Valid.notNull(keyId);
|
||||
} else if (HostExtraSshAuthTypeEnum.IDENTITY.equals(authType)) {
|
||||
} else if (HostExtraSshAuthTypeEnum.CUSTOM_IDENTITY.equals(authType)) {
|
||||
Valid.notNull(identityId);
|
||||
}
|
||||
// 验证主机秘钥是否存在
|
||||
|
||||
@@ -243,7 +243,6 @@ public class AssetAuthorizedDataServiceImpl implements AssetAuthorizedDataServic
|
||||
List<Long> authorizedGroupIdList) {
|
||||
// 查询主机列表
|
||||
List<HostVO> hosts = hostService.getHostListByCache();
|
||||
|
||||
// 全部数据直接返回
|
||||
if (allData) {
|
||||
return hosts;
|
||||
@@ -258,6 +257,7 @@ public class AssetAuthorizedDataServiceImpl implements AssetAuthorizedDataServic
|
||||
.map(dataGroupRel::get)
|
||||
.filter(Lists::isNoneEmpty)
|
||||
.flatMap(Collection::stream)
|
||||
.distinct()
|
||||
.map(hostMap::get)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user