添加列表生成获取当前栏目

This commit is contained in:
sgjj 2020-09-15 12:06:55 +08:00
parent 1cdf063302
commit 8e36898ac2
2 changed files with 71 additions and 0 deletions

View File

@ -1,5 +1,8 @@
package net.mingsoft.cms.entity; package net.mingsoft.cms.entity;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -338,4 +341,68 @@ private static final long serialVersionUID = 1574925152750L;
public String getCategoryParentId() { public String getCategoryParentId() {
return this.categoryParentId; return this.categoryParentId;
} }
/**
* 获取栏目标题 标签使用
*/
public String getTypetitle() {
return this.categoryTitle;
}
/**
* 获取栏目链接 标签使用动态链接不考虑
*/
public String getTypelink() {
return "3".equals(this.categoryType)?this.categoryDiyUrl:this.categoryPath+"/index.html";
}
/**
* 获取栏目关键字 标签使用
*/
public String getTypekeyword() {
return this.categoryKeyword;
}
/**
* 获取栏目url 标签使用
*/
public String getTypeurl() {
return this.categoryDiyUrl;
}
/**
* 获取栏目属性 标签使用
*/
public String getFlag() {
return this.categoryFlag;
}
/**
* 获取栏目父级Id 标签使用
*/
public String getParentid() {
return this.categoryParentId;
}
/**
* 获取栏目描述标签使用
*/
public String getTypedescrip() {
return this.categoryDescrip;
}
/**
* 获取栏目Id标签使用
*/
public String getTypeid() {
return this.id;
}
/**
* 获取栏目图片 (标签使用
*/
public String getTypelitpic() {
if(StrUtil.isNotBlank(categoryImg)){
try{
JSONArray objects = JSON.parseArray(categoryImg);
return objects.getJSONObject(0).getString("path");
}catch (Exception e){
}
}
return "";
}
} }

View File

@ -38,6 +38,8 @@ public class CmsParserUtil extends ParserUtil {
*/ */
private static int COLUMN_TYPE_COVER = 2; private static int COLUMN_TYPE_COVER = 2;
private final static String FIELD="field";
/** /**
* 指定模板指定路径进行生成静态页面会自定识别pc与移动端 * 指定模板指定路径进行生成静态页面会自定识别pc与移动端
* *
@ -90,6 +92,8 @@ public class CmsParserUtil extends ParserUtil {
//全局参数设置 //全局参数设置
Map<String, Object> parserParams = new HashMap<String, Object>(); Map<String, Object> parserParams = new HashMap<String, Object>();
parserParams.put(COLUMN, column); parserParams.put(COLUMN, column);
//标签中使用field获取当前栏目
parserParams.put(FIELD, column);
parserParams.put(IS_DO, false); parserParams.put(IS_DO, false);
parserParams.put(HTML, HTML); parserParams.put(HTML, HTML);
parserParams.put(APP_ID, BasicUtil.getAppId()); parserParams.put(APP_ID, BasicUtil.getAppId());