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
60438056
Unverified
Commit
60438056
authored
Nov 06, 2018
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
修复初始化判断问题
parent
3d2ad682
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
28 deletions
+16
-28
src/main/java/org/b3log/solo/SoloServletListener.java
src/main/java/org/b3log/solo/SoloServletListener.java
+1
-4
src/main/java/org/b3log/solo/api/B3CommentReceiver.java
src/main/java/org/b3log/solo/api/B3CommentReceiver.java
+2
-3
src/main/java/org/b3log/solo/processor/console/AdminConsole.java
...n/java/org/b3log/solo/processor/console/AdminConsole.java
+2
-9
src/main/java/org/b3log/solo/service/ArticleQueryService.java
...main/java/org/b3log/solo/service/ArticleQueryService.java
+3
-3
src/main/java/org/b3log/solo/service/InitService.java
src/main/java/org/b3log/solo/service/InitService.java
+5
-4
src/main/java/org/b3log/solo/service/PreferenceQueryService.java
...n/java/org/b3log/solo/service/PreferenceQueryService.java
+3
-5
No files found.
src/main/java/org/b3log/solo/SoloServletListener.java
View file @
60438056
...
...
@@ -51,7 +51,7 @@ import javax.servlet.http.HttpSessionEvent;
* Solo Servlet listener.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.10.0.
2, Oct 31
, 2018
* @version 1.10.0.
3, Nov 6
, 2018
* @since 0.3.1
*/
public
final
class
SoloServletListener
extends
AbstractServletListener
{
...
...
@@ -174,9 +174,6 @@ public final class SoloServletListener extends AbstractServletListener {
try
{
preference
=
preferenceQueryService
.
getPreference
();
if
(
null
==
preference
)
{
LOGGER
.
info
(
"Please open browser and visit ["
+
Latkes
.
getServePath
()
+
"] to init your Solo, "
+
"and then enjoy it :-p"
);
return
;
}
...
...
src/main/java/org/b3log/solo/api/B3CommentReceiver.java
View file @
60438056
...
...
@@ -26,7 +26,6 @@ import org.b3log.latke.ioc.Inject;
import
org.b3log.latke.logging.Level
;
import
org.b3log.latke.logging.Logger
;
import
org.b3log.latke.repository.Transaction
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.servlet.HTTPRequestContext
;
import
org.b3log.latke.servlet.HTTPRequestMethod
;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
...
...
@@ -53,7 +52,7 @@ import java.util.Date;
* Comment receiver from B3log Symphony.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.1
8, Sep 25
, 2018
* @version 1.1.1.1
9, Nov 6
, 2018
* @since 0.5.5
*/
@RequestProcessor
...
...
@@ -256,7 +255,7 @@ public class B3CommentReceiver {
ret
.
put
(
Keys
.
STATUS_CODE
,
true
);
renderer
.
setJSONObject
(
ret
);
}
catch
(
final
Service
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
e
.
getMessage
(),
e
);
final
JSONObject
jsonObject
=
new
JSONObject
().
put
(
Keys
.
STATUS_CODE
,
false
);
...
...
src/main/java/org/b3log/solo/processor/console/AdminConsole.java
View file @
60438056
...
...
@@ -34,7 +34,6 @@ import org.b3log.latke.model.User;
import
org.b3log.latke.plugin.ViewLoadEventData
;
import
org.b3log.latke.repository.jdbc.util.Connections
;
import
org.b3log.latke.service.LangPropsService
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.servlet.HTTPRequestContext
;
import
org.b3log.latke.servlet.HTTPRequestMethod
;
import
org.b3log.latke.servlet.annotation.Before
;
...
...
@@ -68,7 +67,7 @@ import java.util.*;
* Admin console render processing.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.7.0.
6, Oct 5
, 2018
* @version 1.7.0.
7, Nov 6
, 2018
* @since 0.4.1
*/
@RequestProcessor
...
...
@@ -241,13 +240,7 @@ public class AdminConsole {
dataModel
.
putAll
(
langs
);
dataModel
.
put
(
Option
.
ID_C_LOCALE_STRING
,
locale
.
toString
());
JSONObject
preference
=
null
;
try
{
preference
=
preferenceQueryService
.
getPreference
();
}
catch
(
final
ServiceException
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Loads preference failed"
,
e
);
}
final
JSONObject
preference
=
preferenceQueryService
.
getPreference
();
final
StringBuilder
timeZoneIdOptions
=
new
StringBuilder
();
final
String
[]
availableIDs
=
TimeZone
.
getAvailableIDs
();
for
(
int
i
=
0
;
i
<
availableIDs
.
length
;
i
++)
{
...
...
src/main/java/org/b3log/solo/service/ArticleQueryService.java
View file @
60438056
...
...
@@ -53,7 +53,7 @@ import static org.b3log.solo.model.Article.*;
* @author <a href="http://blog.sweelia.com">ArmstrongCN</a>
* @author <a href="http://zephyr.b3log.org">Zephyr</a>
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.3.2.
6, Oct 7
, 2018
* @version 1.3.2.
7, Nov 6
, 2018
* @since 0.3.5
*/
@Service
...
...
@@ -160,7 +160,7 @@ public class ArticleQueryService {
final
List
<
JSONObject
>
articles
=
CollectionUtils
.
jsonArrayToList
(
result
.
optJSONArray
(
Keys
.
RESULTS
));
ret
.
put
(
Article
.
ARTICLES
,
(
Object
)
articles
);
}
catch
(
final
RepositoryException
|
ServiceException
e
)
{
}
catch
(
final
RepositoryException
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Searches articles error"
,
e
);
}
...
...
@@ -244,7 +244,7 @@ public class ArticleQueryService {
ret
.
put
(
Article
.
ARTICLES
,
(
Object
)
articles
);
return
ret
;
}
catch
(
final
RepositoryException
|
ServiceException
e
)
{
}
catch
(
final
RepositoryException
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Gets category articles error"
,
e
);
throw
new
ServiceException
(
e
);
...
...
src/main/java/org/b3log/solo/service/InitService.java
View file @
60438056
...
...
@@ -57,7 +57,7 @@ import java.util.Set;
* Solo initialization service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.5.2.2
3, Sep 1
6, 2018
* @version 1.5.2.2
4, Nov
6, 2018
* @since 0.4.0
*/
@Service
...
...
@@ -159,9 +159,10 @@ public class InitService {
try
{
final
JSONObject
admin
=
userRepository
.
getAdmin
();
return
null
!=
admin
;
}
catch
(
final
RepositoryException
e
)
{
LOGGER
.
log
(
Level
.
WARN
,
"Solo has not been initialized"
);
return
null
!=
admin
&&
0
<
optionRepository
.
count
();
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
WARN
,
"Solo has not been initialized, please open your browser and visit ["
+
Latkes
.
getServePath
()
+
"] to init Solo"
);
return
false
;
}
}
...
...
src/main/java/org/b3log/solo/service/PreferenceQueryService.java
View file @
60438056
...
...
@@ -20,7 +20,6 @@ package org.b3log.solo.service;
import
org.b3log.latke.ioc.Inject
;
import
org.b3log.latke.logging.Level
;
import
org.b3log.latke.logging.Logger
;
import
org.b3log.latke.repository.RepositoryException
;
import
org.b3log.latke.service.ServiceException
;
import
org.b3log.latke.service.annotation.Service
;
import
org.b3log.solo.model.Option
;
...
...
@@ -31,7 +30,7 @@ import org.json.JSONObject;
* Preference query service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.0.
4, Sep 17
, 2018
* @version 1.1.0.
5, Nov 6
, 2018
* @since 0.4.0
*/
@Service
...
...
@@ -79,9 +78,8 @@ public class PreferenceQueryService {
* Gets the user preference.
*
* @return user preference, returns {@code null} if not found
* @throws ServiceException if repository exception
*/
public
JSONObject
getPreference
()
throws
ServiceException
{
public
JSONObject
getPreference
()
{
try
{
final
JSONObject
checkInit
=
optionRepository
.
get
(
Option
.
ID_C_ADMIN_EMAIL
);
if
(
null
==
checkInit
)
{
...
...
@@ -89,7 +87,7 @@ public class PreferenceQueryService {
}
return
optionQueryService
.
getOptions
(
Option
.
CATEGORY_C_PREFERENCE
);
}
catch
(
final
Repository
Exception
e
)
{
}
catch
(
final
Exception
e
)
{
return
null
;
}
}
...
...
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