Merge branch 'master' of http://git.unissense.tech/tangqk/vdi
commit
b584915bb7
|
|
@ -23,6 +23,7 @@
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<protobuf.version>3.23.4</protobuf.version>
|
<protobuf.version>3.23.4</protobuf.version>
|
||||||
|
<spring-cloud.version>2021.0.5</spring-cloud.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
@ -32,6 +33,11 @@
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring Boot Configuration Processor (可选) -->
|
<!-- Spring Boot Configuration Processor (可选) -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
@ -124,7 +130,19 @@
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-dependencies</artifactId>
|
||||||
|
<version>${spring-cloud.version}</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<extensions>
|
<extensions>
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,14 @@ package com.unisinsight.project;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分片上传应用启动类
|
* 分片上传应用启动类
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@MapperScan(basePackages = "com.unisinsight.project.mapper")
|
@MapperScan(basePackages = "com.unisinsight.project.mapper")
|
||||||
|
@EnableFeignClients(basePackages = "com.unisinsight.project.feign")
|
||||||
public class Application {
|
public class Application {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.unisinsight.project.config;
|
||||||
|
|
||||||
|
import feign.Logger;
|
||||||
|
import feign.Request;
|
||||||
|
import feign.Retryer;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class FeignConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置请求日志级别
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public Logger.Level feignLoggerLevel() {
|
||||||
|
return Logger.Level.FULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置超时时间
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public Request.Options options() {
|
||||||
|
return new Request.Options(5000, 10000); // 连接超时5秒,读取超时10秒
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置重试机制
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public Retryer retryer() {
|
||||||
|
return new Retryer.Default(1000, 2000, 3); // 初始间隔1秒,最大间隔2秒,最多重试3次
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -52,6 +52,7 @@ public class ClientController {
|
||||||
deviceReq.setDeviceName("默认终端");
|
deviceReq.setDeviceName("默认终端");
|
||||||
deviceReq.setDeviceGroupId(3L);
|
deviceReq.setDeviceGroupId(3L);
|
||||||
deviceReq.setDeviceGroupName("默认终端分组");
|
deviceReq.setDeviceGroupName("默认终端分组");
|
||||||
|
deviceReq.setMacAddr(loginReq.getMacAddr());
|
||||||
return deviceService.insert(deviceReq);
|
return deviceService.insert(deviceReq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,6 +109,4 @@ public class ClientController {
|
||||||
hashMap.put("url", "https://intent-bathhouse.name");
|
hashMap.put("url", "https://intent-bathhouse.name");
|
||||||
return Result.successResult(hashMap);
|
return Result.successResult(hashMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,9 @@ package com.unisinsight.project.controller;
|
||||||
|
|
||||||
|
|
||||||
import com.unisinsight.project.entity.dao.NetworkManage;
|
import com.unisinsight.project.entity.dao.NetworkManage;
|
||||||
import com.unisinsight.project.entity.req.DeleteIdReq;
|
|
||||||
import com.unisinsight.project.entity.req.NetworkManagePageReq;
|
import com.unisinsight.project.entity.req.NetworkManagePageReq;
|
||||||
import com.unisinsight.project.entity.req.NetworkManageReq;
|
import com.unisinsight.project.entity.req.NetworkManageReq;
|
||||||
import com.unisinsight.project.entity.req.StoragePoolReq;
|
|
||||||
import com.unisinsight.project.entity.res.PageResult;
|
import com.unisinsight.project.entity.res.PageResult;
|
||||||
import com.unisinsight.project.entity.res.StoragePoolRes;
|
|
||||||
import com.unisinsight.project.exception.Result;
|
import com.unisinsight.project.exception.Result;
|
||||||
import com.unisinsight.project.service.NetworkManageService;
|
import com.unisinsight.project.service.NetworkManageService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
|
@ -30,17 +27,19 @@ public class NetworkManageController {
|
||||||
@Resource
|
@Resource
|
||||||
private NetworkManageService networkManageService;
|
private NetworkManageService networkManageService;
|
||||||
|
|
||||||
@ApiOperation(value = "分页查询镜像")
|
@ApiOperation(value = "分页查询")
|
||||||
@PostMapping("/select/page")
|
@PostMapping("/select/page")
|
||||||
public Result<PageResult<NetworkManage>> selectPage(@RequestBody NetworkManagePageReq networkManagePageReq) {
|
public Result<PageResult<NetworkManage>> selectPage(@RequestBody NetworkManagePageReq networkManagePageReq) {
|
||||||
return Result.successResult(networkManageService.pageNetworkManages(networkManagePageReq));
|
return Result.successResult(networkManageService.pageNetworkManages(networkManagePageReq));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "新增")
|
@ApiOperation(value = "新增")
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public Result<?> addNetworkManage(@Valid @RequestBody NetworkManageReq networkManageReq) {
|
public Result<?> addNetworkManage(@Valid @RequestBody NetworkManageReq networkManageReq) {
|
||||||
networkManageService.addNetworkManage(networkManageReq);
|
networkManageService.addNetworkManage(networkManageReq);
|
||||||
return Result.successResult();
|
return Result.successResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改状态")
|
@ApiOperation(value = "修改状态")
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public Result<?> updateNetworkManage(@RequestBody NetworkManageReq networkManageReq) {
|
public Result<?> updateNetworkManage(@RequestBody NetworkManageReq networkManageReq) {
|
||||||
|
|
@ -57,11 +56,11 @@ public class NetworkManageController {
|
||||||
return Result.successResult();
|
return Result.successResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "同步状态")
|
@ApiOperation(value = "同步数据和状态")
|
||||||
@GetMapping("/synchStatus")
|
@GetMapping("/synchData")
|
||||||
public Result<?> synchStatus() {
|
public Result<?> synchData() {
|
||||||
|
networkManageService.synchData();
|
||||||
return null;
|
return Result.successResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,19 @@
|
||||||
package com.unisinsight.project.controller;
|
package com.unisinsight.project.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import com.unisinsight.project.entity.dao.StoragePool;
|
||||||
import com.unisinsight.project.entity.req.DeleteIdReq;
|
|
||||||
import com.unisinsight.project.entity.req.ImageVirtualMachinesReq;
|
|
||||||
import com.unisinsight.project.entity.req.StoragePoolReq;
|
import com.unisinsight.project.entity.req.StoragePoolReq;
|
||||||
import com.unisinsight.project.entity.res.ImageVirtualMachinesRes;
|
|
||||||
import com.unisinsight.project.entity.res.PageResult;
|
import com.unisinsight.project.entity.res.PageResult;
|
||||||
import com.unisinsight.project.entity.res.StoragePoolRes;
|
|
||||||
import com.unisinsight.project.exception.BaseErrorCode;
|
import com.unisinsight.project.exception.BaseErrorCode;
|
||||||
import com.unisinsight.project.exception.Result;
|
import com.unisinsight.project.exception.Result;
|
||||||
import com.unisinsight.project.service.ImageVirtualMachinesService;
|
import com.unisinsight.project.service.StoragePoolService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Objects;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储池管理
|
* 存储池管理
|
||||||
|
|
@ -28,34 +24,48 @@ import java.util.Objects;
|
||||||
@Api(tags = "存储池类")
|
@Api(tags = "存储池类")
|
||||||
public class StoragePoolController {
|
public class StoragePoolController {
|
||||||
|
|
||||||
@ApiOperation(value = "分页查询镜像")
|
@Resource
|
||||||
|
private StoragePoolService storagePoolService;
|
||||||
|
|
||||||
|
@ApiOperation(value = "分页查询")
|
||||||
@PostMapping("/select/page")
|
@PostMapping("/select/page")
|
||||||
public Result<PageResult<StoragePoolRes>> selectPage(@RequestBody StoragePoolReq storagePoolReq) {
|
public Result<PageResult<StoragePool>> selectPage(@RequestBody StoragePoolReq storagePoolReq) {
|
||||||
return null;
|
return Result.successResult(storagePoolService.pageStoragePools(storagePoolReq));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "新增")
|
@ApiOperation(value = "新增")
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public Result<?> insertImageVirtualMachines(@RequestBody StoragePoolReq storagePoolReq) {
|
public Result<?> insertStoragePool(@Valid @RequestBody StoragePoolReq storagePoolReq) {
|
||||||
return null;
|
storagePoolService.addStoragePool(storagePoolReq);
|
||||||
|
return Result.successResult();
|
||||||
}
|
}
|
||||||
@ApiOperation(value = "修改状态")
|
|
||||||
|
@ApiOperation(value = "修改")
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public Result<?> updateUser(@RequestBody StoragePoolReq storagePoolReq) {
|
public Result<?> updateStoragePool(@RequestBody StoragePoolReq storagePoolReq) {
|
||||||
return null;
|
if (storagePoolService.updateStoragePool(storagePoolReq)) {
|
||||||
|
return Result.successResult();
|
||||||
|
} else {
|
||||||
|
return Result.errorResult(BaseErrorCode.DATABASE_OPERATION_FAILED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "删除")
|
@ApiOperation(value = "删除")
|
||||||
@PostMapping("/delete")
|
@DeleteMapping("/{id}")
|
||||||
public Result<?> delete(@RequestBody DeleteIdReq deleteIdReq) {
|
public Result<?> delete(@PathVariable Long id) {
|
||||||
|
if (storagePoolService.deleteStoragePool(id)) {
|
||||||
|
return Result.successResult();
|
||||||
|
} else {
|
||||||
|
return Result.errorResult(BaseErrorCode.DATABASE_OPERATION_FAILED);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "同步状态")
|
@ApiOperation(value = "同步数据")
|
||||||
@GetMapping("/synchStatus")
|
@GetMapping("/synchData")
|
||||||
public Result<?> synchStatus() {
|
public Result<?> synchData() {
|
||||||
|
storagePoolService.synchData();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ public class NetworkManage {
|
||||||
/**
|
/**
|
||||||
* 网络名称
|
* 网络名称
|
||||||
*/
|
*/
|
||||||
@TableField("name")
|
@TableField("network_name")
|
||||||
private String name;
|
private String networkName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网络类型
|
* 网络类型
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@ public class StoragePool {
|
||||||
/**
|
/**
|
||||||
* 存储池名称
|
* 存储池名称
|
||||||
*/
|
*/
|
||||||
@TableField("name")
|
@TableField("pool_name")
|
||||||
@ApiModelProperty(value = "存储池名称")
|
@ApiModelProperty(value = "存储池名称")
|
||||||
private String name;
|
private String poolName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储池类型
|
* 存储池类型
|
||||||
|
|
@ -47,7 +47,7 @@ public class StoragePool {
|
||||||
*/
|
*/
|
||||||
@TableField("status")
|
@TableField("status")
|
||||||
@ApiModelProperty(value = "状态")
|
@ApiModelProperty(value = "状态")
|
||||||
private Short status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述信息
|
* 描述信息
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,91 @@
|
||||||
|
|
||||||
|
package com.unisinsight.project.entity.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用API响应结果类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(description = "API响应结果")
|
||||||
|
public class ApiResponse<T> implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "响应码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "响应消息")
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "响应数据")
|
||||||
|
private T data;
|
||||||
|
|
||||||
|
public ApiResponse() {}
|
||||||
|
|
||||||
|
public ApiResponse(String code, String message) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ApiResponse(String code, String message, T data) {
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功响应
|
||||||
|
*/
|
||||||
|
public static <T> ApiResponse<T> success() {
|
||||||
|
return new ApiResponse<>("200", "操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> ApiResponse<T> success(T data) {
|
||||||
|
return new ApiResponse<>("200", "操作成功", data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> ApiResponse<T> success(String message, T data) {
|
||||||
|
return new ApiResponse<>("200", message, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失败响应
|
||||||
|
*/
|
||||||
|
public static <T> ApiResponse<T> error(String message) {
|
||||||
|
return new ApiResponse<>("500", message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> ApiResponse<T> error(String code, String message) {
|
||||||
|
return new ApiResponse<>(code, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> ApiResponse<T> error(String code, String message, T data) {
|
||||||
|
return new ApiResponse<>(code, message, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数校验错误
|
||||||
|
*/
|
||||||
|
public static <T> ApiResponse<T> badRequest(String message) {
|
||||||
|
return new ApiResponse<>("400", message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限错误
|
||||||
|
*/
|
||||||
|
public static <T> ApiResponse<T> forbidden(String message) {
|
||||||
|
return new ApiResponse<>("403", message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未找到
|
||||||
|
*/
|
||||||
|
public static <T> ApiResponse<T> notFound(String message) {
|
||||||
|
return new ApiResponse<>("404", message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,150 @@
|
||||||
|
// Network.java - 网络信息对象
|
||||||
|
package com.unisinsight.project.entity.dto;
|
||||||
|
|
||||||
|
public class Network {
|
||||||
|
private String name;
|
||||||
|
private String uuid;
|
||||||
|
private String state;
|
||||||
|
private Integer autostart;
|
||||||
|
private Integer persistent;
|
||||||
|
private String description;
|
||||||
|
private String type;
|
||||||
|
private String bridge;
|
||||||
|
private String bridgeName;
|
||||||
|
private String ipAddress;
|
||||||
|
private String netmask;
|
||||||
|
private String gateway;
|
||||||
|
private String ipRange;
|
||||||
|
private Boolean dhcpEnabled;
|
||||||
|
private String dhcpStart;
|
||||||
|
private String dhcpEnd;
|
||||||
|
|
||||||
|
// Getters and Setters
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(String uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(String state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAutostart() {
|
||||||
|
return autostart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAutostart(Integer autostart) {
|
||||||
|
this.autostart = autostart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPersistent() {
|
||||||
|
return persistent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPersistent(Integer persistent) {
|
||||||
|
this.persistent = persistent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBridge() {
|
||||||
|
return bridge;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBridge(String bridge) {
|
||||||
|
this.bridge = bridge;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBridgeName() {
|
||||||
|
return bridgeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBridgeName(String bridgeName) {
|
||||||
|
this.bridgeName = bridgeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIpAddress() {
|
||||||
|
return ipAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIpAddress(String ipAddress) {
|
||||||
|
this.ipAddress = ipAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNetmask() {
|
||||||
|
return netmask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetmask(String netmask) {
|
||||||
|
this.netmask = netmask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGateway() {
|
||||||
|
return gateway;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGateway(String gateway) {
|
||||||
|
this.gateway = gateway;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIpRange() {
|
||||||
|
return ipRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIpRange(String ipRange) {
|
||||||
|
this.ipRange = ipRange;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getDhcpEnabled() {
|
||||||
|
return dhcpEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDhcpEnabled(Boolean dhcpEnabled) {
|
||||||
|
this.dhcpEnabled = dhcpEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDhcpStart() {
|
||||||
|
return dhcpStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDhcpStart(String dhcpStart) {
|
||||||
|
this.dhcpStart = dhcpStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDhcpEnd() {
|
||||||
|
return dhcpEnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDhcpEnd(String dhcpEnd) {
|
||||||
|
this.dhcpEnd = dhcpEnd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.unisinsight.project.entity.dto;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class NetworkData {
|
||||||
|
private List<Network> networks;
|
||||||
|
private Pagination pagination;
|
||||||
|
|
||||||
|
// Getters and Setters
|
||||||
|
public List<Network> getNetworks() {
|
||||||
|
return networks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNetworks(List<Network> networks) {
|
||||||
|
this.networks = networks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pagination getPagination() {
|
||||||
|
return pagination;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPagination(Pagination pagination) {
|
||||||
|
this.pagination = pagination;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
// Pagination.java - 分页信息对象
|
||||||
|
package com.unisinsight.project.entity.dto;
|
||||||
|
|
||||||
|
public class Pagination {
|
||||||
|
private Integer currentPage;
|
||||||
|
private Integer pageSize;
|
||||||
|
private Integer total;
|
||||||
|
private Integer totalPages;
|
||||||
|
|
||||||
|
// Getters and Setters
|
||||||
|
public Integer getCurrentPage() {
|
||||||
|
return currentPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrentPage(Integer currentPage) {
|
||||||
|
this.currentPage = currentPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPageSize() {
|
||||||
|
return pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPageSize(Integer pageSize) {
|
||||||
|
this.pageSize = pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(Integer total) {
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTotalPages() {
|
||||||
|
return totalPages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPages(Integer totalPages) {
|
||||||
|
this.totalPages = totalPages;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.unisinsight.project.entity.dto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class StoragePoolData {
|
||||||
|
private List<VmStoragePool> items;
|
||||||
|
private Integer total;
|
||||||
|
private Integer page;
|
||||||
|
private Integer pageSize;
|
||||||
|
private Integer totalPages;
|
||||||
|
|
||||||
|
// Getters and Setters
|
||||||
|
public List<VmStoragePool> getItems() {
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItems(List<VmStoragePool> items) {
|
||||||
|
this.items = items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(Integer total) {
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPage() {
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPage(Integer page) {
|
||||||
|
this.page = page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPageSize() {
|
||||||
|
return pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPageSize(Integer pageSize) {
|
||||||
|
this.pageSize = pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTotalPages() {
|
||||||
|
return totalPages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotalPages(Integer totalPages) {
|
||||||
|
this.totalPages = totalPages;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
// StoragePool.java - 存储池信息对象
|
||||||
|
package com.unisinsight.project.entity.dto;
|
||||||
|
|
||||||
|
public class VmStoragePool {
|
||||||
|
private String name;
|
||||||
|
private String uuid;
|
||||||
|
private String state;
|
||||||
|
private Long capacity;
|
||||||
|
private Long allocation;
|
||||||
|
private Long available;
|
||||||
|
private Integer autostart;
|
||||||
|
private Integer persistent;
|
||||||
|
private Integer volumeCount;
|
||||||
|
private String type;
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
// Getters and Setters
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUuid() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUuid(String uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getState() {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setState(String state) {
|
||||||
|
this.state = state;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getCapacity() {
|
||||||
|
return capacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCapacity(Long capacity) {
|
||||||
|
this.capacity = capacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAllocation() {
|
||||||
|
return allocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllocation(Long allocation) {
|
||||||
|
this.allocation = allocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAvailable() {
|
||||||
|
return available;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvailable(Long available) {
|
||||||
|
this.available = available;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAutostart() {
|
||||||
|
return autostart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAutostart(Integer autostart) {
|
||||||
|
this.autostart = autostart;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPersistent() {
|
||||||
|
return persistent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPersistent(Integer persistent) {
|
||||||
|
this.persistent = persistent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getVolumeCount() {
|
||||||
|
return volumeCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVolumeCount(Integer volumeCount) {
|
||||||
|
this.volumeCount = volumeCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPath(String path) {
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -30,5 +30,10 @@ public class LoginReq {
|
||||||
@JsonProperty("token")
|
@JsonProperty("token")
|
||||||
private String token;
|
private String token;
|
||||||
|
|
||||||
|
@ApiModelProperty("mac地址")
|
||||||
|
private String macAddr;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ public class NetworkManagePageReq {
|
||||||
*/
|
*/
|
||||||
@Size(max = 64, message = "网络名称长度不能超过64个字符")
|
@Size(max = 64, message = "网络名称长度不能超过64个字符")
|
||||||
@ApiModelProperty(value = "网络名称", required = true)
|
@ApiModelProperty(value = "网络名称", required = true)
|
||||||
private String name;
|
private String networkName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网络类型
|
* 网络类型
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ public class NetworkManageReq {
|
||||||
@NotBlank(message = "网络名称不能为空")
|
@NotBlank(message = "网络名称不能为空")
|
||||||
@Size(max = 64, message = "网络名称长度不能超过64个字符")
|
@Size(max = 64, message = "网络名称长度不能超过64个字符")
|
||||||
@ApiModelProperty(value = "网络名称", required = true)
|
@ApiModelProperty(value = "网络名称", required = true)
|
||||||
private String name;
|
private String networkName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网络类型
|
* 网络类型
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
|
|
||||||
package com.unisinsight.project.entity.req;
|
package com.unisinsight.project.entity.req;
|
||||||
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.unisinsight.project.entity.dao.StoragePool;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储池
|
* 存储池请求参数
|
||||||
*
|
*
|
||||||
* @author ch
|
* @author ch
|
||||||
* @since 2025-08-25 11:42:52
|
* @since 2025-08-25 11:42:52
|
||||||
|
|
@ -17,34 +17,45 @@ import lombok.Data;
|
||||||
@ApiModel("存储池")
|
@ApiModel("存储池")
|
||||||
public class StoragePoolReq {
|
public class StoragePoolReq {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("自动启动,默认是")
|
||||||
|
private boolean autostart = true;
|
||||||
|
|
||||||
@ApiModelProperty("名称")
|
@ApiModelProperty("名称")
|
||||||
private String name;
|
@NotBlank(message = "名称不能为空")
|
||||||
|
@Size(max = 64, message = "名称长度不能超过64个字符")
|
||||||
|
private String poolName;
|
||||||
|
|
||||||
@ApiModelProperty("类型")
|
@ApiModelProperty("类型")
|
||||||
|
@Size(max = 16, message = "类型长度不能超过16个字符")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
@ApiModelProperty("路劲")
|
@ApiModelProperty("路径")
|
||||||
|
@Size(max = 128, message = "路径长度不能超过128个字符")
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态: 1-活跃,2-关闭
|
* 状态: 1-活跃,2-关闭
|
||||||
**/
|
**/
|
||||||
@ApiModelProperty("状态")
|
@ApiModelProperty("状态")
|
||||||
private String status;
|
private Integer status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询页
|
* 查询页
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "查询页", notes = "分页查询时再传")
|
@ApiModelProperty(value = "查询页", notes = "分页查询时再传")
|
||||||
@JsonProperty("page_num")
|
@JsonProperty("page_num")
|
||||||
private Integer pageNum;
|
@Min(value = 1, message = "页码必须大于0")
|
||||||
|
private Integer pageNum = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 每页数量
|
* 每页数量
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value = "每页数量", notes = "分页查询时再传")
|
@ApiModelProperty(value = "每页数量", notes = "分页查询时再传")
|
||||||
@JsonProperty("page_size")
|
@JsonProperty("page_size")
|
||||||
private Integer pageSize;
|
@Min(value = 1, message = "每页数量必须大于0")
|
||||||
}
|
@Max(value = 100, message = "每页数量不能超过100")
|
||||||
|
private Integer pageSize = 10;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.unisinsight.project.feign;
|
||||||
|
|
||||||
|
import com.unisinsight.project.config.FeignConfig;
|
||||||
|
import com.unisinsight.project.entity.dao.NetworkManage;
|
||||||
|
import com.unisinsight.project.entity.dto.ApiResponse;
|
||||||
|
import com.unisinsight.project.entity.dto.NetworkData;
|
||||||
|
import com.unisinsight.project.entity.dto.StoragePoolData;
|
||||||
|
import com.unisinsight.project.entity.req.NetworkManageReq;
|
||||||
|
import com.unisinsight.project.entity.req.StoragePoolReq;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第三方API客户端
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
name = "external-api-client",
|
||||||
|
url = "${external.api.url:http://10.100.51.118:8000}",
|
||||||
|
configuration = FeignConfig.class
|
||||||
|
)
|
||||||
|
public interface ExternalApiClient {
|
||||||
|
|
||||||
|
@PostMapping("/api/v1/network/create")
|
||||||
|
ApiResponse createNetwork(@RequestBody NetworkManageReq networkManageReq);
|
||||||
|
|
||||||
|
@DeleteMapping("/api/v1/network/{network_name}")
|
||||||
|
ApiResponse deleteNetwork(@PathVariable("network_name") String networkName);
|
||||||
|
|
||||||
|
@PostMapping("/api/v1/network/update")
|
||||||
|
ApiResponse updateNetwork(@RequestBody NetworkManageReq networkManageReq);
|
||||||
|
|
||||||
|
@PostMapping("/api/v1/network/start")
|
||||||
|
ApiResponse startNetwork(@RequestBody NetworkManageReq networkManageReq);
|
||||||
|
|
||||||
|
@PostMapping("/api/v1/network/stop")
|
||||||
|
ApiResponse stopNetwork(@RequestBody NetworkManageReq networkManageReq);
|
||||||
|
|
||||||
|
@PostMapping("/api/v1/storage/pools")
|
||||||
|
ApiResponse createStorage(@RequestBody StoragePoolReq storagePoolReq);
|
||||||
|
|
||||||
|
@PostMapping("/api/v1/storage/pools/start")
|
||||||
|
ApiResponse startStorage(@RequestBody StoragePoolReq storagePoolReq);
|
||||||
|
|
||||||
|
@PostMapping("/api/v1/storage/pools/stop")
|
||||||
|
ApiResponse stopStorage(@RequestBody StoragePoolReq storagePoolReq);
|
||||||
|
|
||||||
|
@DeleteMapping("/api/v1/storage/pools/{pool_name}")
|
||||||
|
ApiResponse deleteStorage(@PathVariable("pool_name") String poolName);
|
||||||
|
|
||||||
|
@GetMapping("/api/v1/network/list")
|
||||||
|
ApiResponse<NetworkData> list(@RequestParam("page")int page, @RequestParam("page_size")int pageSize);
|
||||||
|
|
||||||
|
@GetMapping("/api/v1/storage/pools")
|
||||||
|
ApiResponse<StoragePoolData> listStorage(@RequestParam("page")int page, @RequestParam("page_size")int pageSize);
|
||||||
|
}
|
||||||
|
|
@ -61,4 +61,6 @@ public interface NetworkManageService {
|
||||||
* @return Page<NetworkManage> 分页结果
|
* @return Page<NetworkManage> 分页结果
|
||||||
*/
|
*/
|
||||||
PageResult<NetworkManage> pageNetworkManages(NetworkManagePageReq networkManagePageReq);
|
PageResult<NetworkManage> pageNetworkManages(NetworkManagePageReq networkManagePageReq);
|
||||||
|
|
||||||
|
void synchData();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.unisinsight.project.service;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.unisinsight.project.entity.dao.StoragePool;
|
import com.unisinsight.project.entity.dao.StoragePool;
|
||||||
import com.unisinsight.project.entity.req.StoragePoolReq;
|
import com.unisinsight.project.entity.req.StoragePoolReq;
|
||||||
|
import com.unisinsight.project.entity.res.PageResult;
|
||||||
|
import com.unisinsight.project.entity.res.StoragePoolRes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储池服务接口
|
* 存储池服务接口
|
||||||
|
|
@ -12,18 +14,18 @@ public interface StoragePoolService {
|
||||||
/**
|
/**
|
||||||
* 新增存储池
|
* 新增存储池
|
||||||
*
|
*
|
||||||
* @param storagePool 存储池对象
|
* @param storagePoolReq
|
||||||
* @return StoragePool 返回新增的存储池对象
|
* @return StoragePool 返回新增的存储池对象
|
||||||
*/
|
*/
|
||||||
StoragePool addStoragePool(StoragePool storagePool);
|
StoragePool addStoragePool(StoragePoolReq storagePoolReq);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID更新存储池信息
|
* 根据ID更新存储池信息
|
||||||
*
|
*
|
||||||
* @param storagePool 存储池对象
|
* @param storagePoolReq
|
||||||
* @return boolean 是否更新成功
|
* @return boolean 是否更新成功
|
||||||
*/
|
*/
|
||||||
boolean updateStoragePool(StoragePool storagePool);
|
boolean updateStoragePool(StoragePoolReq storagePoolReq);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID删除存储池
|
* 根据ID删除存储池
|
||||||
|
|
@ -44,12 +46,10 @@ public interface StoragePoolService {
|
||||||
/**
|
/**
|
||||||
* 分页查询存储池列表
|
* 分页查询存储池列表
|
||||||
*
|
*
|
||||||
* @param currentPage 当前页码
|
* @param storagePoolReq
|
||||||
* @param pageSize 每页大小
|
|
||||||
* @param name 存储池名称(可选查询条件)
|
|
||||||
* @param type 存储池类型(可选查询条件)
|
|
||||||
* @param status 存储池状态(可选查询条件)
|
|
||||||
* @return Page<StoragePool> 分页结果
|
* @return Page<StoragePool> 分页结果
|
||||||
*/
|
*/
|
||||||
Page<StoragePool> pageStoragePools(StoragePoolReq storagePoolReq);
|
PageResult<StoragePool> pageStoragePools(StoragePoolReq storagePoolReq);
|
||||||
|
|
||||||
|
void synchData();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,25 @@
|
||||||
package com.unisinsight.project.service.impl;
|
package com.unisinsight.project.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.exceptions.CheckedUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.unisinsight.project.entity.dao.NetworkManage;
|
import com.unisinsight.project.entity.dao.NetworkManage;
|
||||||
|
import com.unisinsight.project.entity.dto.ApiResponse;
|
||||||
|
import com.unisinsight.project.entity.dto.Network;
|
||||||
|
import com.unisinsight.project.entity.dto.NetworkData;
|
||||||
import com.unisinsight.project.entity.req.NetworkManagePageReq;
|
import com.unisinsight.project.entity.req.NetworkManagePageReq;
|
||||||
import com.unisinsight.project.entity.req.NetworkManageReq;
|
import com.unisinsight.project.entity.req.NetworkManageReq;
|
||||||
import com.unisinsight.project.entity.res.PageResult;
|
import com.unisinsight.project.entity.res.PageResult;
|
||||||
import com.unisinsight.project.exception.BusinessException;
|
import com.unisinsight.project.exception.BusinessException;
|
||||||
|
import com.unisinsight.project.feign.ExternalApiClient;
|
||||||
import com.unisinsight.project.mapper.NetworkManageMapper;
|
import com.unisinsight.project.mapper.NetworkManageMapper;
|
||||||
import com.unisinsight.project.service.NetworkManageService;
|
import com.unisinsight.project.service.NetworkManageService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -24,19 +29,32 @@ import java.util.List;
|
||||||
@Service
|
@Service
|
||||||
public class NetworkManageServiceImpl extends ServiceImpl<NetworkManageMapper, NetworkManage> implements NetworkManageService {
|
public class NetworkManageServiceImpl extends ServiceImpl<NetworkManageMapper, NetworkManage> implements NetworkManageService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExternalApiClient client;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增网络管理信息
|
* 新增网络管理信息
|
||||||
*
|
*
|
||||||
* @param networkManageReq
|
* @param networkManageReq
|
||||||
* @return NetworkManage 返回新增的网络管理对象
|
* @return NetworkManage 返回新增的网络管理对象
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public NetworkManage addNetworkManage(NetworkManageReq networkManageReq) {
|
public NetworkManage addNetworkManage(NetworkManageReq networkManageReq) {
|
||||||
// 检查名称是否重复
|
// 检查名称是否重复
|
||||||
QueryWrapper<NetworkManage> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<NetworkManage> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("name", networkManageReq.getName());
|
queryWrapper.eq("name", networkManageReq.getNetworkName());
|
||||||
if (this.count(queryWrapper) > 0) {
|
if (this.count(queryWrapper) > 0) {
|
||||||
throw new BusinessException("网络名称'" + networkManageReq.getName() + "'已存在,请使用其他名称");
|
throw new BusinessException("网络名称'" + networkManageReq.getNetworkName() + "'已存在,请使用其他名称");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用虚拟机创建存储池
|
||||||
|
try {
|
||||||
|
ApiResponse response = client.createNetwork(networkManageReq);
|
||||||
|
if (!"200".equals(response.getCode())) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + e.getMessage());
|
||||||
}
|
}
|
||||||
// 设置创建时间和更新时间
|
// 设置创建时间和更新时间
|
||||||
NetworkManage networkManage = new NetworkManage();
|
NetworkManage networkManage = new NetworkManage();
|
||||||
|
|
@ -53,7 +71,7 @@ public class NetworkManageServiceImpl extends ServiceImpl<NetworkManageMapper, N
|
||||||
/**
|
/**
|
||||||
* 根据ID更新网络管理信息
|
* 根据ID更新网络管理信息
|
||||||
*
|
*
|
||||||
* @param networkManageReq
|
* @param networkManageReq
|
||||||
* @return boolean 是否更新成功
|
* @return boolean 是否更新成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -66,18 +84,43 @@ public class NetworkManageServiceImpl extends ServiceImpl<NetworkManageMapper, N
|
||||||
// 修改名称
|
// 修改名称
|
||||||
existing.setUpdateTime(new Date());
|
existing.setUpdateTime(new Date());
|
||||||
// 如果名称不为空且与原名称不同,则进行重名校验
|
// 如果名称不为空且与原名称不同,则进行重名校验
|
||||||
if (networkManageReq.getName() != null && !networkManageReq.getName().isEmpty()
|
if (networkManageReq.getNetworkName() != null && !networkManageReq.getNetworkName().isEmpty()
|
||||||
&& !networkManageReq.getName().equals(existing.getName())) {
|
&& !networkManageReq.getNetworkName().equals(existing.getNetworkName())) {
|
||||||
// 检查新名称是否重复
|
// 检查新名称是否重复
|
||||||
QueryWrapper<NetworkManage> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<NetworkManage> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("name", networkManageReq.getName());
|
queryWrapper.eq("name", networkManageReq.getNetworkName());
|
||||||
if (this.count(queryWrapper) > 0) {
|
if (this.count(queryWrapper) > 0) {
|
||||||
throw new BusinessException("网络名称'" + networkManageReq.getName() + "'已存在,请使用其他名称");
|
throw new BusinessException("网络名称'" + networkManageReq.getNetworkName() + "'已存在,请使用其他名称");
|
||||||
}
|
}
|
||||||
existing.setName(networkManageReq.getName());
|
existing.setNetworkName(networkManageReq.getNetworkName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 调用虚拟机创建存储池
|
||||||
|
try {
|
||||||
|
ApiResponse response = client.updateNetwork(networkManageReq);
|
||||||
|
if (!"200".equals(response.getCode())) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
// 修改状态
|
// 修改状态
|
||||||
if(networkManageReq.getStatus() != null ){
|
if (networkManageReq.getStatus() != null) {
|
||||||
|
try {
|
||||||
|
networkManageReq.setNetworkName(existing.getNetworkName());
|
||||||
|
ApiResponse response;
|
||||||
|
if (1 == networkManageReq.getStatus()) {
|
||||||
|
response = client.startNetwork(networkManageReq);
|
||||||
|
} else {
|
||||||
|
response = client.stopNetwork(networkManageReq);
|
||||||
|
}
|
||||||
|
if (!"200".equals(response.getCode())) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + e.getMessage());
|
||||||
|
}
|
||||||
existing.setStatus(networkManageReq.getStatus());
|
existing.setStatus(networkManageReq.getStatus());
|
||||||
}
|
}
|
||||||
return this.updateById(existing);
|
return this.updateById(existing);
|
||||||
|
|
@ -90,8 +133,19 @@ public class NetworkManageServiceImpl extends ServiceImpl<NetworkManageMapper, N
|
||||||
* @return boolean 是否删除成功
|
* @return boolean 是否删除成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public boolean deleteNetworkManage(Integer id) {
|
public boolean deleteNetworkManage(Integer id) {
|
||||||
|
NetworkManage existing = this.getById(id);
|
||||||
|
if (existing == null) {
|
||||||
|
throw new BusinessException("网络管理信息不存在");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
ApiResponse response = client.deleteNetwork(existing.getNetworkName());
|
||||||
|
if (!"200".equals(response.getCode())) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + e.getMessage());
|
||||||
|
}
|
||||||
return this.removeById(id);
|
return this.removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,8 +199,8 @@ public class NetworkManageServiceImpl extends ServiceImpl<NetworkManageMapper, N
|
||||||
QueryWrapper<NetworkManage> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<NetworkManage> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
// 添加查询条件
|
// 添加查询条件
|
||||||
if (pageReq.getName() != null && !pageReq.getName().isEmpty()) {
|
if (pageReq.getNetworkName() != null && !pageReq.getNetworkName().isEmpty()) {
|
||||||
queryWrapper.like("name", pageReq.getName());
|
queryWrapper.like("network_name", pageReq.getNetworkName());
|
||||||
}
|
}
|
||||||
if (pageReq.getType() != null && !pageReq.getType().isEmpty()) {
|
if (pageReq.getType() != null && !pageReq.getType().isEmpty()) {
|
||||||
queryWrapper.eq("type", pageReq.getType());
|
queryWrapper.eq("type", pageReq.getType());
|
||||||
|
|
@ -160,5 +214,41 @@ public class NetworkManageServiceImpl extends ServiceImpl<NetworkManageMapper, N
|
||||||
|
|
||||||
// 转换为 PageResult
|
// 转换为 PageResult
|
||||||
return PageResult.convertPage(resultPage, NetworkManage.class);
|
return PageResult.convertPage(resultPage, NetworkManage.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 从虚拟机同步网络数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void synchData() {
|
||||||
|
ApiResponse<NetworkData> response;
|
||||||
|
try {
|
||||||
|
response = client.list(1, 100);
|
||||||
|
if (!"200".equals(response.getCode())) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Network> networkList = response.getData().getNetworks();
|
||||||
|
if (CollectionUtils.isEmpty(networkList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<NetworkManage> networkManageList = new ArrayList<>();
|
||||||
|
for (Network network : networkList) {
|
||||||
|
NetworkManage networkManage = new NetworkManage();
|
||||||
|
BeanUtils.copyProperties(network, networkManage);
|
||||||
|
networkManage.setNetworkName(network.getName());
|
||||||
|
networkManage.setStatus("active".equals(network.getState()) ? 1 : 2);
|
||||||
|
networkManageList.add(networkManage);
|
||||||
|
}
|
||||||
|
// 清空数据并重新插入
|
||||||
|
this.remove(new QueryWrapper<>());
|
||||||
|
this.saveOrUpdateBatch(networkManageList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,24 @@ package com.unisinsight.project.service.impl;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.unisinsight.project.entity.dao.NetworkManage;
|
||||||
import com.unisinsight.project.entity.dao.StoragePool;
|
import com.unisinsight.project.entity.dao.StoragePool;
|
||||||
|
import com.unisinsight.project.entity.dto.*;
|
||||||
import com.unisinsight.project.entity.req.StoragePoolReq;
|
import com.unisinsight.project.entity.req.StoragePoolReq;
|
||||||
|
import com.unisinsight.project.entity.res.PageResult;
|
||||||
|
import com.unisinsight.project.exception.BusinessException;
|
||||||
|
import com.unisinsight.project.feign.ExternalApiClient;
|
||||||
import com.unisinsight.project.mapper.StoragePoolMapper;
|
import com.unisinsight.project.mapper.StoragePoolMapper;
|
||||||
import com.unisinsight.project.service.StoragePoolService;
|
import com.unisinsight.project.service.StoragePoolService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储池服务实现类
|
* 存储池服务实现类
|
||||||
|
|
@ -18,17 +28,40 @@ import java.util.Date;
|
||||||
@Service
|
@Service
|
||||||
public class StoragePoolServiceImpl extends ServiceImpl<StoragePoolMapper, StoragePool> implements StoragePoolService {
|
public class StoragePoolServiceImpl extends ServiceImpl<StoragePoolMapper, StoragePool> implements StoragePoolService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ExternalApiClient client;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增存储池
|
* 新增存储池
|
||||||
*
|
*
|
||||||
* @param storagePool 存储池对象
|
* @param storagePoolReq
|
||||||
* @return StoragePool 返回新增的存储池对象
|
* @return StoragePool 返回新增的存储池对象
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
public StoragePool addStoragePool(StoragePoolReq storagePoolReq) {
|
||||||
public StoragePool addStoragePool(StoragePool storagePool) {
|
// 检查名称是否重复
|
||||||
|
QueryWrapper<StoragePool> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("name", storagePoolReq.getPoolName());
|
||||||
|
if (this.count(queryWrapper) > 0) {
|
||||||
|
throw new BusinessException("存储池名称'" + storagePoolReq.getPoolName() + "'已存在,请使用其他名称");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用虚拟机创建存储池
|
||||||
|
try {
|
||||||
|
ApiResponse response = client.createStorage(storagePoolReq);
|
||||||
|
if (!"200".equals(response.getCode())) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 本地保存
|
||||||
|
StoragePool storagePool = new StoragePool();
|
||||||
|
BeanUtils.copyProperties(storagePoolReq, storagePool);
|
||||||
storagePool.setCreateTime(new Date());
|
storagePool.setCreateTime(new Date());
|
||||||
storagePool.setUpdateTime(new Date());
|
storagePool.setUpdateTime(new Date());
|
||||||
|
storagePool.setStatus(1);
|
||||||
this.save(storagePool);
|
this.save(storagePool);
|
||||||
return storagePool;
|
return storagePool;
|
||||||
}
|
}
|
||||||
|
|
@ -36,18 +69,51 @@ public class StoragePoolServiceImpl extends ServiceImpl<StoragePoolMapper, Stora
|
||||||
/**
|
/**
|
||||||
* 根据ID更新存储池信息
|
* 根据ID更新存储池信息
|
||||||
*
|
*
|
||||||
* @param storagePool 存储池对象
|
* @param storagePoolReq
|
||||||
* @return boolean 是否更新成功
|
* @return boolean 是否更新成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
public boolean updateStoragePool(StoragePoolReq storagePoolReq) {
|
||||||
public boolean updateStoragePool(StoragePool storagePool) {
|
StoragePool existing = this.getById(storagePoolReq.getId());
|
||||||
StoragePool existing = this.getById(storagePool.getId());
|
|
||||||
if (existing == null) {
|
if (existing == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
storagePool.setUpdateTime(new Date());
|
|
||||||
return this.updateById(storagePool);
|
// 不能修改名称
|
||||||
|
// 如果名称不为空且与原名称不同,则进行重名校验
|
||||||
|
// if (storagePoolReq.getName() != null && !storagePoolReq.getName().isEmpty()
|
||||||
|
// && !storagePoolReq.getName().equals(existing.getName())) {
|
||||||
|
// // 检查新名称是否重复
|
||||||
|
// QueryWrapper<StoragePool> queryWrapper = new QueryWrapper<>();
|
||||||
|
// queryWrapper.eq("name", storagePoolReq.getName());
|
||||||
|
// if (this.count(queryWrapper) > 0) {
|
||||||
|
// throw new BusinessException("存储池名称'" + storagePoolReq.getName() + "'已存在,请使用其他名称");
|
||||||
|
// }
|
||||||
|
// existing.setName(storagePoolReq.getName());
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 调用虚拟机创建存储池
|
||||||
|
// 修改状态
|
||||||
|
if (storagePoolReq.getStatus() != null) {
|
||||||
|
try {
|
||||||
|
storagePoolReq.setPoolName(existing.getPoolName());
|
||||||
|
ApiResponse response;
|
||||||
|
if (1 == storagePoolReq.getStatus()) {
|
||||||
|
response = client.startStorage(storagePoolReq);
|
||||||
|
} else {
|
||||||
|
response = client.stopStorage(storagePoolReq);
|
||||||
|
}
|
||||||
|
if (!"200".equals(response.getCode())) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
existing.setStatus(storagePoolReq.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
existing.setUpdateTime(new Date());
|
||||||
|
return this.updateById(existing);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -59,6 +125,19 @@ public class StoragePoolServiceImpl extends ServiceImpl<StoragePoolMapper, Stora
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean deleteStoragePool(Long id) {
|
public boolean deleteStoragePool(Long id) {
|
||||||
|
StoragePool existing = this.getById(id);
|
||||||
|
if (existing == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
ApiResponse response = client.deleteStorage(existing.getPoolName());
|
||||||
|
if (!"200".equals(response.getCode())) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
return this.removeById(id);
|
return this.removeById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -76,21 +155,17 @@ public class StoragePoolServiceImpl extends ServiceImpl<StoragePoolMapper, Stora
|
||||||
/**
|
/**
|
||||||
* 分页查询存储池列表
|
* 分页查询存储池列表
|
||||||
*
|
*
|
||||||
* @param currentPage 当前页码
|
* @param storagePoolReq
|
||||||
* @param pageSize 每页大小
|
|
||||||
* @param name 存储池名称(可选查询条件)
|
|
||||||
* @param type 存储池类型(可选查询条件)
|
|
||||||
* @param status 存储池状态(可选查询条件)
|
|
||||||
* @return Page<StoragePool> 分页结果
|
* @return Page<StoragePool> 分页结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Page<StoragePool> pageStoragePools(StoragePoolReq storagePoolReq) {
|
public PageResult<StoragePool> pageStoragePools(StoragePoolReq storagePoolReq) {
|
||||||
Page<StoragePool> page = new Page<>(storagePoolReq.getPageNum(), storagePoolReq.getPageSize());
|
Page<StoragePool> page = new Page<>(storagePoolReq.getPageNum(), storagePoolReq.getPageSize());
|
||||||
QueryWrapper<StoragePool> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<StoragePool> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
// 添加查询条件
|
// 添加查询条件
|
||||||
if (storagePoolReq.getName() != null && !storagePoolReq.getName().isEmpty()) {
|
if (storagePoolReq.getPoolName() != null && !storagePoolReq.getPoolName().isEmpty()) {
|
||||||
queryWrapper.like("name", storagePoolReq.getName());
|
queryWrapper.like("pool_name", storagePoolReq.getPoolName());
|
||||||
}
|
}
|
||||||
if (storagePoolReq.getType() != null && !storagePoolReq.getType().isEmpty()) {
|
if (storagePoolReq.getType() != null && !storagePoolReq.getType().isEmpty()) {
|
||||||
queryWrapper.eq("type", storagePoolReq.getType());
|
queryWrapper.eq("type", storagePoolReq.getType());
|
||||||
|
|
@ -100,6 +175,39 @@ public class StoragePoolServiceImpl extends ServiceImpl<StoragePoolMapper, Stora
|
||||||
}
|
}
|
||||||
|
|
||||||
queryWrapper.orderByDesc("create_time");
|
queryWrapper.orderByDesc("create_time");
|
||||||
return this.page(page, queryWrapper);
|
|
||||||
|
Page<StoragePool> resultPage = this.page(page, queryWrapper);
|
||||||
|
return PageResult.convertPage(resultPage, StoragePool.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void synchData() {
|
||||||
|
ApiResponse<StoragePoolData> response;
|
||||||
|
try {
|
||||||
|
response = client.listStorage(1, 100);
|
||||||
|
if (!"200".equals(response.getCode())) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + response.getMessage());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new BusinessException("调用外部接口失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<VmStoragePool> vmStoragePoolList = response.getData().getItems();
|
||||||
|
if (CollectionUtils.isEmpty(vmStoragePoolList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
List<StoragePool> networkManageList = new ArrayList<>();
|
||||||
|
for (VmStoragePool vmStoragePool : vmStoragePoolList) {
|
||||||
|
StoragePool storagePool = new StoragePool();
|
||||||
|
BeanUtils.copyProperties(vmStoragePool, storagePool);
|
||||||
|
storagePool.setPoolName(vmStoragePool.getName());
|
||||||
|
storagePool.setStatus("active".equals(vmStoragePool.getState()) ? 1 : 2);
|
||||||
|
networkManageList.add(storagePool);
|
||||||
|
}
|
||||||
|
// 清空数据并重新插入
|
||||||
|
this.remove(new QueryWrapper<>());
|
||||||
|
this.saveOrUpdateBatch(networkManageList);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,4 +55,19 @@ mybatis-plus:
|
||||||
grpc:
|
grpc:
|
||||||
server:
|
server:
|
||||||
# 指定Grpc暴露的端口,后续客户端通过这个端口访问
|
# 指定Grpc暴露的端口,后续客户端通过这个端口访问
|
||||||
port: 51051
|
port: 51051
|
||||||
|
|
||||||
|
# Feign 配置
|
||||||
|
feign:
|
||||||
|
client:
|
||||||
|
config:
|
||||||
|
external-api-client: # 对应 FeignClient 的 name
|
||||||
|
logger-level: full # 完整日志级别
|
||||||
|
default: # 全局默认配置
|
||||||
|
logger-level: basic
|
||||||
|
|
||||||
|
# 日志配置
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.unisinsight.project.feign: debug # Feign 客户端包路径
|
||||||
|
com.unisinsight.project.feign.ExternalApiClient: debug
|
||||||
Loading…
Reference in New Issue