Commit 9e0cfa5d authored by YangZhaoJun1's avatar YangZhaoJun1

Merge branch 'master' of http://103.249.252.109:90/lcy/education

parents f25ca85d 2b342456
...@@ -17,7 +17,10 @@ import org.rcisoft.core.util.UploadUtil; ...@@ -17,7 +17,10 @@ import org.rcisoft.core.util.UploadUtil;
import org.rcisoft.core.util.UserUtil; import org.rcisoft.core.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.util.Map; import java.util.Map;
...@@ -113,7 +116,7 @@ public class BCarouselController extends PaginationController<BCarousel> { ...@@ -113,7 +116,7 @@ public class BCarouselController extends PaginationController<BCarousel> {
String path = global.getBASE_UPLOAD_SERVER_LOCATION(); String path = global.getBASE_UPLOAD_SERVER_LOCATION();
String sl_logo_path = global.getIMAGE_LOCATION()+global.getIMAGES_LOCATION(); String sl_logo_path = global.getIMAGE_LOCATION()+global.getIMAGES_LOCATION();
boolean type = false; boolean type = false;
if((global.getSERVER_LINUX()).equals(global.getIS_SERVER_LINUX())){ if("1".equals(global.getIS_SERVER_LINUX())){
type = true; type = true;
} }
Map<String, Object> uploadResult = UploadUtil.picImport(path, sl_logo_path, file, type); Map<String, Object> uploadResult = UploadUtil.picImport(path, sl_logo_path, file, type);
......
...@@ -12,7 +12,6 @@ import org.rcisoft.business.bchapter.dto.ScoreInfoDTO; ...@@ -12,7 +12,6 @@ import org.rcisoft.business.bchapter.dto.ScoreInfoDTO;
import org.rcisoft.business.bchapter.entity.BChapter; import org.rcisoft.business.bchapter.entity.BChapter;
import org.rcisoft.business.bchapter.enums.IsCompleteEnum; import org.rcisoft.business.bchapter.enums.IsCompleteEnum;
import org.rcisoft.business.bchapter.service.BChapterService; import org.rcisoft.business.bchapter.service.BChapterService;
import org.rcisoft.business.brslstudent.service.BRSlStudentService;
import org.rcisoft.business.bsl.service.BSlService; import org.rcisoft.business.bsl.service.BSlService;
import org.rcisoft.common.component.Global; import org.rcisoft.common.component.Global;
import org.rcisoft.common.controller.PaginationController; import org.rcisoft.common.controller.PaginationController;
...@@ -23,17 +22,13 @@ import org.rcisoft.core.enums.RoleFlagEnum; ...@@ -23,17 +22,13 @@ import org.rcisoft.core.enums.RoleFlagEnum;
import org.rcisoft.core.exception.ServiceException; import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.model.PersistModel; import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.Result; import org.rcisoft.core.result.Result;
import org.rcisoft.core.result.ResultCode;
import org.rcisoft.core.result.ResultServiceEnums; import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.util.UploadUtil; import org.rcisoft.core.util.UploadUtil;
import org.rcisoft.core.util.UserUtil; import org.rcisoft.core.util.UserUtil;
import org.rcisoft.sys.role.dao.SysRoleRepository; import org.rcisoft.sys.role.dao.SysRoleRepository;
import org.rcisoft.sys.role.entity.SysRole; import org.rcisoft.sys.role.entity.SysRole;
import org.rcisoft.sys.user.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.async.WebAsyncTask; import org.springframework.web.context.request.async.WebAsyncTask;
...@@ -121,7 +116,7 @@ public class BChapterController extends PaginationController<BChapter> { ...@@ -121,7 +116,7 @@ public class BChapterController extends PaginationController<BChapter> {
String path = global.getMD_FILE_LOCATION(); String path = global.getMD_FILE_LOCATION();
String basePath = global.getBASE_UPLOAD_SERVER_LOCATION(); String basePath = global.getBASE_UPLOAD_SERVER_LOCATION();
boolean type = false; boolean type = false;
if((global.getSERVER_LINUX()).equals(global.getIS_SERVER_LINUX())){ if("1".equals(global.getIS_SERVER_LINUX())){
type = true; type = true;
} }
Map<String, Object> pic = UploadUtil.picImport(basePath, path, image, type); Map<String, Object> pic = UploadUtil.picImport(basePath, path, image, type);
......
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)));
}
}
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;
}
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);
}
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;
/*java 工程*/
if(examType.equals(global.getJavaProject()))
return null;
/*html 单文件*/
if(examType.equals(global.getHtmlSimple()))
return null;
/*html 工程*/
if(examType.equals(global.getHtmlProject()))
return null;
return null;
}
}
...@@ -3,7 +3,6 @@ package org.rcisoft.business.blesson.controller; ...@@ -3,7 +3,6 @@ package org.rcisoft.business.blesson.controller;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.collections4.Get;
import org.rcisoft.business.blesson.entity.BLesson; import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.blesson.service.BLessonService; import org.rcisoft.business.blesson.service.BLessonService;
import org.rcisoft.common.component.Global; import org.rcisoft.common.component.Global;
...@@ -14,22 +13,21 @@ import org.rcisoft.core.converter.MultipartFile2HSSFWorkbookConverter; ...@@ -14,22 +13,21 @@ import org.rcisoft.core.converter.MultipartFile2HSSFWorkbookConverter;
import org.rcisoft.core.exception.ServiceException; import org.rcisoft.core.exception.ServiceException;
import org.rcisoft.core.model.PersistModel; import org.rcisoft.core.model.PersistModel;
import org.rcisoft.core.result.Result; import org.rcisoft.core.result.Result;
import org.rcisoft.core.result.ResultCode;
import org.rcisoft.core.result.ResultServiceEnums; import org.rcisoft.core.result.ResultServiceEnums;
import org.rcisoft.core.util.UploadUtil; import org.rcisoft.core.util.UploadUtil;
import org.rcisoft.core.util.UserUtil; import org.rcisoft.core.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Map; import java.util.Map;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
/** /**
* Created by CodeGenerator on 2017/07/12. * Created by CodeGenerator on 2017/07/12.
*/ */
...@@ -102,7 +100,7 @@ public class BLessonController extends PaginationController<BLesson> { ...@@ -102,7 +100,7 @@ public class BLessonController extends PaginationController<BLesson> {
String path = global.getBASE_UPLOAD_SERVER_LOCATION(); String path = global.getBASE_UPLOAD_SERVER_LOCATION();
String course_logo_path =global.getIMAGE_LOCATION()+global.getCOURCE_LOGO_LOCATION(); String course_logo_path =global.getIMAGE_LOCATION()+global.getCOURCE_LOGO_LOCATION();
boolean type = false; boolean type = false;
if((global.getSERVER_LINUX()).equals(global.getIS_SERVER_LINUX())){ if("1".equals(global.getIS_SERVER_LINUX())){
type = true; type = true;
} }
Map<String,Object> map= UploadUtil.picImport(path,course_logo_path,importFile,type); Map<String,Object> map= UploadUtil.picImport(path,course_logo_path,importFile,type);
......
...@@ -3,7 +3,6 @@ package org.rcisoft.business.bsl.controller; ...@@ -3,7 +3,6 @@ package org.rcisoft.business.bsl.controller;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.rcisoft.business.blesson.entity.BLesson;
import org.rcisoft.business.bsl.dto.SlDetailDTO; import org.rcisoft.business.bsl.dto.SlDetailDTO;
import org.rcisoft.business.bsl.entity.BSl; import org.rcisoft.business.bsl.entity.BSl;
import org.rcisoft.business.bsl.service.BSlService; import org.rcisoft.business.bsl.service.BSlService;
...@@ -21,14 +20,12 @@ import org.rcisoft.core.util.UploadUtil; ...@@ -21,14 +20,12 @@ import org.rcisoft.core.util.UploadUtil;
import org.rcisoft.core.util.UserUtil; import org.rcisoft.core.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -164,7 +161,7 @@ public class BSlController extends PaginationController<BSl> { ...@@ -164,7 +161,7 @@ public class BSlController extends PaginationController<BSl> {
String path = global.getBASE_UPLOAD_SERVER_LOCATION(); String path = global.getBASE_UPLOAD_SERVER_LOCATION();
String sl_logo_path = global.getIMAGE_LOCATION() + global.getLANCH_LOGO_LOCATION(); String sl_logo_path = global.getIMAGE_LOCATION() + global.getLANCH_LOGO_LOCATION();
boolean type = false; boolean type = false;
if((global.getSERVER_LINUX()).equals(global.getIS_SERVER_LINUX())){ if("1".equals(global.getIS_SERVER_LINUX())){
type = true; type = true;
} }
Map<String, Object> uploadResult = UploadUtil.picImport(path, sl_logo_path, cover,type); Map<String, Object> uploadResult = UploadUtil.picImport(path, sl_logo_path, cover,type);
......
...@@ -24,14 +24,12 @@ public class Global { ...@@ -24,14 +24,12 @@ public class Global {
*/ */
static Map<String, String> map = Maps.newHashMap(); static Map<String, String> map = Maps.newHashMap();
/*服务器地址*/ /*服务器地址*/
@Value("${global.other.server_url}") @Value("${global.other.server_url}")
private String SERVER_URL; private String SERVER_URL;
/*服务器保存图片路径*/
@Value("${global.other.server_linux}")
private String SERVER_LINUX;
/*服务器保存图片路径*/ /*服务器保存图片路径*/
@Value("${global.path.base_upload_server_location}") @Value("${global.path.base_upload_server_location}")
private String BASE_UPLOAD_SERVER_LOCATION; private String BASE_UPLOAD_SERVER_LOCATION;
...@@ -113,7 +111,7 @@ public class Global { ...@@ -113,7 +111,7 @@ public class Global {
private String MD_FILE_LOCATION; private String MD_FILE_LOCATION;
/*登录验证秘钥*/ /*登录验证秘钥*/
@Value("${global.other.login_secert_key}") @Value("${jwt.login_secert_key}")
private String LOGIN_SECERT_KEY; private String LOGIN_SECERT_KEY;
@Value("${jwt.header}") @Value("${jwt.header}")
...@@ -186,9 +184,7 @@ public class Global { ...@@ -186,9 +184,7 @@ public class Global {
@Value("${global.git_lab.port}") @Value("${global.git_lab.port}")
private String GIT_LAB_PORT; private String GIT_LAB_PORT;
/*gitlab管理员秘钥*/
@Value("${global.other.session_admin_header_value}")
private String SESSION_ADMIN_HEADER_VALUE;
/*password最小长度*/ /*password最小长度*/
@Value("${global.password.min_password}") @Value("${global.password.min_password}")
...@@ -219,4 +215,19 @@ public class Global { ...@@ -219,4 +215,19 @@ public class Global {
private String studentCode; 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;
} }
package org.rcisoft.core.util; package org.rcisoft.core.util;
import io.jsonwebtoken.Claims; import io.jsonwebtoken.Claims;
import org.apache.commons.lang3.StringUtils;
import org.rcisoft.core.entity.IdEntity; import org.rcisoft.core.entity.IdEntity;
import org.rcisoft.core.model.JwtUser; import org.rcisoft.core.model.JwtUser;
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
...@@ -29,6 +30,8 @@ public class UserUtil { ...@@ -29,6 +30,8 @@ public class UserUtil {
* @return * @return
*/ */
public static String getUserInfoProp(String token,String prop){ public static String getUserInfoProp(String token,String prop){
if(StringUtils.isEmpty(token))
return null;
Claims claims = JwtUtil.getUserClaimsFromToken(token); Claims claims = JwtUtil.getUserClaimsFromToken(token);
return claims.get(prop).toString(); return claims.get(prop).toString();
} }
......
...@@ -69,6 +69,7 @@ jwt: ...@@ -69,6 +69,7 @@ jwt:
secret: mySecret secret: mySecret
expiration: 604800 expiration: 604800
tokenHead: "Bearer " tokenHead: "Bearer "
login_secert_key: "base64EncodedSecretKey"
route: route:
authentication: authentication:
path: "/login" path: "/login"
...@@ -121,11 +122,8 @@ global: ...@@ -121,11 +122,8 @@ global:
che_project_init_location: /working/dockervolume/chedir/project che_project_init_location: /working/dockervolume/chedir/project
other: other:
server_url: http://gwf.natapp.cc/eduServer server_url: http://gwf.natapp.cc/eduServer
server_linux: 1 is_server_linux: 1
login_secert_key: "base64EncodedSecretKey"
is_server_linux: 5
max_code_length: 15 max_code_length: 15
session_admin_header_value: pYez25-y7nqPfm9seY2S
code: code:
admin: ROLE_1001 admin: ROLE_1001
teacher: ROLE_1002 teacher: ROLE_1002
......
server: server:
port: 8081 port: 8081
context-path: / #ContextPath must start with '/' and not end with '/' context-path: /edu #ContextPath must start with '/' and not end with '/'
tomcat: tomcat:
max-threads: 300 max-threads: 300
#uri-encoding: UTF-8
#logging: #logging:
# level: # level:
...@@ -10,7 +11,7 @@ server: ...@@ -10,7 +11,7 @@ server:
# org.springframework.web: DEBUG # org.springframework.web: DEBUG
druid: 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 username: root
password: cy password: cy
initial-size: 1 initial-size: 1
...@@ -20,12 +21,12 @@ druid: ...@@ -20,12 +21,12 @@ druid:
mybatis: mybatis:
mapper-locations: classpath:mapper/*.xml mapper-locations: classpath:mapper/**/**/*.xml
mapper: mapper:
mappers: mappers:
- org.yxyqcy.sys.base.BaseMapper - org.rcisoft.core.base.BaseMapper
not-empty: false not-empty: false
identity: MYSQL identity: MYSQL
...@@ -40,7 +41,12 @@ spring: ...@@ -40,7 +41,12 @@ spring:
jackson: jackson:
default-property-inclusion: non_null default-property-inclusion: non_null
http: http:
# encoding:
# force: true
# charset: UTF-8
# enabled: true
multipart: multipart:
enabled: true
max-file-size: 100Mb max-file-size: 100Mb
max-request-size: 1000Mb max-request-size: 1000Mb
mvc: mvc:
...@@ -48,13 +54,82 @@ spring: ...@@ -48,13 +54,82 @@ spring:
resources: resources:
add-mappings: false add-mappings: false
springfox:
documentation:
swagger:
v2:
path: /api-docs
#jwtAuth:
# header: Authorization
# token_header: CyBear
# secret_key: base64EncodedSecretKey
jwt: jwt:
header: Authorization header: Authorization
secret: mySecret secret: mySecret
expiration: 604800 expiration: 604800
tokenHead: "Bearer " tokenHead: "Bearer "
login_secert_key: "base64EncodedSecretKey"
route: route:
authentication: authentication:
path: auth path: "/login"
refresh: refresh refresh: "/refresh"
register: "auth/register" register: "/register"
\ No newline at end of file
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
# 存储结构
## 文件存储
|eduServer| (nginx server)
| course| (课程)
|lesson|(课程)
|images|(课程图片)
|lessonId|
|chapterId|
|video|
|乱码文件|
|file|
|乱码文件|
|ppt|
|乱码文件|
|pdf|
|乱码文件|
|sl| (开课)
|images|(开课图片)
|lessonId|
|project|
|userid|
文件夹
|chapterId|
|video|
|乱码文件|
|file|
|乱码文件|
|ppt|
|乱码文件|
|pdf|
|乱码文件|
|homework|
|userid|
|乱码文件|
|code|
userid.文件
|mdfiles| (待确认)
|2017|
|07|
| temp | (临时)
|system|
|images|(轮播图)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment