Commit a8496dca by huangfusuper

Merge remote-tracking branch 'origin/developer' into developer

parents ee35f83e 59fd0992
...@@ -28,4 +28,10 @@ public class ApiWorkspaceController { ...@@ -28,4 +28,10 @@ public class ApiWorkspaceController {
workspaceService.add(workspaceName); workspaceService.add(workspaceName);
return "SUCCESS"; return "SUCCESS";
} }
@PostMapping("exist")
@ApiOperation("是否存在")
public Boolean exist(String workspaceName){
return workspaceService.exist(workspaceName);
}
} }
...@@ -7,4 +7,11 @@ package com.byit.service; ...@@ -7,4 +7,11 @@ package com.byit.service;
*/ */
public interface ApiWorkspaceService { public interface ApiWorkspaceService {
void add(String workspaceName); void add(String workspaceName);
/**
* 判断工作空间是否存在
* @param workspaceName
* @return
*/
Boolean exist(String workspaceName);
} }
...@@ -682,7 +682,7 @@ public class ApiFlowServiceImpl implements ApiFlowService { ...@@ -682,7 +682,7 @@ public class ApiFlowServiceImpl implements ApiFlowService {
public RunRecordingVo loadScheduleLog(String param) { public RunRecordingVo loadScheduleLog(String param) {
ValidationUtil.dataNotBank(param, "请求参数不允许为空!"); ValidationUtil.dataNotBank(param, "请求参数不允许为空!");
JSONObject jsonObject = JSON.parseObject(param); JSONObject jsonObject = JSON.parseObject(param);
String runId = jsonObject.getString("runId0"); String runId = jsonObject.getString("runId");
ValidationUtil.dataNotBank(runId, "运行实例不允许为空!"); ValidationUtil.dataNotBank(runId, "运行实例不允许为空!");
String flowName = jsonObject.getString("flowName"); String flowName = jsonObject.getString("flowName");
ValidationUtil.dataNotBank(flowName, "工作流名称不允许为空!"); ValidationUtil.dataNotBank(flowName, "工作流名称不允许为空!");
......
...@@ -32,4 +32,14 @@ public class ApiWorkspaceServiceImpl implements ApiWorkspaceService { ...@@ -32,4 +32,14 @@ public class ApiWorkspaceServiceImpl implements ApiWorkspaceService {
workspace.setAddTime(new Date()); workspace.setAddTime(new Date());
workspaceMapper.insertSelective(workspace); workspaceMapper.insertSelective(workspace);
} }
@Override
public Boolean exist(String workspaceName) {
ValidationUtil.dataNotBank(workspaceName, "工作空间名称不允许为空!");
Workspace workspace = workspaceMapper.getByName(workspaceName);
if (null == workspace){
return true;
}
return false;
}
} }
package com.byit.job.utils; package com.byit.job.utils;
import com.sun.istack.internal.Nullable; import com.byit.annotation.annotationselector.NotNull;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.time.*; import java.time.*;
...@@ -21,7 +21,7 @@ public class DateUtil { ...@@ -21,7 +21,7 @@ public class DateUtil {
* @param formatStr 转换格式 * @param formatStr 转换格式
* @return 标准的时间格式 * @return 标准的时间格式
*/ */
public static String dateFormat(Date date,@Nullable String formatStr){ public static String dateFormat(Date date,@NotNull String formatStr){
LocalDateTime localDateTime = dateToLocalDateTime(date); LocalDateTime localDateTime = dateToLocalDateTime(date);
String dateFormat; String dateFormat;
if(StringUtils.isNotBlank(formatStr)){ if(StringUtils.isNotBlank(formatStr)){
...@@ -193,7 +193,7 @@ public class DateUtil { ...@@ -193,7 +193,7 @@ public class DateUtil {
} }
public static void main(String[] args) { // public static void main(String[] args) {
System.out.println(DateUtil.dateLessDayStr(new Date(), "yyyyMMddHHmmss", 1)); // System.out.println(DateUtil.dateLessDayStr(new Date(), "yyyyMMddHHmmss", 1));
} // }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment