Browse Source

下载地址修改

wangliang 2 years ago
parent
commit
9d06484c61

+ 2 - 2
themis-admin/src/main/java/com/qmth/themis/admin/api/DownloadController.java

@@ -32,7 +32,7 @@ import java.util.Optional;
  */
  */
 @Api(tags = "下载信息Controller")
 @Api(tags = "下载信息Controller")
 @RestController
 @RestController
-@RequestMapping(SystemConstant.PREFIX_URL_DOWNLOAD)
+@RequestMapping(SystemConstant.PREFIX_URL_ADMIN)
 public class DownloadController {
 public class DownloadController {
 
 
     @Resource
     @Resource
@@ -45,7 +45,7 @@ public class DownloadController {
     TBClientVersionService tbClientVersionService;
     TBClientVersionService tbClientVersionService;
 
 
     @ApiOperation(value = "根据机构代码查询下载安装包信息接口")
     @ApiOperation(value = "根据机构代码查询下载安装包信息接口")
-    @RequestMapping(value = "/package", method = RequestMethod.POST)
+    @RequestMapping(value = "/download/package", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "机构信息", response = TBOrgDownloadBean.class)})
     @ApiResponses({@ApiResponse(code = 200, message = "机构信息", response = TBOrgDownloadBean.class)})
     public Result downloadPackage(@ApiParam(value = "机构code", required = true) @RequestParam String code) {
     public Result downloadPackage(@ApiParam(value = "机构code", required = true) @RequestParam String code) {
         Optional.ofNullable(code).orElseThrow(() -> new BusinessException(ExceptionResultEnum.ORG_CODE_IS_NULL));
         Optional.ofNullable(code).orElseThrow(() -> new BusinessException(ExceptionResultEnum.ORG_CODE_IS_NULL));

+ 90 - 90
themis-admin/src/main/java/com/qmth/themis/admin/api/TBProblemController.java

@@ -1,90 +1,90 @@
-package com.qmth.themis.admin.api;
-
-import com.qmth.themis.business.bean.admin.ProblemBean;
-import com.qmth.themis.business.constant.SystemConstant;
-import com.qmth.themis.business.entity.TBProblem;
-import com.qmth.themis.business.entity.TBUser;
-import com.qmth.themis.business.service.TBProblemService;
-import com.qmth.themis.business.service.ThemisCacheService;
-import com.qmth.themis.business.util.RedisUtil;
-import com.qmth.themis.business.util.ServletUtil;
-import com.qmth.themis.common.exception.BusinessException;
-import com.qmth.themis.common.util.Result;
-import com.qmth.themis.common.util.ResultUtil;
-import io.swagger.annotations.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.util.CollectionUtils;
-import org.springframework.validation.BindingResult;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.annotation.Resource;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
-
-/**
- * @Description: 考试问题 前端控制器
- * @Param:
- * @return:
- * @Author: wangliang
- * @Date: 2023/3/14
- */
-@Api(tags = "考试问题 Controller")
-@RestController
-@RequestMapping(SystemConstant.PREFIX_URL_ADMIN + "/problem")
-@Validated
-public class TBProblemController {
-    private final static Logger log = LoggerFactory.getLogger(TBProblemController.class);
-
-    @Resource
-    TBProblemService tbProblemService;
-
-    @Resource
-    ThemisCacheService themisCacheService;
-
-    @Resource
-    RedisUtil redisUtil;
-
-    @ApiOperation(value = "问题查询接口")
-    @RequestMapping(value = "/list", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "问题信息", response = TBProblem.class)})
-    public Result list() {
-        return ResultUtil.ok(themisCacheService.problemCache());
-    }
-
-    @ApiOperation(value = "问题保存接口")
-    @RequestMapping(value = "/save", method = RequestMethod.POST)
-    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = Result.class)})
-    @Transactional
-    public Result save(@Validated @ApiParam(value = "问题信息", required = true) @RequestBody ProblemBean problemBean, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
-            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
-        }
-        List<TBProblem> tbProblemList = themisCacheService.problemCache();
-        if (!CollectionUtils.isEmpty(tbProblemList)) {
-            TBProblem tbProblem = tbProblemList.stream().filter(e -> e.getId().longValue() == problemBean.getId().longValue()).collect(Collectors.toList()).get(0);
-            Optional.ofNullable(tbProblem).orElseThrow(() -> new BusinessException("问题信息不存在"));
-            if (redisUtil.lock(SystemConstant.REDIS_LOCK_PROBLEM_PREFIX + tbProblem.getId() + "_" + problemBean.getSolve(), SystemConstant.REDIS_LOCK_PROBLEM_TIME_OUT)) {
-                try {
-                    if (problemBean.getSolve()) {
-                        tbProblem.setSolveCount(tbProblem.getSolveCount() + 1);
-                    } else {
-                        tbProblem.setUnSolveCount(tbProblem.getUnSolveCount() + 1);
-                    }
-                    tbProblem.setUpdateTime(System.currentTimeMillis());
-                    tbProblemService.updateById(tbProblem);
-                    themisCacheService.updateProblemCache();
-                } finally {
-                    redisUtil.releaseLock(SystemConstant.REDIS_LOCK_PROBLEM_PREFIX + tbProblem.getId() + "_" + problemBean.getSolve());
-                }
-            }
-        }
-        return ResultUtil.ok(true);
-    }
-}
+//package com.qmth.themis.admin.api;
+//
+//import com.qmth.themis.business.bean.admin.ProblemBean;
+//import com.qmth.themis.business.constant.SystemConstant;
+//import com.qmth.themis.business.entity.TBProblem;
+//import com.qmth.themis.business.entity.TBUser;
+//import com.qmth.themis.business.service.TBProblemService;
+//import com.qmth.themis.business.service.ThemisCacheService;
+//import com.qmth.themis.business.util.RedisUtil;
+//import com.qmth.themis.business.util.ServletUtil;
+//import com.qmth.themis.common.exception.BusinessException;
+//import com.qmth.themis.common.util.Result;
+//import com.qmth.themis.common.util.ResultUtil;
+//import io.swagger.annotations.*;
+//import org.slf4j.Logger;
+//import org.slf4j.LoggerFactory;
+//import org.springframework.transaction.annotation.Transactional;
+//import org.springframework.util.CollectionUtils;
+//import org.springframework.validation.BindingResult;
+//import org.springframework.validation.annotation.Validated;
+//import org.springframework.web.bind.annotation.RequestBody;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RequestMethod;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import javax.annotation.Resource;
+//import java.util.List;
+//import java.util.Optional;
+//import java.util.stream.Collectors;
+//
+///**
+// * @Description: 考试问题 前端控制器
+// * @Param:
+// * @return:
+// * @Author: wangliang
+// * @Date: 2023/3/14
+// */
+//@Api(tags = "考试问题 Controller")
+//@RestController
+//@RequestMapping(SystemConstant.PREFIX_URL_ADMIN + "/problem")
+//@Validated
+//public class TBProblemController {
+//    private final static Logger log = LoggerFactory.getLogger(TBProblemController.class);
+//
+//    @Resource
+//    TBProblemService tbProblemService;
+//
+//    @Resource
+//    ThemisCacheService themisCacheService;
+//
+//    @Resource
+//    RedisUtil redisUtil;
+//
+//    @ApiOperation(value = "问题查询接口")
+//    @RequestMapping(value = "/list", method = RequestMethod.POST)
+//    @ApiResponses({@ApiResponse(code = 200, message = "问题信息", response = TBProblem.class)})
+//    public Result list() {
+//        return ResultUtil.ok(themisCacheService.problemCache());
+//    }
+//
+//    @ApiOperation(value = "问题保存接口")
+//    @RequestMapping(value = "/save", method = RequestMethod.POST)
+//    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = Result.class)})
+//    @Transactional
+//    public Result save(@Validated @ApiParam(value = "问题信息", required = true) @RequestBody ProblemBean problemBean, BindingResult bindingResult) {
+//        if (bindingResult.hasErrors()) {
+//            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
+//        }
+//        List<TBProblem> tbProblemList = themisCacheService.problemCache();
+//        if (!CollectionUtils.isEmpty(tbProblemList)) {
+//            TBProblem tbProblem = tbProblemList.stream().filter(e -> e.getId().longValue() == problemBean.getId().longValue()).collect(Collectors.toList()).get(0);
+//            Optional.ofNullable(tbProblem).orElseThrow(() -> new BusinessException("问题信息不存在"));
+//            if (redisUtil.lock(SystemConstant.REDIS_LOCK_PROBLEM_PREFIX + tbProblem.getId() + "_" + problemBean.getSolve(), SystemConstant.REDIS_LOCK_PROBLEM_TIME_OUT)) {
+//                try {
+//                    if (problemBean.getSolve()) {
+//                        tbProblem.setSolveCount(tbProblem.getSolveCount() + 1);
+//                    } else {
+//                        tbProblem.setUnSolveCount(tbProblem.getUnSolveCount() + 1);
+//                    }
+//                    tbProblem.setUpdateTime(System.currentTimeMillis());
+//                    tbProblemService.updateById(tbProblem);
+//                    themisCacheService.updateProblemCache();
+//                } finally {
+//                    redisUtil.releaseLock(SystemConstant.REDIS_LOCK_PROBLEM_PREFIX + tbProblem.getId() + "_" + problemBean.getSolve());
+//                }
+//            }
+//        }
+//        return ResultUtil.ok(true);
+//    }
+//}

+ 0 - 1
themis-business/src/main/java/com/qmth/themis/business/constant/SystemConstant.java

@@ -78,7 +78,6 @@ public class SystemConstant {
     public static final String PREFIX_URL_NOTIFY = "/api/notify";
     public static final String PREFIX_URL_NOTIFY = "/api/notify";
     public static final String PREFIX_URL_OE = "/api/oe";
     public static final String PREFIX_URL_OE = "/api/oe";
     public static final String PREFIX_URL_MOBILE = "/api/mobile";
     public static final String PREFIX_URL_MOBILE = "/api/mobile";
-    public static final String PREFIX_URL_DOWNLOAD = "/api/download";
 
 
     public static final String ATTACHMENT_TYPE = "attachment.type";
     public static final String ATTACHMENT_TYPE = "attachment.type";
     public static final String ADMIN_LOGO_URL = "admin.logo.url";
     public static final String ADMIN_LOGO_URL = "admin.logo.url";

+ 1 - 1
themis-business/src/main/resources/db/init-table-data.sql

@@ -14,7 +14,7 @@ INSERT INTO `sys_config` VALUES (11, NULL, 'monitor.config.prefix', '监控前
 INSERT INTO `sys_config` VALUES (12, NULL, 'wxapp.upload.url', '微信上传url', 'http://192.168.10.86:6002', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
 INSERT INTO `sys_config` VALUES (12, NULL, 'wxapp.upload.url', '微信上传url', 'http://192.168.10.86:6002', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
 INSERT INTO `sys_config` VALUES (13, NULL, 'mq.config.topic', '消息队列topic', 'themis-topic-exam', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
 INSERT INTO `sys_config` VALUES (13, NULL, 'mq.config.topic', '消息队列topic', 'themis-topic-exam', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
 INSERT INTO `sys_config` VALUES (14, NULL, 'mq.config.body', '消息队列主体', '{\"USER_LOG_GROUP\":\"themis-group-exam-userLog\",\"EXAM_STUDENT_UPDATE_GROUP\":\"themis-group-exam-examStudentUpdate\",\"SCORE_CALCULATE_GROUP\":\"themis-group-exam-scoreCalculate\",\"WEBSOCKET_OE_GROUP\":\"themis-group-exam-websocketOe\",\"LOG_GROUP\":\"themis-group-exam-log\",\"TASK_GROUP\":\"themis-group-exam-task\",\"TENCENT_VIDEO_GROUP\":\"themis-group-exam-tencentVideo\",\"WEBSOCKET_OE_MOBILE_GROUP\":\"themis-group-exam-websocketOeMobile\",\"SESSION_GROUP\":\"themis-group-exam-session\",\"EXAM_RECORD_PERSISTED_GROUP\":\"themis-group-exam-examRecordPersisted\",\"WEBSOCKET_DELAY_GROUP\":\"themis-group-exam-websocketDelay\",\"EXAM_RECORD_UPDATE_GROUP\":\"themis-group-exam-examRecordUpdate\",\"EXAM_BREAK_DELAY_GROUP\":\"themis-group-exam-examBreakDelay\",\"EXAM_BREAK_RECORD_PERSISTED_GROUP\":\"themis-group-exam-examBreakHistoryPersisted\",\"EXAM_BREAK_GROUP\":\"themis-group-exam-examBreak\",\"QUARTZ_GROUP\":\"themis-group-exam-quartz\",\"LIVENESS_VERIFY_SAVE_GROUP\":\"themis-group-exam-livenessVerifySave\",\"CALCULATE_OBJECTIVE_SCORE_GROUP\":\"themis-group-exam-calculateObjectiveScore\",\"FACE_VERIFY_SAVE_GROUP\":\"themis-group-exam-faceVerifySave\"}', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
 INSERT INTO `sys_config` VALUES (14, NULL, 'mq.config.body', '消息队列主体', '{\"USER_LOG_GROUP\":\"themis-group-exam-userLog\",\"EXAM_STUDENT_UPDATE_GROUP\":\"themis-group-exam-examStudentUpdate\",\"SCORE_CALCULATE_GROUP\":\"themis-group-exam-scoreCalculate\",\"WEBSOCKET_OE_GROUP\":\"themis-group-exam-websocketOe\",\"LOG_GROUP\":\"themis-group-exam-log\",\"TASK_GROUP\":\"themis-group-exam-task\",\"TENCENT_VIDEO_GROUP\":\"themis-group-exam-tencentVideo\",\"WEBSOCKET_OE_MOBILE_GROUP\":\"themis-group-exam-websocketOeMobile\",\"SESSION_GROUP\":\"themis-group-exam-session\",\"EXAM_RECORD_PERSISTED_GROUP\":\"themis-group-exam-examRecordPersisted\",\"WEBSOCKET_DELAY_GROUP\":\"themis-group-exam-websocketDelay\",\"EXAM_RECORD_UPDATE_GROUP\":\"themis-group-exam-examRecordUpdate\",\"EXAM_BREAK_DELAY_GROUP\":\"themis-group-exam-examBreakDelay\",\"EXAM_BREAK_RECORD_PERSISTED_GROUP\":\"themis-group-exam-examBreakHistoryPersisted\",\"EXAM_BREAK_GROUP\":\"themis-group-exam-examBreak\",\"QUARTZ_GROUP\":\"themis-group-exam-quartz\",\"LIVENESS_VERIFY_SAVE_GROUP\":\"themis-group-exam-livenessVerifySave\",\"CALCULATE_OBJECTIVE_SCORE_GROUP\":\"themis-group-exam-calculateObjectiveScore\",\"FACE_VERIFY_SAVE_GROUP\":\"themis-group-exam-faceVerifySave\"}', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
-INSERT INTO `sys_config` VALUES (15, NULL, 'admin.no.auth.urls', 'admin无需鉴权的url', '/webjars/**,/druid/**,/swagger-ui.html,/doc.html,/swagger-resources/**,/v2/api-docs,/webjars/springfox-swagger-ui/**,/api/admin/user/login/account,/api/admin/sys/org/queryByOrgCode,/file/**,/upload/**,/client/**,/base_photo/**,/frontend/**,/api/admin/client/save,/api/admin/client/upload,/api/admin/client/query,/api/admin/app/save,/api/admin/app/query,/api/notify/monitor/record/tencent,/api/notify/monitor/status/tencent,/api/admin/sys/download/package,/api/admin/problem/list,/api/admin/problem/save', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
+INSERT INTO `sys_config` VALUES (15, NULL, 'admin.no.auth.urls', 'admin无需鉴权的url', '/webjars/**,/druid/**,/swagger-ui.html,/doc.html,/swagger-resources/**,/v2/api-docs,/webjars/springfox-swagger-ui/**,/api/admin/user/login/account,/api/admin/sys/org/queryByOrgCode,/file/**,/upload/**,/client/**,/base_photo/**,/frontend/**,/api/admin/client/save,/api/admin/client/upload,/api/admin/client/query,/api/admin/app/save,/api/admin/app/query,/api/notify/monitor/record/tencent,/api/notify/monitor/status/tencent,/api/admin/download/package', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
 INSERT INTO `sys_config` VALUES (16, NULL, 'admin.common.system.urls', 'admin系统url', '/api/admin/sys/getMenu,/api/admin/user/logout,/api/admin/sys/env,/api/admin/sys/file/upload,/api/admin/sys/file/download,/api/admin/sys/org/query,/api/admin/sys/role/query,/api/admin/sys/examActivity/query,/api/admin/sys/exam/query,/api/admin/sys/examRoom/query,/api/admin/sys/exam/privilegeQuery,/api/admin/student/photo/upload,/api/admin/sys/getPlayUrls,/api/admin/sys/exam/finish/query,/api/admin/sys/get_tencent_video', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
 INSERT INTO `sys_config` VALUES (16, NULL, 'admin.common.system.urls', 'admin系统url', '/api/admin/sys/getMenu,/api/admin/user/logout,/api/admin/sys/env,/api/admin/sys/file/upload,/api/admin/sys/file/download,/api/admin/sys/org/query,/api/admin/sys/role/query,/api/admin/sys/examActivity/query,/api/admin/sys/exam/query,/api/admin/sys/examRoom/query,/api/admin/sys/exam/privilegeQuery,/api/admin/student/photo/upload,/api/admin/sys/getPlayUrls,/api/admin/sys/exam/finish/query,/api/admin/sys/get_tencent_video', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
 INSERT INTO `sys_config` VALUES (17, NULL, 'exam.no.auth.urls', 'exam无需鉴权的url', '/webjars/**,/druid/**,/swagger-ui.html,/doc.html,/swagger-resources/**,/v2/api-docs,/webjars/springfox-swagger-ui/**,/api/oe/student/login,/api/oe/sys/env,/file/**,/upload/**,/client/**,/base_photo/**,/frontend/**,/api/oe/exam/short_code,/api/mobile/authorization,/api/oe/black/list/select,/api/oe/sys/school/list,/api/oe/sys/upload/package/callback', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
 INSERT INTO `sys_config` VALUES (17, NULL, 'exam.no.auth.urls', 'exam无需鉴权的url', '/webjars/**,/druid/**,/swagger-ui.html,/doc.html,/swagger-resources/**,/v2/api-docs,/webjars/springfox-swagger-ui/**,/api/oe/student/login,/api/oe/sys/env,/file/**,/upload/**,/client/**,/base_photo/**,/frontend/**,/api/oe/exam/short_code,/api/mobile/authorization,/api/oe/black/list/select,/api/oe/sys/school/list,/api/oe/sys/upload/package/callback', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
 INSERT INTO `sys_config` VALUES (18, NULL, 'exam.common.system.urls', 'exam系统url', '/api/oe/student/logout,/api/oe/exam/file/upload,/api/mobile/file/upload', 1, 1, NULL, NULL, NULL, NULL, 1, 0);
 INSERT INTO `sys_config` VALUES (18, NULL, 'exam.common.system.urls', 'exam系统url', '/api/oe/student/logout,/api/oe/exam/file/upload,/api/mobile/file/upload', 1, 1, NULL, NULL, NULL, NULL, 1, 0);