🔨 优化主机逻辑.
This commit is contained in:
@@ -85,7 +85,7 @@ public class HostGroupController {
|
||||
@OperatorLog(HostGroupOperatorType.RENAME)
|
||||
@PutMapping("/rename")
|
||||
@Operation(summary = "修改名称")
|
||||
@PreAuthorize("@ss.hasPermission('asset:host-group:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermission('asset:host-group:update', 'asset:host:query')")
|
||||
public Integer updateHostGroupName(@Validated @RequestBody DataGroupRenameDTO request) {
|
||||
return hostGroupService.updateHostGroupName(request);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ public class HostGroupController {
|
||||
@GetMapping("/rel-list")
|
||||
@Operation(summary = "查询分组内主机")
|
||||
@Parameter(name = "groupId", description = "groupId", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('asset:host-group:update')")
|
||||
@PreAuthorize("@ss.hasAnyPermission('asset:host-group:update', 'asset:host:query')")
|
||||
public Set<Long> queryHostGroupRel(@RequestParam("groupId") Long groupId) {
|
||||
return hostGroupService.queryHostGroupRel(groupId);
|
||||
}
|
||||
|
||||
@@ -28,10 +28,7 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import javax.validation.constraints.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@@ -78,6 +75,7 @@ public class HostCreateRequest implements Serializable {
|
||||
@Schema(description = "主机端口")
|
||||
private Integer port;
|
||||
|
||||
@NotEmpty
|
||||
@Schema(description = "主机分组")
|
||||
private List<Long> groupIdList;
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ public class HostUpdateRequest implements Serializable {
|
||||
@Schema(description = "主机端口")
|
||||
private Integer port;
|
||||
|
||||
@NotEmpty
|
||||
@Schema(description = "主机分组")
|
||||
private List<Long> groupIdList;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user