forked from Gitlink/microservices
feat(文章评论功能开发): 创建文章评论对应Issue时,文章访问地址由仓库文件访问地址改成专区文章详情访问地址
This commit is contained in:
parent
475e097a4f
commit
10fbe0b7ce
|
|
@ -62,7 +62,7 @@ public class GitLinkRequestHelper {
|
|||
* 带参数的请求
|
||||
*
|
||||
* @param gitLinkRequestUrl
|
||||
* @param jsonObject
|
||||
* @param object
|
||||
* @param requestType
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ import java.util.Date;
|
|||
@Data
|
||||
@ApiModel("Gitlink Issue输入对象")
|
||||
public class IssueInputDto {
|
||||
public IssueInputDto() {
|
||||
}
|
||||
|
||||
public IssueInputDto(CmsDoc cmsDoc, String docUrl) {
|
||||
this.subject = cmsDoc.getName();
|
||||
|
|
|
|||
|
|
@ -45,11 +45,9 @@ public class CmsDocCommentServiceImpl implements ICmsDocCommentService {
|
|||
CmsDoc cmsDoc = cmsDocService.selectBaseCmsDocById(docId);
|
||||
CmsProject cmsProject = cmsProjectService.selectCmsProjectByDeptId(cmsDoc.getDeptId());
|
||||
if (!checkIssueIsExist(cmsDoc.getIssueId(), cmsProject)) {
|
||||
String zoneDocUrl = cmsDocService.getDocDetailUrl(cmsProject.getDeptId(), cmsDoc.getId());
|
||||
// 若关联的Issue不存在,则创建Issue
|
||||
String gitlinkDocUrl = CmsGitLinkRequestUrl.GITLINK_DOC_FILE_URL(gitLinkRequestHelper.gitLinkUrl
|
||||
, cmsProject.getUsername(), cmsProject.getIdentifier(),
|
||||
cmsDoc.getDirName(), cmsDoc.getFileName());
|
||||
IssueInputDto issueInputDto = new IssueInputDto(cmsDoc, gitlinkDocUrl);
|
||||
IssueInputDto issueInputDto = new IssueInputDto(cmsDoc, zoneDocUrl);
|
||||
JSONObject issueJson = new JSONObject();
|
||||
Map<Class<?>, String> formatPatterns = new HashMap<>();
|
||||
formatPatterns.put(Date.class, "yyyy-MM-dd"); // 添加Date类型的格式化pattern
|
||||
|
|
|
|||
|
|
@ -192,8 +192,8 @@ public class CmsGitLinkRequestUrl extends GitLinkRequestUrl {
|
|||
return getAdminGitLinkRequestUrl(String.format("/api/v1/%s/%s/issues/%d/journals/%d", username, identifier, issueId, journalId));
|
||||
}
|
||||
|
||||
public static String GITLINK_DOC_FILE_URL(String gitlinkUrl, String username, String identifier, String dirName, String fileName) {
|
||||
return EscapeUtil.removeExtraSlashOfUrl(String.format("%s/%s/%s/tree/master/%s/%s", gitlinkUrl, username, identifier, dirName, fileName));
|
||||
public static String ZONE_DOC_URL(String gitlinkUrl, String zoneKey, Long docId) {
|
||||
return EscapeUtil.removeExtraSlashOfUrl(String.format("%s/zone/%s/newdetail/%d", gitlinkUrl, zoneKey, docId));
|
||||
}
|
||||
|
||||
private static String buildUri(String url, Map<String, String> params) throws URISyntaxException {
|
||||
|
|
|
|||
Loading…
Reference in New Issue