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
204f9cee
Commit
204f9cee
authored
Apr 12, 2017
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
clean code
parent
ec8df866
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
25 deletions
+17
-25
src/main/java/org/b3log/solo/api/symphony/CommentReceiver.java
...ain/java/org/b3log/solo/api/symphony/CommentReceiver.java
+1
-1
src/main/java/org/b3log/solo/processor/util/FillTagArticles.java
...n/java/org/b3log/solo/processor/util/FillTagArticles.java
+15
-23
src/main/java/org/b3log/solo/service/CommentMgmtService.java
src/main/java/org/b3log/solo/service/CommentMgmtService.java
+1
-1
No files found.
src/main/java/org/b3log/solo/api/symphony/CommentReceiver.java
View file @
204f9cee
...
...
@@ -230,7 +230,7 @@ public class CommentReceiver {
comment
.
put
(
Comment
.
COMMENT_ORIGINAL_COMMENT_ID
,
""
);
comment
.
put
(
Comment
.
COMMENT_ORIGINAL_COMMENT_NAME
,
""
);
LOGGER
.
log
(
Level
.
WARN
,
"Not found orginal comment[id={0}] of reply[name={1}, content={2}]"
,
new
String
[]{
originalCommentId
,
commentName
,
commentContent
}
);
originalCommentId
,
commentName
,
commentContent
);
}
}
else
{
comment
.
put
(
Comment
.
COMMENT_ORIGINAL_COMMENT_ID
,
""
);
...
...
src/main/java/org/b3log/solo/processor/util/FillTagArticles.java
View file @
204f9cee
...
...
@@ -16,17 +16,16 @@
package
org
.
b3log
.
solo
.
processor
.
util
;
import
freemarker.template.TemplateMethodModel
;
import
freemarker.template.TemplateMethodModel
Ex
;
import
freemarker.template.TemplateModelException
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.ioc.inject.Inject
;
import
org.b3log.latke.logging.Level
;
import
org.b3log.latke.logging.Logger
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.service.annotation.Service
;
import
org.b3log.solo.model.Tag
;
import
org.b3log.solo.service.ArticleQueryService
;
import
org.b3log.solo.service.TagQueryService
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
...
...
@@ -37,39 +36,37 @@ import java.util.List;
* Fill tag articles.
*
* @author <a href="mailto:385321165@qq.com">DASHU</a>
* @version 0.0.0.1, Jul 1, 2013
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.2, Apr 12, 2017
* @since 0.6.1
*/
@Service
public
class
FillTagArticles
implements
TemplateMethodModel
{
public
class
FillTagArticles
implements
TemplateMethodModel
Ex
{
/**
* Logger.
*/
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
FillTagArticles
.
class
.
getName
());
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
FillTagArticles
.
class
);
/**
* Arg size.
*/
private
static
final
int
ARG_SIZE
=
3
;
/**
* Tag query service.
*/
@Inject
private
TagQueryService
tagQueryService
;
/**
* Article query service.
*/
@Inject
private
ArticleQueryService
articleQueryService
;
/**
* Arg size.
*/
private
static
final
int
ARG_SIZE
=
3
;
@Override
public
Object
exec
(
final
List
arguments
)
throws
TemplateModelException
{
if
(
arguments
.
size
()
!=
ARG_SIZE
)
{
LOGGER
.
debug
(
"FillTagArticles with wrong arguments!"
);
throw
new
TemplateModelException
(
"Wrong arguments!"
);
}
...
...
@@ -78,9 +75,7 @@ public class FillTagArticles implements TemplateMethodModel {
final
int
pageSize
=
Integer
.
parseInt
((
String
)
arguments
.
get
(
2
));
try
{
final
JSONObject
result
=
tagQueryService
.
getTagByTitle
(
tagTitle
);
if
(
null
==
result
)
{
return
new
ArrayList
<
JSONObject
>();
}
...
...
@@ -88,14 +83,11 @@ public class FillTagArticles implements TemplateMethodModel {
final
JSONObject
tag
=
result
.
getJSONObject
(
Tag
.
TAG
);
final
String
tagId
=
tag
.
getString
(
Keys
.
OBJECT_ID
);
final
List
<
JSONObject
>
list
=
articleQueryService
.
getArticlesByTag
(
tagId
,
currentPageNum
,
pageSize
);
return
list
;
final
List
<
JSONObject
>
ret
=
articleQueryService
.
getArticlesByTag
(
tagId
,
currentPageNum
,
pageSize
);
}
catch
(
final
ServiceException
e
)
{
e
.
printStackTrace
();
}
catch
(
final
JSONException
e
)
{
e
.
printStackTrace
();
return
ret
;
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Fill tag articles failed"
,
e
);
}
return
null
;
...
...
src/main/java/org/b3log/solo/service/CommentMgmtService.java
View file @
204f9cee
...
...
@@ -609,7 +609,7 @@ public class CommentMgmtService {
ret
.
put
(
Common
.
IS_REPLY
,
true
);
}
else
{
LOGGER
.
log
(
Level
.
WARN
,
"Not found orginal comment[id={0}] of reply[name={1}, content={2}]"
,
new
String
[]{
originalCommentId
,
commentName
,
commentContent
}
);
originalCommentId
,
commentName
,
commentContent
);
}
}
setCommentThumbnailURL
(
comment
);
...
...
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