wushunjie
杜函宇 4 months ago
commit 53a6c8de95

@ -1,24 +1,31 @@
package com.ruoyi.common.core.domain;
import com.ruoyi.common.constant.HttpStatus;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
*
*
* @author ruoyi
* @author Lion Li
*/
@Data
@NoArgsConstructor
public class R<T> implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
public static final int SUCCESS = HttpStatus.SUCCESS;
public static final int SUCCESS = 200;
/**
*
*/
public static final int FAIL = HttpStatus.ERROR;
private static final long serialVersionUID = 1L;
public static final int FAIL = 500;
private int code;
private String msg;
@ -37,7 +44,7 @@ public class R<T> implements Serializable {
return restResult(null, SUCCESS, msg);
}
public static <T> R<T> ok(T data, String msg) {
public static <T> R<T> ok(String msg, T data) {
return restResult(data, SUCCESS, msg);
}
@ -53,7 +60,7 @@ public class R<T> implements Serializable {
return restResult(data, FAIL, "操作失败");
}
public static <T> R<T> fail(T data, String msg) {
public static <T> R<T> fail(String msg, T data) {
return restResult(data, FAIL, msg);
}
@ -61,12 +68,33 @@ public class R<T> implements Serializable {
return restResult(null, code, msg);
}
/**
*
*
* @param msg
* @return
*/
public static <T> R<T> warn(String msg) {
return restResult(null, HttpStatus.WARN, msg);
}
/**
*
*
* @param msg
* @param data
* @return
*/
public static <T> R<T> warn(String msg, T data) {
return restResult(data, HttpStatus.WARN, msg);
}
private static <T> R<T> restResult(T data, int code, String msg) {
R<T> apiResult = new R<>();
apiResult.setCode(code);
apiResult.setData(data);
apiResult.setMsg(msg);
return apiResult;
R<T> r = new R<>();
r.setCode(code);
r.setData(data);
r.setMsg(msg);
return r;
}
public static <T> Boolean isError(R<T> ret) {
@ -76,28 +104,4 @@ public class R<T> implements Serializable {
public static <T> Boolean isSuccess(R<T> ret) {
return R.SUCCESS == ret.getCode();
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
}

@ -244,10 +244,10 @@ public class WfModelServiceImpl extends FlowServiceFactory implements IWfModelSe
if (ObjectUtil.isNull(startEvent)) {
throw new RuntimeException("开始节点不存在,请检查流程设计是否有误!");
}
// 获取开始节点配置的表单Key
if (StrUtil.isBlank(startEvent.getFormKey())) {
throw new RuntimeException("请配置流程表单");
}
// // 获取开始节点配置的表单Key todo
// if (StrUtil.isBlank(startEvent.getFormKey())) {
// throw new RuntimeException("请配置流程表单");
// }
Model newModel;
if (Boolean.TRUE.equals(modelBo.getNewVersion())) {
newModel = repositoryService.newModel();

Loading…
Cancel
Save