前端请求接收bug修复
This commit is contained in:
16
pom.xml
16
pom.xml
@ -103,7 +103,11 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>2.15.3</version>
|
||||
</dependency>
|
||||
<!-- 测试依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@ -182,6 +186,16 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.38</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>1.5.5.Final</version>
|
||||
</path>
|
||||
<path>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok-mapstruct-binding</artifactId>
|
||||
<version>0.2.0</version>
|
||||
</path>
|
||||
</annotationProcessorPaths>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -13,7 +13,7 @@ import java.util.List;
|
||||
public class GpuResourceController {
|
||||
@Autowired
|
||||
private GpuManageService gpuManageService;
|
||||
@PostMapping
|
||||
@PostMapping(value = "/add", produces = "application/json")
|
||||
public ResponseVO addGpu(@Valid @RequestBody GpuCreateDTO dto){
|
||||
return gpuManageService.createGpuResource(dto);
|
||||
}
|
||||
|
@ -4,49 +4,20 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.sf.jsqlparser.expression.DateTimeLiteralExpression;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
@Setter
|
||||
@Data
|
||||
public class GpuResource {
|
||||
@Getter
|
||||
@TableField("GPUId")
|
||||
private Long GPUId;
|
||||
|
||||
@Getter
|
||||
@TableField("GPUModel")
|
||||
private String GPUModel;
|
||||
|
||||
public Integer getGPUMemorySize() {
|
||||
return GPUMemorySize;
|
||||
}
|
||||
|
||||
public Long getGPUId() {
|
||||
return GPUId;
|
||||
}
|
||||
|
||||
public String getGPUModel() {
|
||||
return GPUModel;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return Ip;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreateTime() {
|
||||
return CreateTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdateTime() {
|
||||
return UpdateTime;
|
||||
}
|
||||
|
||||
public Integer getGPUMaxMemory() {
|
||||
return GPUMaxMemory;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@TableField("GPUMemorySize")
|
||||
private Integer GPUMemorySize;
|
||||
|
||||
@ -56,15 +27,12 @@ public class GpuResource {
|
||||
@TableField("Ip")
|
||||
private String Ip;
|
||||
|
||||
@Getter
|
||||
@TableField("CreatedTime")
|
||||
private LocalDateTime CreateTime;
|
||||
|
||||
@Getter
|
||||
@TableField("update_time")
|
||||
private LocalDateTime UpdateTime;
|
||||
|
||||
@Getter
|
||||
@TableField("GPUMaxMemory")
|
||||
private Integer GPUMaxMemory;
|
||||
|
||||
@ -93,6 +61,30 @@ public class GpuResource {
|
||||
|
||||
public GpuResource() {}
|
||||
|
||||
public Integer getGPUMemorySize() {
|
||||
return GPUMemorySize;
|
||||
}
|
||||
|
||||
public Long getGPUId() {
|
||||
return GPUId;
|
||||
}
|
||||
|
||||
public String getGPUModel() {
|
||||
return GPUModel;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return Ip;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreateTime() {
|
||||
return CreateTime;
|
||||
}
|
||||
|
||||
public Integer getGPUMaxMemory() {
|
||||
return GPUMaxMemory;
|
||||
}
|
||||
|
||||
public void setGPUId(Long GPUId) {
|
||||
this.GPUId = GPUId;
|
||||
}
|
||||
@ -117,9 +109,5 @@ public class GpuResource {
|
||||
CreateTime = createTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(LocalDateTime updateTime) {
|
||||
UpdateTime = updateTime;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import java.util.Map;
|
||||
public interface GpuResourceDao {
|
||||
//---------------------- 基础CRUD ------------------------
|
||||
@Insert("INSERT INTO Ipz.public.gpu_resource (GPUModel, GPUMemorySize, Ip) " +
|
||||
"VALUES (#{model}, #{memory}, #{ip})")
|
||||
"VALUES (#{GPUModel}, #{GPUMemorySize}, #{Ip})")
|
||||
@Options(useGeneratedKeys = true, keyProperty = "GPUId")
|
||||
Integer insert(GpuResource entity);
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.bipt.intelligentapplicationorchestrationservice.pojo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Pattern;
|
||||
@ -14,14 +15,17 @@ public class GpuCreateDTO {
|
||||
@NotBlank(message = "GPU型号不能为空")
|
||||
@Pattern(regexp = "^([A-Z][A-Z0-9-]+)-\\w+",
|
||||
message = "型号格式应为 [厂商(大写字母开头)]-[型号],如 Intel-Xe_GPU")
|
||||
@JsonProperty("GPUModel") // 显示指定JSON映射名称
|
||||
private String GPUModel;
|
||||
|
||||
@NotNull(message = "显存容量不能为空")
|
||||
@JsonProperty("GPUMemorySize")
|
||||
private Integer GPUMemorySize;
|
||||
|
||||
@NotBlank(message = "IP地址不能为空")
|
||||
@Pattern(regexp = "^\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}\\\\.\\\\d{1,3}$",
|
||||
@Pattern(regexp = "^(\\d{1,3}\\.){3}\\d{1,3}$",
|
||||
message = "IP地址格式无效")
|
||||
@JsonProperty("Ip") // 显示指定JSON映射名称
|
||||
private String Ip;
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ spring.datasource.driver-class-name=com.kingbase8.Driver
|
||||
spring.datasource.hikari.maximum-pool-size=10
|
||||
spring.datasource.hikari.minimum-idle=5
|
||||
spring.datasource.hikari.connection-timeout=30000
|
||||
spring.mvc.contentnegotiation.default-content-type=application/json
|
||||
|
||||
# MyBatis??
|
||||
mybatis.mapper-locations=classpath:mapper/*.xml
|
||||
|
Reference in New Issue
Block a user