|
@@ -17,12 +17,12 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
/**
|
|
|
-* 场站接口
|
|
|
-*
|
|
|
-* @author xsl
|
|
|
-* @since 2023/03/13
|
|
|
-*/
|
|
|
- @RestController
|
|
|
+ * 场站接口
|
|
|
+ *
|
|
|
+ * @author xsl
|
|
|
+ * @since 2023/03/13
|
|
|
+ */
|
|
|
+@RestController
|
|
|
@RequestMapping("/electricField")
|
|
|
@Slf4j
|
|
|
public class ElectricFieldController {
|
|
@@ -76,7 +76,9 @@ public class ElectricFieldController {
|
|
|
|
|
|
|
|
|
String pattern = "^[0-9]{1,8}+\\.{0,1}[0-9]{0,2}$";
|
|
|
- if (!electricField.getCapacity().toString().matches(pattern)){
|
|
|
+ if (electricField.getCapacity() == null) {
|
|
|
+ return ResponseVO.fail("装机容量不能为空!");
|
|
|
+ } else if (!electricField.getCapacity().toString().matches(pattern)) {
|
|
|
return ResponseVO.fail("装机容量整数位不能超过8位,小数位不能超过2位!");
|
|
|
}
|
|
|
|