|
|
@ -37,12 +37,23 @@ public class FineMarketClientHelper { |
|
|
|
private Map<String, String> tags; |
|
|
|
private Map<String, String> tags; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取模板的下载链接 |
|
|
|
|
|
|
|
* */ |
|
|
|
public String getTemplateDownLoadUrl(TemplateResource templateResource) { |
|
|
|
public String getTemplateDownLoadUrl(TemplateResource templateResource) { |
|
|
|
String url = FINE_MARKET_TEMPLATE_INFO + FILE_DOWNLOAD; |
|
|
|
String url = FINE_MARKET_TEMPLATE_INFO + FILE_DOWNLOAD; |
|
|
|
if (templateResource != null) { |
|
|
|
if (templateResource != null) { |
|
|
|
url += templateResource.getId(); |
|
|
|
return url + templateResource.getId(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
return url; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 获取帆软市场模板资源页面链接 |
|
|
|
|
|
|
|
* */ |
|
|
|
|
|
|
|
public String getFineMarketTemplateUrl() { |
|
|
|
|
|
|
|
return FINE_MARKET_TEMPLATE_URL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public JSONObject getTemplateInfoById(String id) throws IOException { |
|
|
|
public JSONObject getTemplateInfoById(String id) throws IOException { |
|
|
@ -87,14 +98,18 @@ public class FineMarketClientHelper { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<String> getTemplateTagsByTemplateCids(String[] cids) throws IOException { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 根据模板资源的tagid,获取tagName |
|
|
|
|
|
|
|
* */ |
|
|
|
|
|
|
|
public List<String> getTemplateTagsByTemplateTagIds(String[] TagIds) throws IOException { |
|
|
|
List<String> list = new ArrayList<>(); |
|
|
|
List<String> list = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
initTags(); |
|
|
|
initTags(); |
|
|
|
|
|
|
|
|
|
|
|
if (cids != null) { |
|
|
|
if (TagIds != null) { |
|
|
|
for (String cid : cids) { |
|
|
|
for (String tagId : TagIds) { |
|
|
|
String tagName = tags.get(cid); |
|
|
|
String tagName = tags.get(tagId); |
|
|
|
if (tagName != null) { |
|
|
|
if (tagName != null) { |
|
|
|
list.add(tagName); |
|
|
|
list.add(tagName); |
|
|
|
} |
|
|
|
} |
|
|
@ -104,6 +119,9 @@ public class FineMarketClientHelper { |
|
|
|
return list; |
|
|
|
return list; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 请求帆软市场,获取所有tag信息,并构建tagid - tagname的map |
|
|
|
|
|
|
|
* */ |
|
|
|
private void initTags() throws IOException { |
|
|
|
private void initTags() throws IOException { |
|
|
|
tags = new HashMap<>(); |
|
|
|
tags = new HashMap<>(); |
|
|
|
String url = FINE_MARKET_TEMPLATE_INFO + TEMPLATES_TAGS; |
|
|
|
String url = FINE_MARKET_TEMPLATE_INFO + TEMPLATES_TAGS; |
|
|
|