|
|
|
@ -37,12 +37,23 @@ public class FineMarketClientHelper {
|
|
|
|
|
private Map<String, String> tags; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取模板的下载链接 |
|
|
|
|
* */ |
|
|
|
|
public String getTemplateDownLoadUrl(TemplateResource templateResource) { |
|
|
|
|
String url = FINE_MARKET_TEMPLATE_INFO + FILE_DOWNLOAD; |
|
|
|
|
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 { |
|
|
|
@ -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<>(); |
|
|
|
|
|
|
|
|
|
initTags(); |
|
|
|
|
|
|
|
|
|
if (cids != null) { |
|
|
|
|
for (String cid : cids) { |
|
|
|
|
String tagName = tags.get(cid); |
|
|
|
|
if (TagIds != null) { |
|
|
|
|
for (String tagId : TagIds) { |
|
|
|
|
String tagName = tags.get(tagId); |
|
|
|
|
if (tagName != null) { |
|
|
|
|
list.add(tagName); |
|
|
|
|
} |
|
|
|
@ -104,6 +119,9 @@ public class FineMarketClientHelper {
|
|
|
|
|
return list; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 请求帆软市场,获取所有tag信息,并构建tagid - tagname的map |
|
|
|
|
* */ |
|
|
|
|
private void initTags() throws IOException { |
|
|
|
|
tags = new HashMap<>(); |
|
|
|
|
String url = FINE_MARKET_TEMPLATE_INFO + TEMPLATES_TAGS; |
|
|
|
|