Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
8e36898a
Commit
8e36898a
authored
Sep 15, 2020
by
sgjj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加列表生成获取当前栏目
parent
1cdf0633
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
0 deletions
+71
-0
CategoryEntity.java
src/main/java/net/mingsoft/cms/entity/CategoryEntity.java
+67
-0
CmsParserUtil.java
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
+4
-0
No files found.
src/main/java/net/mingsoft/cms/entity/CategoryEntity.java
View file @
8e36898a
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
org.springframework.format.annotation.DateTimeFormat
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
...
...
@@ -338,4 +341,68 @@ private static final long serialVersionUID = 1574925152750L;
public
String
getCategoryParentId
()
{
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
""
;
}
}
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
View file @
8e36898a
...
...
@@ -38,6 +38,8 @@ public class CmsParserUtil extends ParserUtil {
*/
private
static
int
COLUMN_TYPE_COVER
=
2
;
private
final
static
String
FIELD
=
"field"
;
/**
* 指定模板,指定路径进行生成静态页面,会自定识别pc与移动端
*
...
...
@@ -90,6 +92,8 @@ public class CmsParserUtil extends ParserUtil {
//全局参数设置
Map
<
String
,
Object
>
parserParams
=
new
HashMap
<
String
,
Object
>();
parserParams
.
put
(
COLUMN
,
column
);
//标签中使用field获取当前栏目
parserParams
.
put
(
FIELD
,
column
);
parserParams
.
put
(
IS_DO
,
false
);
parserParams
.
put
(
HTML
,
HTML
);
parserParams
.
put
(
APP_ID
,
BasicUtil
.
getAppId
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment