This commit is contained in:
lizhengwei 2026-03-01 23:42:44 +08:00
parent 17e356dded
commit d0f1c868c6
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,31 @@
package com.luban.api.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum ProjectStatus {
Draft(1),
Published(2);
private final int value;
public static ProjectStatus valueOf(int value) {
for (ProjectStatus status : values()) {
if (status.value == value) {
return status;
}
}
return null;
}
public static String getName(int value) {
for (ProjectStatus status : values()) {
if (status.value == value) {
return status.name();
}
}
return null;
}
}

View File

@ -4,6 +4,7 @@ package com.luban.api.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dromara.md.form.api.constant.BaseConstant;
import com.dromara.md.form.utils.TenantHelper;
import com.luban.api.constant.ProjectStatus;
import com.luban.api.dto.H5ProjectContentDTO;
import com.luban.api.dto.query.H5ProjectQueryDTO;
import com.luban.api.entity.H5Project;
@ -66,7 +67,7 @@ public class WorkController {
h5Project.setPreviewWidth(request.getPreviewWidth());
h5Project.setPreviewHeight(request.getPreviewHeight());
h5Project.setContent("{}");
h5Project.setStatus(1);
h5Project.setStatus(ProjectStatus.Draft.getValue());
h5Project.setCreatedBy(LoginHelper.getUserId());
H5ProjectContentDTO contentDTO = new H5ProjectContentDTO();