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
a99826a7
Commit
a99826a7
authored
Feb 09, 2018
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
缓存超时时间,上传图片权限验证
parent
9c3d1a2b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
2 deletions
+14
-2
BChapterController.java
...soft/business/bchapter/controller/BChapterController.java
+1
-1
TQuestionServiceImpl.java
...business/tquestion/service/impl/TQuestionServiceImpl.java
+7
-1
Global.java
src/main/java/org/rcisoft/common/component/Global.java
+4
-0
application-dev.yml
src/main/resources/application-dev.yml
+1
-0
application-prod.yml
src/main/resources/application-prod.yml
+1
-0
No files found.
src/main/java/org/rcisoft/business/bchapter/controller/BChapterController.java
View file @
a99826a7
...
...
@@ -105,7 +105,7 @@ public class BChapterController extends PaginationController<BChapter> {
@ApiOperation
(
value
=
"上传图片"
,
notes
=
"上传任务书所需图片"
)
@ApiImplicitParam
(
name
=
"image"
,
value
=
"图片文件"
,
required
=
true
,
dataType
=
"MultipartFile"
)
@PreAuthorize
(
"has
Role('ROLE_1002
')"
)
@PreAuthorize
(
"has
AnyRole('ROLE_1002','ROLE_1001
')"
)
@PostMapping
(
value
=
"/uploadMdFileWithoutAuth"
)
public
Map
<
String
,
Object
>
uploadMdFile
(
MultipartFile
image
)
{
String
path
=
global
.
getMD_FILE_LOCATION
();
...
...
src/main/java/org/rcisoft/business/tquestion/service/impl/TQuestionServiceImpl.java
View file @
a99826a7
...
...
@@ -10,6 +10,7 @@ import org.rcisoft.business.tpaperchapter.dao.TPaperChapterRepository;
import
org.rcisoft.business.tquestion.dto.QuestionListAndNumDto
;
import
org.rcisoft.business.tquestion.dao.TQuestionOptionsRepository
;
import
org.rcisoft.business.tquestion.entity.TQuestionOptions
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.rcisoft.core.service.RcRedisService
;
...
...
@@ -70,6 +71,9 @@ public class TQuestionServiceImpl implements TQuestionService {
@Autowired
private
RcRedisService
rcRedisServiceImpl
;
@Autowired
private
Global
global
;
/**
* 保存 tQuestion
* @param tQuestion
...
...
@@ -294,7 +298,9 @@ public class TQuestionServiceImpl implements TQuestionService {
questionListAndNum
.
setNumOfMultiSelect
(
tQuestionRepository
.
queryNumByType
(
"2"
,
chapterId
));
questionListAndNum
.
setNumOfJudgment
(
tQuestionRepository
.
queryNumByType
(
"3"
,
chapterId
));
//将数据放入缓存中
rcRedisServiceImpl
.
setBytes
(
userId
+
"_"
+
chapterId
,
SerializationUtils
.
serializer
(
questionListAndNum
));
rcRedisServiceImpl
.
setBytes
(
userId
+
"_"
+
chapterId
,
SerializationUtils
.
serializer
(
questionListAndNum
),
global
.
getREDIS_TIMEOUT
());
return
questionListAndNum
;
}
...
...
src/main/java/org/rcisoft/common/component/Global.java
View file @
a99826a7
...
...
@@ -249,4 +249,8 @@ public class Global {
/*openOffice安装路径*/
@Value
(
"${global.other.open_office_home}"
)
private
String
OPEN_OFFICE_HOME
;
/*redis缓存超时时间*/
@Value
(
"${spring.redis.timeout}"
)
private
Integer
REDIS_TIMEOUT
;
}
src/main/resources/application-dev.yml
View file @
a99826a7
...
...
@@ -63,6 +63,7 @@ spring:
max-wait
:
-1
database
:
0
password
:
'
'
timeout
:
3600
freemarker
:
charset
:
UTF-8
suffix
:
.ftl
...
...
src/main/resources/application-prod.yml
View file @
a99826a7
...
...
@@ -63,6 +63,7 @@ spring:
max-wait
:
-1
database
:
0
password
:
'
'
timeout
:
3600
freemarker
:
charset
:
UTF-8
suffix
:
.ftl
...
...
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