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
ecd245b7
Commit
ecd245b7
authored
Feb 10, 2022
by
msgroup
Committed by
mingsoft
Feb 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
5.2.6 修复单篇生成问题
parent
500dc51b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
23 deletions
+14
-23
GeneraterAction.java
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
+14
-23
No files found.
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
View file @
ecd245b7
...
...
@@ -119,7 +119,7 @@ public class GeneraterAction extends BaseAction {
* @param request
* @param response
*/
@RequestMapping
(
value
=
"/generateIndex"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/generateIndex"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequiresPermissions
(
"cms:generate:index"
)
@LogAnn
(
title
=
"生成主页"
,
businessType
=
BusinessTypeEnum
.
UPDATE
)
@ResponseBody
...
...
@@ -134,7 +134,7 @@ public class GeneraterAction extends BaseAction {
return
ResultData
.
build
().
error
(
getResString
(
"templet.file"
));
}
else
{
CmsParserUtil
.
generate
(
tmpFileName
,
generateFileName
,
htmlDir
);
CmsParserUtil
.
generate
(
tmpFileName
,
generateFileName
,
htmlDir
);
return
ResultData
.
build
().
success
();
}
}
...
...
@@ -147,7 +147,7 @@ public class GeneraterAction extends BaseAction {
* @param response
* @param categoryId
*/
@RequestMapping
(
value
=
"/{categoryId}/genernateColumn"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/{categoryId}/genernateColumn"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@LogAnn
(
title
=
"生成栏目"
,
businessType
=
BusinessTypeEnum
.
UPDATE
)
@RequiresPermissions
(
"cms:generate:column"
)
@ResponseBody
...
...
@@ -173,7 +173,7 @@ public class GeneraterAction extends BaseAction {
// 获取栏目列表模版
for
(
CategoryEntity
column
:
columns
)
{
//如果是链接就跳过生成
if
(
column
.
getCategoryType
().
equals
(
CategoryTypeEnum
.
LINK
.
toString
()))
{
if
(
column
.
getCategoryType
().
equals
(
CategoryTypeEnum
.
LINK
.
toString
()))
{
continue
;
}
ContentBean
contentBean
=
new
ContentBean
();
...
...
@@ -187,17 +187,17 @@ public class GeneraterAction extends BaseAction {
// 判断模板文件是否存在
if
(
StringUtils
.
isEmpty
(
column
.
getCategoryListUrl
())
||
!
FileUtil
.
exist
(
ParserUtil
.
buildTemplatePath
(
column
.
getCategoryListUrl
())))
{
LOG
.
error
(
"{} 模板不存在:{}"
,
column
.
getCategoryTitle
(),
column
.
getCategoryUrl
());
LOG
.
error
(
"{} 模板不存在:{}"
,
column
.
getCategoryTitle
(),
column
.
getCategoryUrl
());
continue
;
}
CmsParserUtil
.
generateList
(
column
,
articleIdList
.
size
(),
htmlDir
);
CmsParserUtil
.
generateList
(
column
,
articleIdList
.
size
(),
htmlDir
);
break
;
case
COVER:
// 单页
// 判断模板文件是否存在
if
(
StringUtils
.
isEmpty
(
column
.
getCategoryUrl
())
||
!
FileUtil
.
exist
(
ParserUtil
.
buildTemplatePath
(
column
.
getCategoryUrl
())))
{
LOG
.
error
(
"{} 模板不存在:{}"
,
column
.
getCategoryTitle
(),
column
.
getCategoryUrl
());
LOG
.
error
(
"{} 模板不存在:{}"
,
column
.
getCategoryTitle
(),
column
.
getCategoryUrl
());
continue
;
}
...
...
@@ -208,7 +208,7 @@ public class GeneraterAction extends BaseAction {
BeanUtil
.
copyProperties
(
column
,
columnArticleIdBean
,
copyOptions
);
articleIdList
.
add
(
columnArticleIdBean
);
}
CmsParserUtil
.
generateBasic
(
articleIdList
,
htmlDir
);
CmsParserUtil
.
generateBasic
(
articleIdList
,
htmlDir
);
break
;
}
}
...
...
@@ -223,7 +223,7 @@ public class GeneraterAction extends BaseAction {
* @param response
* @param columnId
*/
@RequestMapping
(
value
=
"/{columnId}/generateArticle"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/{columnId}/generateArticle"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequiresPermissions
(
"cms:generate:article"
)
@LogAnn
(
title
=
"生成文章"
,
businessType
=
BusinessTypeEnum
.
UPDATE
)
@ResponseBody
...
...
@@ -245,7 +245,7 @@ public class GeneraterAction extends BaseAction {
for
(
CategoryEntity
category
:
categoryList
)
{
//如果是链接就跳过生成
if
(
category
.
getCategoryType
().
equals
(
CategoryTypeEnum
.
LINK
.
toString
()))
{
if
(
category
.
getCategoryType
().
equals
(
CategoryTypeEnum
.
LINK
.
toString
()))
{
continue
;
}
contentBean
.
setCategoryId
(
category
.
getId
());
...
...
@@ -256,24 +256,15 @@ public class GeneraterAction extends BaseAction {
if
(
category
.
getCategoryType
().
equals
(
CategoryTypeEnum
.
LIST
.
toString
()))
{
// 判断模板文件是否存在
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTemplatePath
(
category
.
getCategoryListUrl
()))
||
StringUtils
.
isEmpty
(
category
.
getCategoryListUrl
()))
{
LOG
.
error
(
"{} 模板不存在:{}"
,
category
.
getCategoryTitle
(),
category
.
getCategoryListUrl
());
LOG
.
error
(
"{} 模板不存在:{}"
,
category
.
getCategoryTitle
(),
category
.
getCategoryListUrl
());
continue
;
}
}
else
if
(
category
.
getCategoryType
().
equals
(
CategoryTypeEnum
.
COVER
.
toString
()))
{
// 判断模板文件是否存在
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTemplatePath
(
category
.
getCategoryListUrl
()))
||
StringUtils
.
isEmpty
(
category
.
getCategoryListUrl
()))
{
LOG
.
error
(
"{} 模板不存在:{}"
,
category
.
getCategoryTitle
(),
category
.
getCategoryListUrl
());
continue
;
}
CategoryBean
columnArticleIdBean
=
new
CategoryBean
();
CopyOptions
copyOptions
=
CopyOptions
.
create
();
copyOptions
.
setIgnoreError
(
true
);
BeanUtil
.
copyProperties
(
category
,
columnArticleIdBean
,
copyOptions
);
articleIdList
.
add
(
columnArticleIdBean
);
}
// 有符合条件的就更新
if
(
articleIdList
.
size
()
>
0
)
{
CmsParserUtil
.
generateBasic
(
articleIdList
,
htmlDir
);
CmsParserUtil
.
generateBasic
(
articleIdList
,
htmlDir
);
}
}
...
...
@@ -288,11 +279,11 @@ public class GeneraterAction extends BaseAction {
* @param request
* @return
*/
@RequestMapping
(
value
=
"/{position}/viewIndex"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/{position}/viewIndex"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
String
viewIndex
(
HttpServletRequest
request
,
@PathVariable
String
position
,
HttpServletResponse
response
)
{
AppEntity
app
=
BasicUtil
.
getApp
();
// 组织主页预览地址
String
indexPosition
=
app
.
getAppHostUrl
()
+
htmlDir
+
File
.
separator
+
app
.
getAppDir
()
String
indexPosition
=
app
.
getAppHostUrl
()
+
htmlDir
+
File
.
separator
+
app
.
getAppDir
()
+
File
.
separator
+
position
+
ParserUtil
.
HTML_SUFFIX
;
return
"redirect:"
+
indexPosition
;
}
...
...
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