Commit 130920bd authored by 李丛阳's avatar 李丛阳

java 开发环境

parent f97b402f
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;
return null;
}
}
......@@ -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;
}
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();
}
......
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
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