|
|
@@ -16,6 +16,10 @@ import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
/**
|
|
|
* @author TRX
|
|
|
* @date 2024/5/21
|
|
|
@@ -71,6 +75,20 @@ public class ProjectInfoService {
|
|
|
return ResultContent.buildSuccess(PageEntityUtil.concurrent2PageModel(page, this::toModel));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 得到所有可用的项目
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public ResultContent<List<ProjectInfoModel>> getAllProject() {
|
|
|
+ List<ProjectInfoModel> models = new ArrayList<>();
|
|
|
+ List<ProjectInfo> list = projectInfoDao.findByStateOrderByCreateTimeDesc(CommonState.Enable);
|
|
|
+ if (ObjectUtils.isNotEmpty(list)) {
|
|
|
+ models = list.stream().map(this::toModel).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ return ResultContent.buildSuccess(models);
|
|
|
+ }
|
|
|
+
|
|
|
public ResultContent deleteProjectInfo(String id) {
|
|
|
ProjectInfo projectInfo = projectInfoDao.findTopById(id);
|
|
|
if (ObjectUtils.isEmpty(projectInfo)) {
|