feat(社区版项目管理):#3676 转发forge代码库相关接口
This commit is contained in:
parent
ef61378cc4
commit
1ed8d87c80
|
@ -22,14 +22,11 @@ public interface ForgeIssuesMapper {
|
|||
|
||||
int updateForIssues(ForgeIssues forgeIssues);
|
||||
|
||||
// 查询指定linkableId直接关联的所有工作项
|
||||
List<Long> selectDirectLinkedIssues(@Param("linkableId") Long linkableId,
|
||||
@Param("linkableType") String linkableType,
|
||||
@Param("beLinkableType") String beLinkableType);
|
||||
|
||||
// 批量查询多个linkableId关联的所有工作项
|
||||
List<Long> selectLinkedIssuesByLinkableIds(@Param("linkableIds") List<Long> linkableIds,
|
||||
@Param("beLinkableType") String beLinkableType);
|
||||
List<Long> selectLinkedIssueIdsByLinkableIds(@Param("linkableIds") List<Long> linkableIds,
|
||||
@Param("linkableType") String linkableType,
|
||||
@Param("beLinkableType") String beLinkableType);
|
||||
|
||||
PmsIssuesLinkedCount getIssuesLinkedCount(@Param("linkIssueIdSet") Set<Long> linkIssueIdSet);
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ public class PmsLinkIssuesAsyncCommentService {
|
|||
// 查询当前层级关联的工作项
|
||||
List<Long> linkedIssueIds;
|
||||
// 后续层级查询多个工作项关联的工作项
|
||||
linkedIssueIds = forgeIssuesMapper.selectLinkedIssuesByLinkableIds(linkableIds, beLinkableType);
|
||||
linkedIssueIds = forgeIssuesMapper.selectLinkedIssueIdsByLinkableIds(linkableIds, linkableType, beLinkableType);
|
||||
|
||||
// 如果没有更多关联的工作项,结束递归
|
||||
if (linkedIssueIds == null || linkedIssueIds.isEmpty() || linkedIssueIds.size() == result.size()) {
|
||||
|
@ -165,11 +165,7 @@ public class PmsLinkIssuesAsyncCommentService {
|
|||
}
|
||||
|
||||
// 将新发现的关联工作项添加到结果中
|
||||
for (Long issueId : linkedIssueIds) {
|
||||
if (!result.contains(issueId)) {
|
||||
result.add(issueId);
|
||||
}
|
||||
}
|
||||
result.addAll(linkedIssueIds);
|
||||
|
||||
// 递归查询下一层级
|
||||
findLinkedIssuesRecursively(linkedIssueIds, linkableType, beLinkableType, result, currentDepth + 1, maxDepth);
|
||||
|
|
|
@ -489,7 +489,7 @@ public class PmsGitLinkRequestUrl extends GitLinkRequestUrl {
|
|||
}
|
||||
|
||||
public static GitLinkRequestUrl GET_PROJECT_DETAILS(String repo, String owner) {
|
||||
return getGitLinkRequestUrl(String.format("/api/%s/%s/simple.json", owner, repo));
|
||||
return getGitLinkRequestUrl(String.format("/api/%s/%s/detail.json", owner, repo));
|
||||
}
|
||||
|
||||
public static GitLinkRequestUrl GET_ISSUE_RELATED_ENUM(String repo, String owner, String issueUrl, Boolean onlyName) {
|
||||
|
|
|
@ -68,10 +68,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
|
||||
<!-- 批量查询多个linkableId关联的所有工作项 -->
|
||||
<select id="selectLinkedIssuesByLinkableIds" resultType="java.lang.Long">
|
||||
<select id="selectLinkedIssueIdsByLinkableIds" resultType="java.lang.Long">
|
||||
SELECT DISTINCT be_linkable_id AS linkedIssueIds
|
||||
FROM pm_links
|
||||
WHERE be_linkable_type = #{beLinkableType}
|
||||
WHERE linkable_type = #{linkableType}
|
||||
AND be_linkable_type = #{beLinkableType}
|
||||
AND (linkable_id IN
|
||||
<foreach item="item" index="index" collection="linkableIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
|
@ -83,7 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
UNION
|
||||
SELECT DISTINCT linkable_id AS linkedIssueIds
|
||||
FROM pm_links
|
||||
WHERE be_linkable_type = #{beLinkableType}
|
||||
WHERE linkable_type = #{linkableType}
|
||||
AND be_linkable_type = #{beLinkableType}
|
||||
AND (linkable_id IN
|
||||
<foreach item="item" index="index" collection="linkableIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
|
|
Loading…
Reference in New Issue