1. 添加SQL
2. 获取项目相关版本
This commit is contained in:
+13
@@ -242,5 +242,18 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目所有的版本(主版本和子版本的集合)
|
||||
* @param id 项目id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "获取项目所有的版本(主版本和子版本的集合)")
|
||||
@ApiOperation(value="获取项目所有的版本(主版本和子版本的集合)", notes="获取项目所有的版本(主版本和子版本的集合)")
|
||||
@GetMapping(value = "/getVersionsInfo")
|
||||
public Result<?> getVersionsInfo(String id) {
|
||||
List<String> versionsInfoList = projectLibraryBaseService.getVersionsInfo(id);
|
||||
return Result.OK(versionsInfoList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+13
@@ -103,5 +103,18 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
|
||||
|
||||
Page getPages(Integer currentPage, Integer pageSize, List<ProjectLibraryBase> list);
|
||||
|
||||
/**
|
||||
* 项目置顶,取消置顶(只置顶主项目)
|
||||
* @param id
|
||||
* @param flag 0为置顶, 1为取消置顶
|
||||
* @return
|
||||
*/
|
||||
void top(String id,String flag);
|
||||
|
||||
/**
|
||||
* 获取项目所有的版本(主版本和子版本的集合)
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<String> getVersionsInfo(String id);
|
||||
}
|
||||
|
||||
+12
@@ -1011,6 +1011,18 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
this.update(projectLibraryBase,updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getVersionsInfo(String id) {
|
||||
LambdaUpdateWrapper<ProjectLibraryBase> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.in(ProjectLibraryBase::getId,id).or().in(ProjectLibraryBase::getParentId,id);
|
||||
List<ProjectLibraryBase> list = this.list(wrapper);
|
||||
List<String> result = new ArrayList<>();
|
||||
if(list.size() != 0){
|
||||
result = list.stream().map(ProjectLibraryBase::getProjectVersion).collect(Collectors.toList());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user