Skip to content

Commit e22da57

Browse files
committed
fix: update lockCanvas,parameter validation
1 parent 5767ff4 commit e22da57

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/src/main/java/com/tinyengine/it/service/app/impl/CanvasServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public Result<CanvasDto> lockCanvas(Integer id, String state, String type) {
4848
if(id== null){
4949
return Result.failed("id can not be null");
5050
}
51-
if(isNull(state) || isNull(type)){
51+
if(!isNotBlank(state) || !isNotBlank(type)){
5252
return Result.failed("invalid parameter");
5353
}
5454
String occupier = null;
@@ -100,7 +100,7 @@ public Result<CanvasDto> lockCanvas(Integer id, String state, String type) {
100100
canvasDto.setOccupier(occupierValue);
101101
return Result.success(canvasDto);
102102
}
103-
public static boolean isNull(String str) {
103+
public static boolean isNotBlank(String str) {
104104
return str != null && !str.trim().isEmpty();
105105
}
106106
private Boolean isCanDoIt(String occupier, User user) {

0 commit comments

Comments
 (0)