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
f3ad60ac
Commit
f3ad60ac
authored
Jan 19, 2018
by
李丛阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apache
parent
23c5ec19
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
61 additions
and
49 deletions
+61
-49
BCodeLxcServiceImpl.java
...soft/business/bcode/service/impl/BCodeLxcServiceImpl.java
+1
-1
BCodeServiceImpl.java
...rcisoft/business/bcode/service/impl/BCodeServiceImpl.java
+12
-3
StopLxcJob.java
...main/java/org/rcisoft/business/bcode/task/StopLxcJob.java
+1
-1
BLesson.java
...ain/java/org/rcisoft/business/blesson/entity/BLesson.java
+0
-1
RcListener.java
src/main/java/org/rcisoft/business/listener/RcListener.java
+23
-22
MvcConfig.java
src/main/java/org/rcisoft/config/MvcConfig.java
+1
-1
application-dev.yml
src/main/resources/application-dev.yml
+1
-1
application-prod.yml
src/main/resources/application-prod.yml
+21
-18
apache.ftl
src/main/resources/templates/lxc/apache.ftl
+1
-1
No files found.
src/main/java/org/rcisoft/business/bcode/service/impl/BCodeLxcServiceImpl.java
View file @
f3ad60ac
...
...
@@ -171,7 +171,7 @@ public class BCodeLxcServiceImpl implements BCodeLxcService {
if
(
global
.
getJavaProject
().
equals
(
code
))
return
"java"
;
else
if
(
global
.
getHtmlProject
().
equals
(
code
))
return
"
html
"
;
return
"
apache
"
;
else
return
""
;
}
...
...
src/main/java/org/rcisoft/business/bcode/service/impl/BCodeServiceImpl.java
View file @
f3ad60ac
...
...
@@ -17,6 +17,7 @@ import org.rcisoft.business.bstudent.entity.BStudentDto;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.result.CommandResult
;
import
org.rcisoft.core.result.ResultExceptionEnum
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.rcisoft.core.service.RcRedisService
;
import
org.rcisoft.core.service.SerializationUtils
;
...
...
@@ -75,13 +76,13 @@ public class BCodeServiceImpl implements BCodeService {
return
this
.
readSimpleFile
(
slId
,
chapId
,
CodeType
.
SIM_JAVA
,
userInfo
,
studentCode
);
/*java 工程*/
if
(
examType
.
equals
(
global
.
getJavaProject
()))
return
this
.
readProjectFile
(
slId
,
chapId
,
userInfo
,
studentCode
);
return
this
.
readProjectFile
(
slId
,
chapId
,
userInfo
,
studentCode
,
global
.
getJavaProject
()
);
/*html 单文件*/
if
(
examType
.
equals
(
global
.
getHtmlSimple
()))
return
this
.
readSimpleFile
(
slId
,
chapId
,
CodeType
.
SIM_HTML
,
userInfo
,
studentCode
);
/*html 工程*/
if
(
examType
.
equals
(
global
.
getHtmlProject
()))
return
this
.
readProjectFile
(
slId
,
chapId
,
userInfo
,
studentCode
);
return
this
.
readProjectFile
(
slId
,
chapId
,
userInfo
,
studentCode
,
global
.
getHtmlProject
()
);
return
null
;
}
...
...
@@ -153,8 +154,16 @@ public class BCodeServiceImpl implements BCodeService {
+
global
.
getCOURSE_PROJECT_LOCATION
()
+
File
.
separator
+
userInfo
+
File
.
separator
+
StudentCode
;
/*工程 容器docker dir*/
String
dirPath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
global
.
getCOURSE_LOCATION
()
+
File
.
separator
+
global
.
getSL_LOCATION
()
+
File
.
separator
+
slId
+
File
.
separator
+
chapterId
+
File
.
separator
+
global
.
getCOURSE_PROJECT_LOCATION
()
+
File
.
separator
+
userInfo
+
File
.
separator
;
lxc
.
setUserId
(
userInfo
);
lxc
.
setWorkingDir
(
p
ath
);
lxc
.
setWorkingDir
(
dirP
ath
);
lxc
.
setCode
(
examCode
);
lxc
.
setSl
(
slId
);
lxc
.
setChapterId
(
chapterId
);
...
...
src/main/java/org/rcisoft/business/bcode/task/StopLxcJob.java
View file @
f3ad60ac
...
...
@@ -51,7 +51,7 @@ public class StopLxcJob implements Job {
/*3.移除容器*/
rcRedisServiceImpl
.
remove
(
redisKeyId
);
/*4.移除端口*/
rcRedisServiceImpl
.
set
List
(
"lxcKeys"
,
rcRedisServiceImpl
.
remove
List
(
"lxcKeys"
,
redisKeyId
);
rcRedisServiceImpl
.
removeList
(
"lxcPorts"
,
containerPort
+
""
);
}
...
...
src/main/java/org/rcisoft/business/blesson/entity/BLesson.java
View file @
f3ad60ac
...
...
@@ -9,7 +9,6 @@ import org.rcisoft.core.entity.IdEntity;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
import
javax.persistence.Transient
;
import
java.util.Date
;
/**
* Created with CodeGenerator on .
...
...
src/main/java/org/rcisoft/business/listener/RcListener.java
View file @
f3ad60ac
package
org
.
rcisoft
.
business
.
listener
;
import
lombok.extern.slf4j.Slf4j
;
import
org.quartz.*
;
import
org.rcisoft.business.bcode.task.ClearLxcJob
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.quartz.SchedulerFactoryBean
;
import
javax.servlet.ServletContextEvent
;
import
javax.servlet.ServletContextListener
;
import
java.util.HashMap
;
/**
* Created by lcy on 18/1/19.
*
*
*
* JobDetail job = JobBuilder.newJob(ClearLxcJob.class).
withIdentity(IDENTITY_LXC_GROUP, JOB_LXC_GROUP).
usingJobData(new JobDataMap(new HashMap())).build();
Trigger trigger = TriggerBuilder.newTrigger().forJob(job)
.usingJobData(new JobDataMap(new HashMap()))
.withIdentity(IDENTITY_LXC_GROUP)
.startNow().build();
// 触发器时间设定
Scheduler sched = schedulerFactoryBean.getScheduler();
try {
sched.scheduleJob(job, trigger);
// 启动
if (!sched.isShutdown()) {
sched.start();
}
}catch (Exception e){
log.error(e.getMessage());
}
*/
@Slf4j
public
class
RcListener
implements
ServletContextListener
{
...
...
@@ -39,24 +58,6 @@ public class RcListener implements ServletContextListener {
*/
@Override
public
void
contextInitialized
(
ServletContextEvent
arg0
)
{
JobDetail
job
=
JobBuilder
.
newJob
(
ClearLxcJob
.
class
).
withIdentity
(
IDENTITY_LXC_GROUP
,
JOB_LXC_GROUP
).
usingJobData
(
new
JobDataMap
(
new
HashMap
())).
build
();
Trigger
trigger
=
TriggerBuilder
.
newTrigger
().
forJob
(
job
)
.
usingJobData
(
new
JobDataMap
(
new
HashMap
()))
.
withIdentity
(
IDENTITY_LXC_GROUP
)
.
startNow
().
build
();
// 触发器时间设定
Scheduler
sched
=
schedulerFactoryBean
.
getScheduler
();
/*触发器*/
try
{
sched
.
scheduleJob
(
job
,
trigger
);
// 启动
if
(!
sched
.
isShutdown
())
{
sched
.
start
();
}
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
());
}
}
}
src/main/java/org/rcisoft/config/MvcConfig.java
View file @
f3ad60ac
...
...
@@ -245,7 +245,7 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
* 监听器
* @return
*/
//
@Bean
@Bean
public
ServletListenerRegistrationBean
servletListenerRegistrationBean
(){
ServletListenerRegistrationBean
servletListenerRegistrationBean
=
new
ServletListenerRegistrationBean
();
servletListenerRegistrationBean
.
setListener
(
new
RcListener
());
...
...
src/main/resources/application-dev.yml
View file @
f3ad60ac
...
...
@@ -74,7 +74,7 @@ lxc:
lxc_dockerfilePath
:
/eduLxc
lxc_initPort
:
20001
lxc_maxPort
:
30000
lxc_minu
:
3
lxc_minu
:
15
lxc_isRemote
:
1
springfox
:
documentation
:
...
...
src/main/resources/application-prod.yml
View file @
f3ad60ac
...
...
@@ -54,22 +54,19 @@ spring:
resources
:
add-mappings
:
false
redis
:
host
:
106.2.3.134
port
:
7481
pool
:
max-idle
:
50
max-active
:
1000
min-idle
:
5
max-wait
:
-1
database
:
0
password
:
'
'
springfox
:
documentation
:
swagger
:
v2
:
path
:
/api-docs
host
:
106.2.3.134
port
:
7481
pool
:
max-idle
:
50
max-active
:
1000
min-idle
:
5
max-wait
:
-1
database
:
0
password
:
'
'
freemarker
:
charset
:
UTF-8
suffix
:
.ftl
template-loader-path
:
classpath:/templates/
lxc
:
lxc_prefix
:
lessonLxc
...
...
@@ -79,6 +76,12 @@ lxc:
lxc_maxPort
:
30000
lxc_minu
:
30
lxc_isRemote
:
1
springfox
:
documentation
:
swagger
:
v2
:
path
:
/api-docs
jwt
:
header
:
Authorization
secret
:
mySecret
...
...
@@ -138,6 +141,6 @@ global:
html_project
:
'
1002'
serverLxc
:
ip
:
1
27.0.0.1
ip
:
1
92.168.1.130
username
:
root
password
:
123456
password
:
123456
\ No newline at end of file
src/main/resources/templates/lxc/apache.ftl
View file @
f3ad60ac
version: '2'
services:
java
:
apache
:
image: httpd:2.4
container_name: 'apache_${lxcName}'
restart: always
...
...
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