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
f6b93b1a
Commit
f6b93b1a
authored
Jan 18, 2018
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://103.249.252.109:90/lcy/education
parents
8ccdff94
05798fc2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
38 deletions
+23
-38
BCodeLxcServiceImpl.java
...soft/business/bcode/service/impl/BCodeLxcServiceImpl.java
+1
-1
BCodeServiceImpl.java
...rcisoft/business/bcode/service/impl/BCodeServiceImpl.java
+22
-18
BTermMapper.xml
...in/java/org/rcisoft/business/bterm/mapper/BTermMapper.xml
+0
-19
No files found.
src/main/java/org/rcisoft/business/bcode/service/impl/BCodeLxcServiceImpl.java
View file @
f6b93b1a
...
@@ -77,7 +77,7 @@ public class BCodeLxcServiceImpl implements BCodeLxcService {
...
@@ -77,7 +77,7 @@ public class BCodeLxcServiceImpl implements BCodeLxcService {
/* config path*/
/* config path*/
String
destPath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
String
destPath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
+
global
.
getLxcDockerfilePath
()
+
File
.
separator
+
lxc
.
getUserId
()
;
global
.
getLxcDockerfilePath
()
+
File
.
separator
+
lxc
.
getUserId
()
+
File
.
separator
;
result
=
freemarkerUtil
.
generatorFileFromModel
(
this
.
getModelProject
(
lxc
.
getCode
()),
destPath
result
=
freemarkerUtil
.
generatorFileFromModel
(
this
.
getModelProject
(
lxc
.
getCode
()),
destPath
,
param
);
,
param
);
if
(!
result
.
isSuccess
())
{
if
(!
result
.
isSuccess
())
{
...
...
src/main/java/org/rcisoft/business/bcode/service/impl/BCodeServiceImpl.java
View file @
f6b93b1a
...
@@ -2,7 +2,6 @@ package org.rcisoft.business.bcode.service.impl;
...
@@ -2,7 +2,6 @@ package org.rcisoft.business.bcode.service.impl;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.rcisoft.business.bchapter.dao.BChapterRepository
;
import
org.rcisoft.business.bchapter.dao.BChapterRepository
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.bchapter.entity.BChapter
;
import
org.rcisoft.business.bcode.model.BCodeFile
;
import
org.rcisoft.business.bcode.model.BCodeFile
;
...
@@ -28,11 +27,8 @@ import org.springframework.stereotype.Service;
...
@@ -28,11 +27,8 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.io.*
;
import
java.util.*
;
import
java.util.*
;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipOutputStream
;
/**
/**
* Created by lcy on 18/1/3.
* Created by lcy on 18/1/3.
...
@@ -145,7 +141,7 @@ public class BCodeServiceImpl implements BCodeService {
...
@@ -145,7 +141,7 @@ public class BCodeServiceImpl implements BCodeService {
*/
*/
private
List
<
BCodeFile
>
readProjectFile
(
String
slId
,
String
chapterId
,
String
userInfo
,
String
StudentCode
)
{
private
List
<
BCodeFile
>
readProjectFile
(
String
slId
,
String
chapterId
,
String
userInfo
,
String
StudentCode
)
{
BCodeLxc
lxc
=
new
BCodeLxc
();
BCodeLxc
lxc
=
new
BCodeLxc
();
Map
param
=
new
HashMap
<>();
List
<
BCodeFile
>
codeFile
=
new
ArrayList
<>();
List
<
BCodeFile
>
codeFile
=
new
ArrayList
<>();
/*工程存储路径*/
/*工程存储路径*/
String
path
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
String
path
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
()
+
File
.
separator
...
@@ -174,28 +170,20 @@ public class BCodeServiceImpl implements BCodeService {
...
@@ -174,28 +170,20 @@ public class BCodeServiceImpl implements BCodeService {
/*容器是否已启动*/
/*容器是否已启动*/
byte
[]
results
=
rcRedisServiceImpl
.
getBytes
(
global
.
getLxcPrefix
()
+
lxc
.
getUserId
());
byte
[]
results
=
rcRedisServiceImpl
.
getBytes
(
global
.
getLxcPrefix
()
+
lxc
.
getUserId
());
if
(
null
!=
results
)
{
if
(
null
!=
results
)
{
Map
param
=
new
HashMap
<>();
lxc
=
SerializationUtils
.
deserializer
(
results
,
BCodeLxc
.
class
);
lxc
=
SerializationUtils
.
deserializer
(
results
,
BCodeLxc
.
class
);
/*已开启*/
/*已开启*/
if
(
null
!=
lxc
&&
codeFile
.
size
()
>
0
){
if
(
null
!=
lxc
&&
codeFile
.
size
()
>
0
){
/*容器参数*/
/*容器参数*/
param
.
put
(
"port"
,
lxc
.
getContainerPort
());
param
.
put
(
"port"
,
lxc
.
getContainerPort
());
param
.
put
(
"endTime"
,
lxc
.
getShutdownDate
().
getTime
());
param
.
put
(
"endTime"
,
lxc
.
getShutdownDate
().
getTime
());
codeFile
.
get
(
0
).
setLxcParam
(
param
);
}
}
/*开启容器*/
/*开启容器*/
else
{
else
CommandResult
result
=
bCodeLxcServiceImpl
.
startBCodeLxc
(
lxc
);
this
.
startLxc
(
param
,
lxc
);
/*启动失败*/
if
(
null
==
result
||
!
result
.
isSuccess
()){
log
.
error
(
"启动失败"
+
result
.
getMessage
());
throw
new
ServiceException
(
400
,
result
.
getMessage
());
}
param
.
put
(
"port"
,
lxc
.
getContainerPort
());
param
.
put
(
"endTime"
,
lxc
.
getShutdownDate
().
getTime
());
}
codeFile
.
get
(
0
).
setLxcParam
(
param
);
}
}
else
this
.
startLxc
(
param
,
lxc
);
codeFile
.
get
(
0
).
setLxcParam
(
param
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
debug
(
path
+
" is not exist"
);
log
.
debug
(
path
+
" is not exist"
);
...
@@ -205,6 +193,22 @@ public class BCodeServiceImpl implements BCodeService {
...
@@ -205,6 +193,22 @@ public class BCodeServiceImpl implements BCodeService {
return
codeFile
;
return
codeFile
;
}
}
/**
* 启动
* @param param
* @param lxc
*/
private
void
startLxc
(
Map
param
,
BCodeLxc
lxc
){
CommandResult
result
=
bCodeLxcServiceImpl
.
startBCodeLxc
(
lxc
);
/*启动失败*/
if
(
null
==
result
||
!
result
.
isSuccess
()){
log
.
error
(
"启动失败"
+
result
.
getMessage
());
throw
new
ServiceException
(
400
,
result
.
getMessage
());
}
param
.
put
(
"port"
,
lxc
.
getContainerPort
());
param
.
put
(
"endTime"
,
lxc
.
getShutdownDate
().
getTime
());
}
/**
/**
* 递归方法读取文件及子目录
* 递归方法读取文件及子目录
...
...
src/main/java/org/rcisoft/business/bterm/mapper/BTermMapper.xml
deleted
100644 → 0
View file @
8ccdff94
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.isoft.edu.api.business.bterm.dao.BTermRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"com.isoft.edu.api.business.bterm.entity.BTerm"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"start_date"
jdbcType=
"DATE"
property=
"startDate"
/>
<result
column=
"end_date"
jdbcType=
"DATE"
property=
"endDate"
/>
<result
column=
"is_start"
jdbcType=
"VARCHAR"
property=
"isStart"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"DATE"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"DATE"
property=
"updateDate"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"code"
jdbcType=
"VARCHAR"
property=
"code"
/>
<result
column=
"name"
javaType=
"VARCHAR"
property=
"name"
/>
</resultMap>
</mapper>
\ No newline at end of file
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