fix(缺陷管理): 禅道GET请求方式缺陷的更新和删除
--bug=1007605 --user=lyh 【github#7231】lts版本,集成禅道模块未放开请求方式功能,导致默认GET请求的禅道用户无法对接MS,请修改 https://www.tapd.cn/55049933/s/1063716
This commit is contained in:
parent
7c7c1ef875
commit
50740e17b4
|
@ -9,6 +9,8 @@ public class ZentaoGetClient extends ZentaoClient {
|
||||||
private static final String LOGIN = "/?m=user&f=login&t=json&zentaosid=";
|
private static final String LOGIN = "/?m=user&f=login&t=json&zentaosid=";
|
||||||
private static final String SESSION_GET="/?m=api&f=getSessionID&t=json";
|
private static final String SESSION_GET="/?m=api&f=getSessionID&t=json";
|
||||||
private static final String BUG_CREATE="&module=bug&methodName=create&t=json&zentaosid=";
|
private static final String BUG_CREATE="&module=bug&methodName=create&t=json&zentaosid=";
|
||||||
|
private static final String BUG_UPDATE = "&module=bug&methodName=update¶ms=bugID={0}&t=json&zentaosid={1}";
|
||||||
|
private static final String BUG_DELETE = "/?m=bug&f=delete&bugID={0}&confirm=yes&t=json&zentaosid={1}";
|
||||||
private static final String BUG_GET="&module=bug&methodName=getById¶ms=bugID={1}&t=json&zentaosid={2}";
|
private static final String BUG_GET="&module=bug&methodName=getById¶ms=bugID={1}&t=json&zentaosid={2}";
|
||||||
private static final String STORY_GET="&module=story&methodName=getProductStories¶ms=productID={key}&t=json&zentaosid=";
|
private static final String STORY_GET="&module=story&methodName=getProductStories¶ms=productID={key}&t=json&zentaosid=";
|
||||||
private static final String USER_GET="&module=user&methodName=getList&t=json&zentaosid=";
|
private static final String USER_GET="&module=user&methodName=getList&t=json&zentaosid=";
|
||||||
|
@ -17,10 +19,11 @@ public class ZentaoGetClient extends ZentaoClient {
|
||||||
private static final String REPLACE_IMG_URL="<img src=\"/zentao/index.php?m=file&f=read&fileID=$1\"/>";
|
private static final String REPLACE_IMG_URL="<img src=\"/zentao/index.php?m=file&f=read&fileID=$1\"/>";
|
||||||
private static final Pattern IMG_PATTERN = Pattern.compile("m=file&f=read&fileID=(.*?)\"/>");
|
private static final Pattern IMG_PATTERN = Pattern.compile("m=file&f=read&fileID=(.*?)\"/>");
|
||||||
|
|
||||||
{
|
|
||||||
RequestUrl request = new RequestUrl();
|
RequestUrl request = new RequestUrl();
|
||||||
request.setLogin(getBaseUrl() + LOGIN);
|
|
||||||
request.setSessionGet(getBaseUrl() + SESSION_GET);
|
{
|
||||||
|
request.setLogin(getNotSuperModelUrl(LOGIN));
|
||||||
|
request.setSessionGet(getNotSuperModelUrl(SESSION_GET));
|
||||||
request.setBugCreate(getUrl(BUG_CREATE));
|
request.setBugCreate(getUrl(BUG_CREATE));
|
||||||
request.setBugGet(getUrl(BUG_GET));
|
request.setBugGet(getUrl(BUG_GET));
|
||||||
request.setStoryGet(getUrl(STORY_GET));
|
request.setStoryGet(getUrl(STORY_GET));
|
||||||
|
@ -29,6 +32,8 @@ public class ZentaoGetClient extends ZentaoClient {
|
||||||
request.setFileUpload(getUrl(FILE_UPLOAD));
|
request.setFileUpload(getUrl(FILE_UPLOAD));
|
||||||
request.setReplaceImgUrl(REPLACE_IMG_URL);
|
request.setReplaceImgUrl(REPLACE_IMG_URL);
|
||||||
request.setImgPattern(IMG_PATTERN);
|
request.setImgPattern(IMG_PATTERN);
|
||||||
|
request.setBugUpdate(getUrl(BUG_UPDATE));
|
||||||
|
request.setBugDelete(getNotSuperModelUrl(BUG_DELETE));
|
||||||
requestUrl = request;
|
requestUrl = request;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,4 +44,8 @@ public class ZentaoGetClient extends ZentaoClient {
|
||||||
private String getUrl(String url) {
|
private String getUrl(String url) {
|
||||||
return getBaseUrl() + "/?m=api&f=getModel" + url;
|
return getBaseUrl() + "/?m=api&f=getModel" + url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getNotSuperModelUrl(String url) {
|
||||||
|
return getBaseUrl() + url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,9 @@ public class ZentaoPathInfoClient extends ZentaoClient {
|
||||||
private static final String REPLACE_IMG_URL = "<img src=\"/zentao/file-read-$1\"/>";
|
private static final String REPLACE_IMG_URL = "<img src=\"/zentao/file-read-$1\"/>";
|
||||||
private static final Pattern IMG_PATTERN = Pattern.compile("file-read-(.*?)\"/>");
|
private static final Pattern IMG_PATTERN = Pattern.compile("file-read-(.*?)\"/>");
|
||||||
|
|
||||||
{
|
|
||||||
RequestUrl request = new RequestUrl();
|
RequestUrl request = new RequestUrl();
|
||||||
|
|
||||||
|
{
|
||||||
request.setLogin(getUrl(LOGIN));
|
request.setLogin(getUrl(LOGIN));
|
||||||
request.setSessionGet(getUrl(SESSION_GET));
|
request.setSessionGet(getUrl(SESSION_GET));
|
||||||
request.setBugCreate(getUrl(BUG_CREATE));
|
request.setBugCreate(getUrl(BUG_CREATE));
|
||||||
|
|
Loading…
Reference in New Issue