Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
solo-1
Commits
7af50222
Unverified
Commit
7af50222
authored
Sep 16, 2018
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
♻
#12509 存档表名
parent
33198d0c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
16 deletions
+12
-16
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
+6
-10
src/main/java/org/b3log/solo/repository/impl/ArchiveDateArticleRepositoryImpl.java
...olo/repository/impl/ArchiveDateArticleRepositoryImpl.java
+2
-2
src/main/java/org/b3log/solo/repository/impl/ArchiveDateRepositoryImpl.java
...b3log/solo/repository/impl/ArchiveDateRepositoryImpl.java
+2
-2
src/main/resources/repository.json
src/main/resources/repository.json
+2
-2
No files found.
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
View file @
7af50222
...
...
@@ -931,12 +931,12 @@ public class ArticleProcessor {
final
JSONObject
article
=
(
JSONObject
)
request
.
getAttribute
(
Article
.
ARTICLE
);
if
(
null
==
article
)
{
response
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
return
;
}
final
String
articleId
=
article
.
optString
(
Keys
.
OBJECT_ID
);
LOGGER
.
log
(
Level
.
DEBUG
,
"Article[id={0}]"
,
articleId
);
LOGGER
.
log
(
Level
.
DEBUG
,
"Article [id={0}]"
,
articleId
);
final
AbstractFreeMarkerRenderer
renderer
=
new
SkinRenderer
(
request
);
context
.
setRenderer
(
renderer
);
...
...
@@ -944,7 +944,6 @@ public class ArticleProcessor {
try
{
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
final
boolean
allowVisitDraftViaPermalink
=
preference
.
getBoolean
(
Option
.
ID_C_ALLOW_VISIT_DRAFT_VIA_PERMALINK
);
if
(!
article
.
optBoolean
(
Article
.
ARTICLE_IS_PUBLISHED
)
&&
!
allowVisitDraftViaPermalink
)
{
response
.
sendError
(
HttpServletResponse
.
SC_NOT_FOUND
);
...
...
@@ -952,13 +951,14 @@ public class ArticleProcessor {
return
;
}
LOGGER
.
log
(
Level
.
TRACE
,
"Article[title={0}]"
,
article
.
getString
(
Article
.
ARTICLE_TITLE
));
LOGGER
.
log
(
Level
.
TRACE
,
"Article
[title={0}]"
,
article
.
getString
(
Article
.
ARTICLE_TITLE
));
articleQueryService
.
markdown
(
article
);
article
.
put
(
Article
.
ARTICLE_T_CREATE_DATE
,
new
Date
(
article
.
optLong
(
Article
.
ARTICLE_CREATED
)));
// For <meta name="description" content="${article.articleAbstract}"/>
final
String
metaDescription
=
Jsoup
.
parse
(
article
.
optString
(
Article
.
ARTICLE_ABSTRACT
)).
text
();
article
.
put
(
Article
.
ARTICLE_ABSTRACT
,
metaDescription
);
if
(
preference
.
getBoolean
(
Option
.
ID_C_ENABLE_ARTICLE_UPDATE_HINT
))
{
...
...
@@ -1206,7 +1206,6 @@ public class ArticleProcessor {
Stopwatchs
.
start
(
"Get Previous Article"
);
LOGGER
.
debug
(
"Getting the previous article...."
);
final
JSONObject
previousArticle
=
articleQueryService
.
getPreviousArticle
(
articleId
);
if
(
null
!=
previousArticle
)
{
dataModel
.
put
(
Common
.
PREVIOUS_ARTICLE_PERMALINK
,
previousArticle
.
getString
(
Article
.
ARTICLE_PERMALINK
));
dataModel
.
put
(
Common
.
PREVIOUS_ARTICLE_TITLE
,
previousArticle
.
getString
(
Article
.
ARTICLE_TITLE
));
...
...
@@ -1218,10 +1217,8 @@ public class ArticleProcessor {
Stopwatchs
.
start
(
"Get Article CMTs"
);
LOGGER
.
debug
(
"Getting article's comments...."
);
final
int
cmtCount
=
article
.
getInt
(
Article
.
ARTICLE_COMMENT_COUNT
);
if
(
0
!=
cmtCount
)
{
final
List
<
JSONObject
>
articleComments
=
commentQueryService
.
getComments
(
articleId
);
dataModel
.
put
(
Article
.
ARTICLE_COMMENTS_REF
,
articleComments
);
}
else
{
dataModel
.
put
(
Article
.
ARTICLE_COMMENTS_REF
,
Collections
.
emptyList
());
...
...
@@ -1229,8 +1226,7 @@ public class ArticleProcessor {
LOGGER
.
debug
(
"Got article's comments"
);
Stopwatchs
.
end
();
dataModel
.
put
(
Option
.
ID_C_EXTERNAL_RELEVANT_ARTICLES_DISPLAY_CNT
,
preference
.
getInt
(
Option
.
ID_C_EXTERNAL_RELEVANT_ARTICLES_DISPLAY_CNT
));
dataModel
.
put
(
Option
.
ID_C_EXTERNAL_RELEVANT_ARTICLES_DISPLAY_CNT
,
preference
.
getInt
(
Option
.
ID_C_EXTERNAL_RELEVANT_ARTICLES_DISPLAY_CNT
));
dataModel
.
put
(
Option
.
ID_C_RANDOM_ARTICLES_DISPLAY_CNT
,
preference
.
getInt
(
Option
.
ID_C_RANDOM_ARTICLES_DISPLAY_CNT
));
dataModel
.
put
(
Option
.
ID_C_RELEVANT_ARTICLES_DISPLAY_CNT
,
preference
.
getInt
(
Option
.
ID_C_RELEVANT_ARTICLES_DISPLAY_CNT
));
}
...
...
src/main/java/org/b3log/solo/repository/impl/ArchiveDateArticleRepositoryImpl.java
View file @
7af50222
...
...
@@ -32,7 +32,7 @@ import org.json.JSONObject;
* Archive date-Article relation repository.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.
6, Nov 9, 2011
* @version 1.0.0.
7, Sep 16, 2018
* @since 0.3.1
*/
@Repository
...
...
@@ -42,7 +42,7 @@ public class ArchiveDateArticleRepositoryImpl extends AbstractRepository impleme
* Public constructor.
*/
public
ArchiveDateArticleRepositoryImpl
()
{
super
(
ArchiveDate
.
ARCHIVE_DATE
+
"_"
+
Article
.
ARTICLE
);
super
(
(
ArchiveDate
.
ARCHIVE_DATE
+
"_"
+
Article
.
ARTICLE
).
toLowerCase
()
);
}
@Override
...
...
src/main/java/org/b3log/solo/repository/impl/ArchiveDateRepositoryImpl.java
View file @
7af50222
...
...
@@ -36,7 +36,7 @@ import java.util.List;
* Archive date repository.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.1
0, Aug 27
, 2018
* @version 1.0.0.1
1, Sep 16
, 2018
* @since 0.3.1
*/
@Repository
...
...
@@ -51,7 +51,7 @@ public class ArchiveDateRepositoryImpl extends AbstractRepository implements Arc
* Public constructor.
*/
public
ArchiveDateRepositoryImpl
()
{
super
(
ArchiveDate
.
ARCHIVE_DATE
);
super
(
ArchiveDate
.
ARCHIVE_DATE
.
toLowerCase
()
);
}
@Override
...
...
src/main/resources/repository.json
View file @
7af50222
...
...
@@ -71,7 +71,7 @@
]
},
{
"name"
:
"archive
D
ate"
,
"name"
:
"archive
d
ate"
,
"description"
:
"存档日期表"
,
"keys"
:
[
{
...
...
@@ -98,7 +98,7 @@
]
},
{
"name"
:
"archive
D
ate_article"
,
"name"
:
"archive
d
ate_article"
,
"description"
:
"存档-文章关联表"
,
"keys"
:
[
{
...
...
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