Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
Project
Project
Details
Activity
Releases
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
李丛阳
education
Commits
f1937228
Commit
f1937228
authored
May 12, 2021
by
张君
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
回退
parent
a654bd7e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
16 deletions
+30
-16
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+1
-9
RcRedisService.java
src/main/java/org/rcisoft/core/service/RcRedisService.java
+1
-0
RcRedisServiceImpl.java
...ava/org/rcisoft/core/service/impl/RcRedisServiceImpl.java
+23
-0
UploadUtil.java
src/main/java/org/rcisoft/core/util/UploadUtil.java
+5
-7
No files found.
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
f1937228
...
...
@@ -67,15 +67,7 @@ public class BLessonServiceImpl implements BLessonService {
@Override
public
List
<
BLesson
>
queryBLessonsByPagination
(
PageUtil
pageUtil
,
BLesson
model
)
{
List
<
BLesson
>
bLessons
=
bLessonRepository
.
queryBLessons
(
model
);
for
(
BLesson
blesson
:
bLessons
){
if
(!
"/default/course.jpg"
.
equals
(
blesson
.
getDefaultUrl
())){
String
a
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()+
blesson
.
getDefaultUrl
();
blesson
.
setDefaultUrl
(
convertFileToBase64
(
a
));
// "D:\\eduServer\\upload\\course\\logo47c32bf0-cc16-420b-9030-cf97471401dc.jpg"
}
}
return
bLessons
;
return
bLessonRepository
.
queryBLessons
(
model
);
}
@Override
...
...
src/main/java/org/rcisoft/core/service/RcRedisService.java
View file @
f1937228
...
...
@@ -21,6 +21,7 @@ public interface RcRedisService {
*/
public
void
returnResource
(
Jedis
jedis
);
public
void
returnBrokenResource
(
Jedis
jedis
);
/**
* 赋值
* @param key
...
...
src/main/java/org/rcisoft/core/service/impl/RcRedisServiceImpl.java
View file @
f1937228
...
...
@@ -21,6 +21,8 @@ public class RcRedisServiceImpl implements RcRedisService {
@Override
public
Jedis
getResource
()
{
log
.
info
(
"++++"
+
jedisPool
+
"---"
);
log
.
info
(
"++++"
+
jedisPool
.
getResource
()+
"---"
);
return
jedisPool
.
getResource
();
}
...
...
@@ -32,6 +34,17 @@ public class RcRedisServiceImpl implements RcRedisService {
}
}
// 出现异常释放资源
@Override
public
synchronized
void
returnBrokenResource
(
Jedis
jedis
)
{
if
(
jedis
!=
null
)
{
jedisPool
.
returnBrokenResource
(
jedis
);
}
}
@Override
public
void
set
(
String
key
,
String
value
,
int
expire
)
{
Jedis
jedis
=
null
;
...
...
@@ -42,6 +55,7 @@ public class RcRedisServiceImpl implements RcRedisService {
jedis
.
expire
(
key
,
expire
);
log
.
info
(
"Redis set success - "
+
key
+
", value:"
+
value
);
}
catch
(
Exception
e
)
{
returnBrokenResource
(
jedis
);
e
.
printStackTrace
();
log
.
error
(
"Redis set error: "
+
e
.
getMessage
()
+
" - "
+
key
+
", value:"
+
value
);
}
finally
{
...
...
@@ -57,6 +71,7 @@ public class RcRedisServiceImpl implements RcRedisService {
jedis
.
set
(
key
,
value
);
log
.
info
(
"Redis set success - "
+
key
+
", value:"
+
value
);
}
catch
(
Exception
e
)
{
returnBrokenResource
(
jedis
);
e
.
printStackTrace
();
log
.
error
(
"Redis set error: "
+
e
.
getMessage
()
+
" - "
+
key
+
", value:"
+
value
);
}
finally
{
...
...
@@ -72,6 +87,7 @@ public class RcRedisServiceImpl implements RcRedisService {
jedis
.
set
(
key
.
getBytes
(),
value
);
log
.
info
(
"Redis set success - "
+
key
+
", value:"
+
value
);
}
catch
(
Exception
e
)
{
returnBrokenResource
(
jedis
);
e
.
printStackTrace
();
log
.
error
(
"Redis set error: "
+
e
.
getMessage
()
+
" - "
+
key
+
", value:"
+
value
);
}
finally
{
...
...
@@ -89,6 +105,7 @@ public class RcRedisServiceImpl implements RcRedisService {
jedis
.
expire
(
key
,
expire
);
log
.
info
(
"Redis set success - "
+
key
+
", value:"
+
value
);
}
catch
(
Exception
e
)
{
returnBrokenResource
(
jedis
);
e
.
printStackTrace
();
log
.
error
(
"Redis set error: "
+
e
.
getMessage
()
+
" - "
+
key
+
", value:"
+
value
);
}
finally
{
...
...
@@ -104,6 +121,7 @@ public class RcRedisServiceImpl implements RcRedisService {
result
=
jedis
.
get
(
key
);
log
.
info
(
"Redis get success - "
+
key
+
", value:"
+
result
);
}
catch
(
Exception
e
)
{
returnBrokenResource
(
jedis
);
e
.
printStackTrace
();
log
.
error
(
"Redis set error: "
+
e
.
getMessage
()
+
" - "
+
key
+
", value:"
+
result
);
}
finally
{
...
...
@@ -121,6 +139,7 @@ public class RcRedisServiceImpl implements RcRedisService {
result
=
jedis
.
get
(
key
.
getBytes
());
log
.
info
(
"Redis get success - "
+
key
+
", value:"
+
result
);
}
catch
(
Exception
e
)
{
returnBrokenResource
(
jedis
);
e
.
printStackTrace
();
log
.
error
(
"Redis set error: "
+
e
.
getMessage
()
+
" - "
+
key
+
", value:"
+
result
);
}
finally
{
...
...
@@ -137,6 +156,7 @@ public class RcRedisServiceImpl implements RcRedisService {
jedis
.
del
(
key
);
log
.
info
(
"Redis del success - "
+
key
);
}
catch
(
Exception
e
)
{
returnBrokenResource
(
jedis
);
e
.
printStackTrace
();
log
.
error
(
"Redis set error: "
+
e
.
getMessage
()
+
" - "
+
key
);
}
finally
{
...
...
@@ -154,6 +174,7 @@ public class RcRedisServiceImpl implements RcRedisService {
result
=
jedis
.
lrange
(
key
,
0
,
-
1
);
log
.
info
(
"Redis get list success - "
+
key
+
", value:"
+
result
);
}
catch
(
Exception
e
)
{
returnBrokenResource
(
jedis
);
e
.
printStackTrace
();
log
.
error
(
"Redis set error: "
+
e
.
getMessage
()
+
" - "
+
key
);
}
finally
{
...
...
@@ -172,6 +193,7 @@ public class RcRedisServiceImpl implements RcRedisService {
jedis
.
rpush
(
key
,
value
);
log
.
info
(
"Redis set list success - "
+
key
+
", value:"
+
value
);
}
catch
(
Exception
e
)
{
returnBrokenResource
(
jedis
);
e
.
printStackTrace
();
log
.
error
(
"Redis set error: "
+
e
.
getMessage
()
+
" - "
+
key
+
", value:"
+
value
);
}
finally
{
...
...
@@ -187,6 +209,7 @@ public class RcRedisServiceImpl implements RcRedisService {
jedis
.
lrem
(
key
,
1
,
value
);
log
.
info
(
"Redis remove list success - "
+
key
+
", value:"
+
value
);
}
catch
(
Exception
e
)
{
returnBrokenResource
(
jedis
);
e
.
printStackTrace
();
log
.
error
(
"Redis set error: "
+
e
.
getMessage
()
+
" - "
+
key
+
", value:"
+
value
);
}
finally
{
...
...
src/main/java/org/rcisoft/core/util/UploadUtil.java
View file @
f1937228
...
...
@@ -32,13 +32,11 @@ public class UploadUtil {
try
{
UUID
uuid
=
UUID
.
randomUUID
();
Calendar
calendar
=
Calendar
.
getInstance
();
String
userPath
=
uploadPath
;
// +
// File.separator+calendar.get(Calendar.YEAR)+
// File.separator+calendar.get(Calendar.MONTH)+
// File.separator+calendar.get(Calendar.DATE)+
// File.separator
String
userPath
=
uploadPath
+
File
.
separator
+
calendar
.
get
(
Calendar
.
YEAR
)+
File
.
separator
+
calendar
.
get
(
Calendar
.
MONTH
)+
File
.
separator
+
calendar
.
get
(
Calendar
.
DATE
)+
File
.
separator
;
String
realPath
=
basePath
+
File
.
separator
+
userPath
;
//创建File对象,参数为String类型,表示目录名
File
dir
=
new
File
(
realPath
);
...
...
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