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
b1b8f047
Unverified
Commit
b1b8f047
authored
Jun 01, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
#12787 文章不进行表情迁移
parent
c9c3d00d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
16 deletions
+0
-16
src/main/java/org/b3log/solo/upgrade/V361_362.java
src/main/java/org/b3log/solo/upgrade/V361_362.java
+0
-16
No files found.
src/main/java/org/b3log/solo/upgrade/V361_362.java
View file @
b1b8f047
...
@@ -24,10 +24,8 @@ import org.b3log.latke.logging.Level;
...
@@ -24,10 +24,8 @@ import org.b3log.latke.logging.Level;
import
org.b3log.latke.logging.Logger
;
import
org.b3log.latke.logging.Logger
;
import
org.b3log.latke.repository.Query
;
import
org.b3log.latke.repository.Query
;
import
org.b3log.latke.repository.Transaction
;
import
org.b3log.latke.repository.Transaction
;
import
org.b3log.solo.model.Article
;
import
org.b3log.solo.model.Comment
;
import
org.b3log.solo.model.Comment
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.repository.ArticleRepository
;
import
org.b3log.solo.repository.CommentRepository
;
import
org.b3log.solo.repository.CommentRepository
;
import
org.b3log.solo.repository.OptionRepository
;
import
org.b3log.solo.repository.OptionRepository
;
import
org.b3log.solo.util.Emotions
;
import
org.b3log.solo.util.Emotions
;
...
@@ -62,7 +60,6 @@ public final class V361_362 {
...
@@ -62,7 +60,6 @@ public final class V361_362 {
final
BeanManager
beanManager
=
BeanManager
.
getInstance
();
final
BeanManager
beanManager
=
BeanManager
.
getInstance
();
final
OptionRepository
optionRepository
=
beanManager
.
getReference
(
OptionRepository
.
class
);
final
OptionRepository
optionRepository
=
beanManager
.
getReference
(
OptionRepository
.
class
);
final
ArticleRepository
articleRepository
=
beanManager
.
getReference
(
ArticleRepository
.
class
);
final
CommentRepository
commentRepository
=
beanManager
.
getReference
(
CommentRepository
.
class
);
final
CommentRepository
commentRepository
=
beanManager
.
getReference
(
CommentRepository
.
class
);
try
{
try
{
...
@@ -73,19 +70,6 @@ public final class V361_362 {
...
@@ -73,19 +70,6 @@ public final class V361_362 {
optionRepository
.
update
(
Option
.
ID_C_VERSION
,
versionOpt
);
optionRepository
.
update
(
Option
.
ID_C_VERSION
,
versionOpt
);
// 迁移历史表情图片 https://github.com/b3log/solo/issues/12787
// 迁移历史表情图片 https://github.com/b3log/solo/issues/12787
final
List
<
JSONObject
>
articles
=
articleRepository
.
getList
(
new
Query
());
for
(
final
JSONObject
article
:
articles
)
{
final
String
oldContent
=
article
.
optString
(
Article
.
ARTICLE_CONTENT
);
String
articleContent
=
oldContent
;
articleContent
=
Emotions
.
convert
(
articleContent
);
articleContent
=
convertEm00
(
articleContent
);
if
(!
StringUtils
.
equalsIgnoreCase
(
oldContent
,
articleContent
))
{
article
.
put
(
Article
.
ARTICLE_CONTENT
,
articleContent
);
final
String
articleId
=
article
.
optString
(
Keys
.
OBJECT_ID
);
articleRepository
.
update
(
articleId
,
article
);
LOGGER
.
log
(
Level
.
INFO
,
"Migrated article [id="
+
articleId
+
"]'s content emoji"
);
}
}
final
List
<
JSONObject
>
comments
=
commentRepository
.
getList
(
new
Query
());
final
List
<
JSONObject
>
comments
=
commentRepository
.
getList
(
new
Query
());
for
(
final
JSONObject
comment
:
comments
)
{
for
(
final
JSONObject
comment
:
comments
)
{
final
String
oldContent
=
comment
.
optString
(
Comment
.
COMMENT_CONTENT
);
final
String
oldContent
=
comment
.
optString
(
Comment
.
COMMENT_CONTENT
);
...
...
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