Merge remote-tracking branch 'origin/jenkins-engin' into jenkins-engin
This commit is contained in:
commit
818c2e0198
@ -28,13 +28,6 @@
|
|||||||
<version>3.15.1</version>
|
<version>3.15.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.projectlombok</groupId>
|
|
||||||
<artifactId>lombok</artifactId>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 机器连接-->
|
<!-- 机器连接-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.jcraft</groupId>
|
<groupId>com.jcraft</groupId>
|
||||||
|
@ -3,16 +3,19 @@ package cd.casic.module.machine.controller;
|
|||||||
|
|
||||||
import cd.casic.framework.commons.pojo.CommonResult;
|
import cd.casic.framework.commons.pojo.CommonResult;
|
||||||
import cd.casic.module.machine.entity.MachineInfo;
|
import cd.casic.module.machine.entity.MachineInfo;
|
||||||
|
import cd.casic.module.machine.enums.ConnectionStatus;
|
||||||
import cd.casic.module.machine.service.MachineInfoService;
|
import cd.casic.module.machine.service.MachineInfoService;
|
||||||
import cd.casic.module.machine.dto.MachineInfoDto;
|
import cd.casic.module.machine.dto.MachineInfoDto;
|
||||||
import cd.casic.module.machine.pojo.SuccessResponseData;
|
import cd.casic.module.machine.pojo.SuccessResponseData;
|
||||||
|
|
||||||
|
import cd.casic.module.machine.utils.PageResult;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static cd.casic.framework.commons.pojo.CommonResult.success;
|
import static cd.casic.framework.commons.pojo.CommonResult.success;
|
||||||
|
|
||||||
@ -25,88 +28,82 @@ public class MachineInfoController {
|
|||||||
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
@Operation(summary = "新增机器信息")
|
@Operation(summary = "新增机器信息")
|
||||||
public CommonResult add(@RequestBody MachineInfoDto machineInfoDto) {
|
public CommonResult<Boolean> add(@RequestBody MachineInfoDto machineInfoDto) {
|
||||||
machineInfoService.addMachineInfo(machineInfoDto);
|
return success(machineInfoService.addMachineInfo(machineInfoDto));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@Operation(summary = "获取机器信息列表")
|
@Operation(summary = "获取机器信息列表")
|
||||||
public CommonResult list(@RequestBody MachineInfoDto machineInfoDto) {
|
public CommonResult<PageResult<MachineInfoDto>> list(@RequestBody MachineInfoDto machineInfoDto) {
|
||||||
return success(machineInfoService.listMachineInfo(machineInfoDto));
|
return success(machineInfoService.listMachineInfo(machineInfoDto));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "编辑机器信息")
|
@Operation(summary = "编辑机器信息")
|
||||||
public CommonResult update(@RequestBody MachineInfoDto machineInfoDto) {
|
public CommonResult<Boolean> update(@RequestBody MachineInfoDto machineInfoDto) {
|
||||||
machineInfoService.updateMachineInfo(machineInfoDto);
|
return success(machineInfoService.updateMachineInfo(machineInfoDto));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/updateStatus")
|
@PutMapping("/updateStatus")
|
||||||
@Operation(summary = "机器启用/停用")
|
@Operation(summary = "机器启用/停用")
|
||||||
public CommonResult updateStatus(@RequestParam("machineInfoId") Long machineInfoId, @RequestParam("status") String status) {
|
public CommonResult<Boolean> updateStatus(@RequestParam("machineInfoId") Long machineInfoId, @RequestParam("status") String status) {
|
||||||
machineInfoService.updateStatus(machineInfoId, status);
|
return success(machineInfoService.updateStatus(machineInfoId, status));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/bindingSecretKey")
|
@PutMapping("/bindingSecretKey")
|
||||||
@Operation(summary = "绑定密钥")
|
@Operation(summary = "绑定密钥")
|
||||||
public CommonResult bindingSecretKey(@RequestParam("machineInfoId") Long machineInfoId, @RequestParam("secretKeyId") Long secretKeyId) {
|
public CommonResult<Boolean> bindingSecretKey(@RequestParam("machineInfoId") Long machineInfoId, @RequestParam("secretKeyId") Long secretKeyId) {
|
||||||
machineInfoService.bindingSecretKey(machineInfoId, secretKeyId);
|
return success(machineInfoService.bindingSecretKey(machineInfoId, secretKeyId));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "机器信息删除")
|
@Operation(summary = "机器信息删除")
|
||||||
public CommonResult delete(@RequestParam("machineInfoId") Long machineInfoId) {
|
public CommonResult<Boolean> delete(@RequestParam("machineInfoId") Long machineInfoId) {
|
||||||
machineInfoService.deleteMachineInfo(machineInfoId);
|
machineInfoService.deleteMachineInfo(machineInfoId);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/deleteList")
|
@DeleteMapping("/deleteList")
|
||||||
@Operation(summary = "批量删除机器信息")
|
@Operation(summary = "批量删除机器信息")
|
||||||
public CommonResult deleteList(@RequestParam("machineInfoId") List<Long> machineInfoIds) {
|
public CommonResult<Boolean> deleteList(@RequestParam("machineInfoIds") List<Long> machineInfoIds) {
|
||||||
machineInfoService.deleteList(machineInfoIds);
|
machineInfoService.deleteList(machineInfoIds);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/test")
|
@PostMapping("/test")
|
||||||
@Operation(summary = "测试机器连接")
|
@Operation(summary = "测试机器连接")
|
||||||
public CommonResult testConnection(@RequestBody MachineInfo machineInfo) {
|
public CommonResult<Boolean> testConnection(@RequestBody MachineInfo machineInfo) {
|
||||||
machineInfoService.testConnection(machineInfo);
|
return success(machineInfoService.testConnection(machineInfo));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/status/{machineName}")
|
@GetMapping("/status/{machineName}")
|
||||||
@Operation(summary = "获取机器连接状态")
|
@Operation(summary = "获取机器连接状态")
|
||||||
public CommonResult getConnectionStatus(@PathVariable String machineName) {
|
public CommonResult<ConnectionStatus> getConnectionStatus(@PathVariable String machineName) {
|
||||||
return success(machineInfoService.getConnectionStatus(machineName));
|
return success(machineInfoService.getConnectionStatus(machineName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/status/all")
|
@GetMapping("/status/all")
|
||||||
@Operation(summary = "获取所有机器连接状态")
|
@Operation(summary = "获取所有机器连接状态")
|
||||||
public CommonResult getAllConnectionStatus() {
|
public CommonResult<Map<String, ConnectionStatus>> getAllConnectionStatus() {
|
||||||
return success(machineInfoService.getAllConnectionStatus());
|
return success(machineInfoService.getAllConnectionStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/connect")
|
@PostMapping("/connect")
|
||||||
@Operation(summary = "建立机器连接")
|
@Operation(summary = "建立机器连接")
|
||||||
public CommonResult connect(@RequestBody MachineInfo machineInfo) {
|
public CommonResult<String> connect(@RequestBody MachineInfo machineInfo) {
|
||||||
return success(machineInfoService.connect(machineInfo));
|
return success(machineInfoService.connect(machineInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/disconnect/{sessionId}")
|
@PostMapping("/disconnect/{sessionId}")
|
||||||
@Operation(summary = "断开机器连接")
|
@Operation(summary = "断开机器连接")
|
||||||
public CommonResult disconnect(@PathVariable String sessionId) {
|
public CommonResult<Boolean> disconnect(@PathVariable String sessionId) {
|
||||||
machineInfoService.disconnect(sessionId);
|
return success(machineInfoService.disconnect(sessionId));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/execute/{sessionId}")
|
@PostMapping("/execute/{sessionId}")
|
||||||
@Operation(summary = "执行远程命令")
|
@Operation(summary = "执行远程命令")
|
||||||
public CommonResult executeCommand(
|
public CommonResult<String> executeCommand(
|
||||||
@PathVariable String sessionId,
|
@PathVariable String sessionId,
|
||||||
@RequestBody String command) {
|
@RequestBody String command) {
|
||||||
|
|
||||||
@ -115,21 +112,19 @@ public class MachineInfoController {
|
|||||||
|
|
||||||
@PostMapping("/upload/{sessionId}")
|
@PostMapping("/upload/{sessionId}")
|
||||||
@Operation(summary = "上传文件到远程机器")
|
@Operation(summary = "上传文件到远程机器")
|
||||||
public CommonResult uploadFile(
|
public CommonResult<Boolean> uploadFile(
|
||||||
@PathVariable String sessionId,
|
@PathVariable String sessionId,
|
||||||
@RequestParam String localFilePath,
|
@RequestParam String localFilePath,
|
||||||
@RequestParam String remoteFilePath) {
|
@RequestParam String remoteFilePath) {
|
||||||
machineInfoService.uploadFile(sessionId, localFilePath, remoteFilePath);
|
return success(machineInfoService.uploadFile(sessionId, localFilePath, remoteFilePath));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/download/{sessionId}")
|
@PostMapping("/download/{sessionId}")
|
||||||
@Operation(summary = "从远程机器下载文件")
|
@Operation(summary = "从远程机器下载文件")
|
||||||
public CommonResult downloadFile(
|
public CommonResult<Boolean> downloadFile(
|
||||||
@PathVariable String sessionId,
|
@PathVariable String sessionId,
|
||||||
@RequestParam String remoteFilePath,
|
@RequestParam String remoteFilePath,
|
||||||
@RequestParam String localFilePath) {
|
@RequestParam String localFilePath) {
|
||||||
machineInfoService.downloadFile(sessionId, remoteFilePath, localFilePath);
|
return success(machineInfoService.downloadFile(sessionId, remoteFilePath, localFilePath));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package cd.casic.module.machine.controller;
|
package cd.casic.module.machine.controller;
|
||||||
import cd.casic.framework.commons.pojo.CommonResult;
|
import cd.casic.framework.commons.pojo.CommonResult;
|
||||||
|
import cd.casic.module.machine.entity.SecretKey;
|
||||||
import cd.casic.module.machine.service.SecretKeyService;
|
import cd.casic.module.machine.service.SecretKeyService;
|
||||||
import cd.casic.module.machine.dto.SecretKeyDto;
|
import cd.casic.module.machine.dto.SecretKeyDto;
|
||||||
|
import cd.casic.module.machine.utils.PageResult;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@ -30,43 +32,39 @@ public class SecretKeyController {
|
|||||||
|
|
||||||
@PostMapping(value = "/add", consumes = "multipart/form-data")
|
@PostMapping(value = "/add", consumes = "multipart/form-data")
|
||||||
@Operation(summary ="新增密钥")
|
@Operation(summary ="新增密钥")
|
||||||
public CommonResult add(@RequestPart("secretKeyDto") SecretKeyDto secretKeyDto, @RequestPart("file") MultipartFile file) {
|
public CommonResult<Boolean> add(@RequestBody SecretKeyDto secretKeyDto, @RequestPart("file") MultipartFile file) {
|
||||||
secretKeyService.addSecretKey(secretKeyDto, file);
|
return success(secretKeyService.addSecretKey(secretKeyDto, file));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/bindingMachine")
|
@PutMapping("/bindingMachine")
|
||||||
@Operation(summary ="绑定机器")
|
@Operation(summary ="绑定机器")
|
||||||
public CommonResult bindingMachine(@RequestParam("secretKeyId") Long secretKeyId, @RequestParam("machineInfoIds") List<Long> machineInfoIds) {
|
public CommonResult<Boolean> bindingMachine(@RequestParam("secretKeyId") Long secretKeyId, @RequestParam("machineInfoIds") List<Long> machineInfoIds) {
|
||||||
secretKeyService.bindingMachine(secretKeyId, machineInfoIds);
|
secretKeyService.bindingMachine(secretKeyId, machineInfoIds);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary ="编辑密钥信息")
|
@Operation(summary ="编辑密钥信息")
|
||||||
public CommonResult update(@RequestPart("secretKeyDto") SecretKeyDto secretKeyDto, @RequestPart(value = "file", required = false) MultipartFile file) {
|
public CommonResult<Boolean> update(@RequestBody SecretKeyDto secretKeyDto, @RequestPart(value = "file", required = false) MultipartFile file) {
|
||||||
secretKeyService.updateSecretKey(secretKeyDto, file);
|
return success(secretKeyService.updateSecretKey(secretKeyDto, file));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary ="删除密钥")
|
@Operation(summary ="删除密钥")
|
||||||
public CommonResult delete(@RequestParam("secretKeyId") Long secretKeyId) {
|
public CommonResult<Boolean> delete(@RequestParam("secretKeyId") Long secretKeyId) {
|
||||||
secretKeyService.deleteSecretKey(secretKeyId);
|
return success(secretKeyService.deleteSecretKey(secretKeyId));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/deleteList")
|
@DeleteMapping("/deleteList")
|
||||||
@Operation(summary ="批量删除密钥")
|
@Operation(summary ="批量删除密钥")
|
||||||
public CommonResult deleteList(@RequestParam("secretKeyId") List<Long> secretKeyIds) {
|
public CommonResult<Boolean> deleteList(@RequestParam("secretKeyId") List<Long> secretKeyIds) {
|
||||||
secretKeyService.deleteList(secretKeyIds);
|
return success(secretKeyService.deleteList(secretKeyIds));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@Operation(summary ="获取密钥信息列表")
|
@Operation(summary ="获取密钥信息列表")
|
||||||
public CommonResult list(@RequestBody SecretKeyDto secretKeyDto) {
|
public CommonResult<PageResult<SecretKey>> list(@RequestBody SecretKeyDto secretKeyDto) {
|
||||||
return success(secretKeyService.listSecretKey(secretKeyDto));
|
return success(secretKeyService.listSecretKey(secretKeyDto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,5 +40,5 @@ public class MachineInfoDto extends cd.casic.module.machine.dto.PageDto {
|
|||||||
|
|
||||||
private String authenticationType;
|
private String authenticationType;
|
||||||
|
|
||||||
private String machineInfoTypeCode;
|
private String machineInfoType;
|
||||||
}
|
}
|
||||||
|
@ -61,5 +61,6 @@ public class MachineInfo extends BaseEntity{
|
|||||||
@TableField(value = "authentication_type_code")
|
@TableField(value = "authentication_type_code")
|
||||||
private int authenticationTypeCode;
|
private int authenticationTypeCode;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
private AuthenticationType authenticationType;
|
private AuthenticationType authenticationType;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cd.casic.module.machine.service.impl;
|
package cd.casic.module.machine.service.impl;
|
||||||
|
|
||||||
|
import cd.casic.module.machine.enums.MachineInfoType;
|
||||||
import cd.casic.module.machine.handler.ConnectionSession;
|
import cd.casic.module.machine.handler.ConnectionSession;
|
||||||
import cd.casic.module.machine.mapper.MachineInfoMapper;
|
import cd.casic.module.machine.mapper.MachineInfoMapper;
|
||||||
import cd.casic.module.machine.dto.MachineInfoDto;
|
import cd.casic.module.machine.dto.MachineInfoDto;
|
||||||
@ -64,6 +65,11 @@ public class MachineinfoServiceImpl extends ServiceImpl<MachineInfoMapper, Machi
|
|||||||
? AuthenticationType.PASSWORD.getCode()
|
? AuthenticationType.PASSWORD.getCode()
|
||||||
: AuthenticationType.SECRET_KEY.getCode()
|
: AuthenticationType.SECRET_KEY.getCode()
|
||||||
);
|
);
|
||||||
|
machineInfo.setMachineInfoTypeCode(
|
||||||
|
"Windows".equals(machineInfoDto.getMachineInfoType())
|
||||||
|
? MachineInfoType.WINDOWS.getCode()
|
||||||
|
: MachineInfoType.Linux.getCode()
|
||||||
|
);
|
||||||
|
|
||||||
return this.save(machineInfo);
|
return this.save(machineInfo);
|
||||||
}
|
}
|
||||||
@ -81,8 +87,9 @@ public class MachineinfoServiceImpl extends ServiceImpl<MachineInfoMapper, Machi
|
|||||||
MachineInfoDto dto = new MachineInfoDto();
|
MachineInfoDto dto = new MachineInfoDto();
|
||||||
BeanUtils.copyProperties(machineInfo, dto);
|
BeanUtils.copyProperties(machineInfo, dto);
|
||||||
// 直接调用原有枚举转换方法
|
// 直接调用原有枚举转换方法
|
||||||
dto.setStatus(EnumUtils.getEnumByCode(machineInfo.getStatus(), MachineInfoStatus.class).getMessage());
|
dto.setMachineInfoType(EnumUtils.getEnumByCode(machineInfo.getMachineInfoTypeCode(), MachineInfoType.class).getMessage());
|
||||||
dto.setAuthenticationType(EnumUtils.getEnumByCode(machineInfo.getAuthenticationType(), AuthenticationType.class).getMessage());
|
dto.setStatus(EnumUtils.getEnumByCode(machineInfo.getStatusCode(), MachineInfoStatus.class).getMessage());
|
||||||
|
dto.setAuthenticationType(EnumUtils.getEnumByCode(machineInfo.getAuthenticationTypeCode(), AuthenticationType.class).getMessage());
|
||||||
return dto;
|
return dto;
|
||||||
})
|
})
|
||||||
.toList();
|
.toList();
|
||||||
@ -100,10 +107,15 @@ public class MachineinfoServiceImpl extends ServiceImpl<MachineInfoMapper, Machi
|
|||||||
public boolean updateMachineInfo(MachineInfoDto machineInfoDto) {
|
public boolean updateMachineInfo(MachineInfoDto machineInfoDto) {
|
||||||
MachineInfo machineInfo = new MachineInfo();
|
MachineInfo machineInfo = new MachineInfo();
|
||||||
BeanUtils.copyProperties(machineInfoDto, machineInfo);
|
BeanUtils.copyProperties(machineInfoDto, machineInfo);
|
||||||
machineInfo.setAuthenticationType(
|
machineInfo.setAuthenticationTypeCode(
|
||||||
"密码认证".equals(machineInfoDto.getAuthenticationType())
|
"密码认证".equals(machineInfoDto.getAuthenticationType())
|
||||||
? AuthenticationType.PASSWORD
|
? AuthenticationType.PASSWORD.getCode()
|
||||||
: AuthenticationType.SECRET_KEY
|
: AuthenticationType.SECRET_KEY.getCode()
|
||||||
|
);
|
||||||
|
machineInfo.setMachineInfoTypeCode(
|
||||||
|
"Windows".equals(machineInfoDto.getMachineInfoType())
|
||||||
|
? MachineInfoType.WINDOWS.getCode()
|
||||||
|
: MachineInfoType.Linux.getCode()
|
||||||
);
|
);
|
||||||
return this.updateById(machineInfo);
|
return this.updateById(machineInfo);
|
||||||
}
|
}
|
||||||
@ -111,14 +123,14 @@ public class MachineinfoServiceImpl extends ServiceImpl<MachineInfoMapper, Machi
|
|||||||
@Override
|
@Override
|
||||||
public boolean updateStatus(Long machineInfoId, String status) {
|
public boolean updateStatus(Long machineInfoId, String status) {
|
||||||
UpdateWrapper<MachineInfo> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<MachineInfo> updateWrapper = new UpdateWrapper<>();
|
||||||
updateWrapper.eq("id", machineInfoId).set("status", status);
|
updateWrapper.eq("id", machineInfoId).set("status_code", EnumUtils.getEnumByMessage(status, MachineInfoStatus.class).getCode());
|
||||||
return this.update(updateWrapper);
|
return this.update(updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bindingSecretKey(Long machineInfoId, Long secretKeyId) {
|
public boolean bindingSecretKey(Long machineInfoId, Long secretKeyId) {
|
||||||
UpdateWrapper<MachineInfo> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<MachineInfo> updateWrapper = new UpdateWrapper<>();
|
||||||
updateWrapper.eq("id", machineInfoId).set("secretKeyId", secretKeyId);
|
updateWrapper.eq("id", machineInfoId).set("secret_key_id", secretKeyId).set("authentication_type_code",2);
|
||||||
return this.update(updateWrapper);
|
return this.update(updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ public class SecretKeyServiceImpl extends ServiceImpl<SecretServiceMapper, Secre
|
|||||||
public void bindingMachine(Long secretKeyId, List<Long> machineInfoIds) {
|
public void bindingMachine(Long secretKeyId, List<Long> machineInfoIds) {
|
||||||
List<MachineInfo> machineInfos = machineInfoService.listByIds(machineInfoIds);
|
List<MachineInfo> machineInfos = machineInfoService.listByIds(machineInfoIds);
|
||||||
machineInfos.forEach(machineInfo -> machineInfo.setSecretKeyId(secretKeyId));
|
machineInfos.forEach(machineInfo -> machineInfo.setSecretKeyId(secretKeyId));
|
||||||
|
machineInfoService.updateBatchById(machineInfos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user