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
130920bd
Commit
130920bd
authored
Jan 03, 2018
by
李丛阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
java 开发环境
parent
f97b402f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
222 additions
and
7 deletions
+222
-7
BCodeController.java
...rg/rcisoft/business/bcode/controller/BCodeController.java
+52
-0
BCodeFile.java
...ain/java/org/rcisoft/business/bcode/entity/BCodeFile.java
+22
-0
BCodeService.java
...java/org/rcisoft/business/bcode/service/BCodeService.java
+18
-0
BCodeServiceImpl.java
...rcisoft/business/bcode/service/impl/BCodeServiceImpl.java
+30
-0
Global.java
src/main/java/org/rcisoft/common/component/Global.java
+15
-0
UserUtil.java
src/main/java/org/rcisoft/core/util/UserUtil.java
+3
-0
application-prod.yml
src/main/resources/application-prod.yml
+82
-7
No files found.
src/main/java/org/rcisoft/business/bcode/controller/BCodeController.java
0 → 100644
View file @
130920bd
package
org
.
rcisoft
.
business
.
bcode
.
controller
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.bcode.service.BCodeService
;
import
org.rcisoft.common.controller.PaginationController
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.Result
;
import
org.rcisoft.core.util.UserUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* Created by lcy on 18/1/3.
*
* 编程controller
*/
@RestController
@RequestMapping
(
"/BCode"
)
public
class
BCodeController
extends
PaginationController
{
@Autowired
private
BCodeService
bCodeServiceImpl
;
/**
* 学生看自己的实验
* @param slId
* @param chapId
* @param examType
* @return
*/
@ApiOperation
(
value
=
"查看实验代码"
,
notes
=
"学生看自己的实验"
)
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)
@GetMapping
(
value
=
"/queryOwnExamFiles"
)
public
Result
queryOwnExamFiles
(
@RequestParam
(
"slId"
)
String
slId
,
@RequestParam
(
"chapId"
)
String
chapId
,
@RequestParam
(
"examType"
)
String
examType
){
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
bCodeServiceImpl
.
readExamFiles
(
slId
,
chapId
,
examType
,
UserUtil
.
getUserInfoProp
(
getToken
(),
UserUtil
.
USER_ID
)));
}
}
src/main/java/org/rcisoft/business/bcode/entity/BCodeFile.java
0 → 100644
View file @
130920bd
package
org
.
rcisoft
.
business
.
bcode
.
entity
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
/**
* Created by lcy on 18/1/3.
*/
@Data
public
class
BCodeFile
{
/*0 文件 1 目录*/
private
String
fileType
;
private
String
content
;
private
Date
lastModify
;
private
List
<
BCodeFile
>
codeFileList
;
}
src/main/java/org/rcisoft/business/bcode/service/BCodeService.java
0 → 100644
View file @
130920bd
package
org
.
rcisoft
.
business
.
bcode
.
service
;
import
org.rcisoft.business.bcode.entity.BCodeFile
;
/**
* Created by lcy on 18/1/3.
*/
public
interface
BCodeService
{
/**
* 读取文件内容
* @param slId
* @param chapId
* @param examType
* @param userInfoProp
* @return
*/
BCodeFile
readExamFiles
(
String
slId
,
String
chapId
,
String
examType
,
String
userInfoProp
);
}
src/main/java/org/rcisoft/business/bcode/service/impl/BCodeServiceImpl.java
0 → 100644
View file @
130920bd
package
org
.
rcisoft
.
business
.
bcode
.
service
.
impl
;
import
org.rcisoft.business.bcode.entity.BCodeFile
;
import
org.rcisoft.business.bcode.service.BCodeService
;
import
org.rcisoft.common.component.Global
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* Created by lcy on 18/1/3.
*/
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
public
class
BCodeServiceImpl
implements
BCodeService
{
@Autowired
private
Global
global
;
@Override
public
BCodeFile
readExamFiles
(
String
slId
,
String
chapId
,
String
examType
,
String
userInfoProp
)
{
/*java 单文件*/
if
(
examType
.
equals
(
global
.
getJavaSimple
()))
return
null
;
return
null
;
}
}
src/main/java/org/rcisoft/common/component/Global.java
View file @
130920bd
...
...
@@ -215,4 +215,19 @@ public class Global {
private
String
studentCode
;
/*java 单文件*/
@Value
(
"${global.code.java_simple}"
)
private
String
javaSimple
;
/*java 工程*/
@Value
(
"${global.code.java_project}"
)
private
String
javaProject
;
/*html 单文件*/
@Value
(
"${global.code.html_simple}"
)
private
String
htmlSimple
;
/*html 工程*/
@Value
(
"${global.code.html_project}"
)
private
String
htmlProject
;
}
src/main/java/org/rcisoft/core/util/UserUtil.java
View file @
130920bd
package
org
.
rcisoft
.
core
.
util
;
import
io.jsonwebtoken.Claims
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.core.entity.IdEntity
;
import
org.rcisoft.core.model.JwtUser
;
import
org.springframework.security.core.Authentication
;
...
...
@@ -29,6 +30,8 @@ public class UserUtil {
* @return
*/
public
static
String
getUserInfoProp
(
String
token
,
String
prop
){
if
(
StringUtils
.
isEmpty
(
token
))
return
null
;
Claims
claims
=
JwtUtil
.
getUserClaimsFromToken
(
token
);
return
claims
.
get
(
prop
).
toString
();
}
...
...
src/main/resources/application-prod.yml
View file @
130920bd
server
:
port
:
8081
context-path
:
/
#ContextPath must start with '/' and not end with '/'
context-path
:
/
edu
#ContextPath must start with '/' and not end with '/'
tomcat
:
max-threads
:
300
#uri-encoding: UTF-8
#logging:
# level:
...
...
@@ -10,7 +11,7 @@ server:
# org.springframework.web: DEBUG
druid
:
url
:
jdbc:mysql://127.0.0.1:3306/
boot
?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
url
:
jdbc:mysql://127.0.0.1:3306/
edu_db
?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
username
:
root
password
:
cy
initial-size
:
1
...
...
@@ -20,12 +21,12 @@ druid:
mybatis
:
mapper-locations
:
classpath:mapper/*.xml
mapper-locations
:
classpath:mapper/*
*/**/*
.xml
mapper
:
mappers
:
-
org.
yxyqcy.sys
.base.BaseMapper
-
org.
rcisoft.core
.base.BaseMapper
not-empty
:
false
identity
:
MYSQL
...
...
@@ -40,7 +41,12 @@ spring:
jackson
:
default-property-inclusion
:
non_null
http
:
# encoding:
# force: true
# charset: UTF-8
# enabled: true
multipart
:
enabled
:
true
max-file-size
:
100Mb
max-request-size
:
1000Mb
mvc
:
...
...
@@ -48,13 +54,82 @@ spring:
resources
:
add-mappings
:
false
springfox
:
documentation
:
swagger
:
v2
:
path
:
/api-docs
#jwtAuth:
# header: Authorization
# token_header: CyBear
# secret_key: base64EncodedSecretKey
jwt
:
header
:
Authorization
secret
:
mySecret
expiration
:
604800
tokenHead
:
"
Bearer
"
login_secert_key
:
"
base64EncodedSecretKey"
route
:
authentication
:
path
:
auth
refresh
:
refresh
register
:
"
auth/register"
\ No newline at end of file
path
:
"
/login"
refresh
:
"
/refresh"
register
:
"
/register"
global
:
default_location
:
course
:
/default/course.jpg
student
:
/default/student.png
teacher
:
/default/teacher.png
carousel
:
/default/carousel.jpg
git_lab
:
stu_prefix
:
stu_
tea_prefix
:
tea_
project_prefix
:
p_
defaul_branch
:
master
ip
:
106.2.3.134
port
:
90
che
:
start_delay
:
60000
copy_delay
:
5000
ws_start_delay
:
90000
stop_delay
:
30000
max_number
:
10
start_time
:
1800
ip
:
106.2.3.134
tmp_location
:
/c
password
:
min_password
:
6
max_password
:
16
path
:
base_upload_server_location
:
/working/virtualDirectory/projectFiles/edu
course_location
:
course
lesson_location
:
lesson
sl_location
:
sl
freemarker_location
:
/freemarker
image_location
:
/upload
video_location
:
video
temp_location
:
temp
file_location
:
file
ppt_location
:
ppt
pdf_location
:
pdf
excel_template_location
:
excel-template/
cource_logo_location
:
/course/logo
images_location
:
/images
lanch_logo_location
:
/lanch/logo
md_file_location
:
/mdFiles
che_def_template_location
:
/WEB-INF/classes/che-def-jsonfile/java-mysql.json
che_project_init_location
:
/working/dockervolume/chedir/project
other
:
server_url
:
http://gwf.natapp.cc/eduServer
is_server_linux
:
1
max_code_length
:
15
code
:
admin
:
ROLE_1001
teacher
:
ROLE_1002
student
:
ROLE_1003
java_simple
:
0001
java_project
:
0002
html_simple
:
1001
html_project
:
1002
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