Commit 606c472e authored by YangZhaoJun1's avatar YangZhaoJun1

修改作业目录结构

parent 1bbd11fa
...@@ -3,6 +3,7 @@ package org.rcisoft.business.bcode.controller; ...@@ -3,6 +3,7 @@ package org.rcisoft.business.bcode.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.bcode.model.BCodeFile;
import org.rcisoft.business.bcode.service.BCodeService; import org.rcisoft.business.bcode.service.BCodeService;
import org.rcisoft.common.controller.PaginationController; import org.rcisoft.common.controller.PaginationController;
import org.rcisoft.core.constant.MessageConstant; import org.rcisoft.core.constant.MessageConstant;
...@@ -12,6 +13,8 @@ import org.rcisoft.core.util.UserUtil; ...@@ -12,6 +13,8 @@ import org.rcisoft.core.util.UserUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
/** /**
* Created by lcy on 18/1/3. * Created by lcy on 18/1/3.
* *
...@@ -40,11 +43,19 @@ public class BCodeController extends PaginationController { ...@@ -40,11 +43,19 @@ public class BCodeController extends PaginationController {
public Result queryOwnExamFiles(@RequestParam("slId") String slId, public Result queryOwnExamFiles(@RequestParam("slId") String slId,
@RequestParam("chapId") String chapId, @RequestParam("chapId") String chapId,
@RequestParam("examType") String examType){ @RequestParam("examType") String examType){
List<BCodeFile> list = bCodeServiceImpl.readExamFiles(slId, chapId, examType,
UserUtil.getUserInfoProp(getToken(), UserUtil.USER_ID),
UserUtil.getUserInfoProp(getToken(), UserUtil.USER_USERNAME));
if(examType.equals("0001")||examType.equals("1001"))
return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR,
list.get(0));
else
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bCodeServiceImpl.readExamFiles(slId, chapId, examType, UserUtil.getUserInfoProp(getToken(), UserUtil.USER_ID))); list);
} }
...@@ -63,7 +74,10 @@ public class BCodeController extends PaginationController { ...@@ -63,7 +74,10 @@ public class BCodeController extends PaginationController {
return Result.builder(new PersistModel(1), return Result.builder(new PersistModel(1),
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
MessageConstant.MESSAGE_ALERT_ERROR, MessageConstant.MESSAGE_ALERT_ERROR,
bCodeServiceImpl.saveOwnExamFiles(slId, chapId, examType, content, UserUtil.getUserInfoProp(getToken(), UserUtil.USER_ID))); bCodeServiceImpl.saveOwnExamFiles(slId, chapId, examType, content,
UserUtil.getUserInfoProp(getToken(), UserUtil.USER_ID),
UserUtil.getUserInfoProp(getToken(), UserUtil.USER_USERNAME)
));
} }
......
...@@ -22,7 +22,10 @@ public class BCodeFile { ...@@ -22,7 +22,10 @@ public class BCodeFile {
private Date lastModify; private Date lastModify;
private List<String> fileNameList; private String name;
private String id;
private String pId;
private List<BCodeFile> codeFileList;
} }
...@@ -2,6 +2,8 @@ package org.rcisoft.business.bcode.service; ...@@ -2,6 +2,8 @@ package org.rcisoft.business.bcode.service;
import org.rcisoft.business.bcode.model.BCodeFile; import org.rcisoft.business.bcode.model.BCodeFile;
import java.util.List;
/** /**
* Created by lcy on 18/1/3. * Created by lcy on 18/1/3.
*/ */
...@@ -14,7 +16,7 @@ public interface BCodeService { ...@@ -14,7 +16,7 @@ public interface BCodeService {
* @param userInfoProp * @param userInfoProp
* @return * @return
*/ */
BCodeFile readExamFiles(String slId, String chapId, String examType, String userInfoProp); List<BCodeFile> readExamFiles(String slId, String chapId, String examType, String userInfoProp, String StudentCode);
/** /**
...@@ -26,7 +28,7 @@ public interface BCodeService { ...@@ -26,7 +28,7 @@ public interface BCodeService {
* @param userInfoProp * @param userInfoProp
* @return * @return
*/ */
BCodeFile saveOwnExamFiles(String slId, String chapId, String examType, String content, String userInfoProp); BCodeFile saveOwnExamFiles(String slId, String chapId, String examType, String content, String userInfoProp, String studentCode);
String exportFiles(String slId, String studentId, String type, String slCode); String exportFiles(String slId, String studentId, String type, String slCode);
} }
...@@ -52,6 +52,7 @@ public class JwtUtil { ...@@ -52,6 +52,7 @@ public class JwtUtil {
Map<String,Object> map = new HashedMap(); Map<String,Object> map = new HashedMap();
map.put(userDetails.getUsername(),userDetails); map.put(userDetails.getUsername(),userDetails);
map.put(UserUtil.USER_ID,jwtUser.getBusinessId()); map.put(UserUtil.USER_ID,jwtUser.getBusinessId());
map.put(UserUtil.USER_USERNAME,jwtUser.getUsername());
String token = jwtBean.generateToken(userDetails.getUsername(),map); String token = jwtBean.generateToken(userDetails.getUsername(),map);
return token; return token;
} }
......
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