Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mindskip committed Jan 15, 2021
1 parent 1e96072 commit 0ceb719
Show file tree
Hide file tree
Showing 42 changed files with 362 additions and 156 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ target/
.project
.classpath

# idea ignore
# idea ignore
.idea/
*.ipr
*.iml
Expand All @@ -26,7 +26,7 @@ logs/
*.patch
*.tmp

# system ignore
# system ignore
.DS_Store
Thumbs.db

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Version 3, 19 November 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

<div align="center">

[![Gitee star](https://gitee.com/mindskip/xzs-mysql/badge/star.svg?theme=gitee)](https://gitee.com/mindskip/xzs-mysql)
[![Gitee fork](https://gitee.com/mindskip/xzs-mysql/badge/fork.svg?theme=gitee)](https://gitee.com/mindskip/xzs-mysql)
[![Github stars](https://img.shields.io/github/stars/mindskip/xzs-mysql?logo=github)](https://github.com/mindskip/xzs-mysql)
[![Github forks](https://img.shields.io/github/forks/mindskip/xzs-mysql?logo=github)](https://github.com/mindskip/xzs-mysql)
[![Github license](https://img.shields.io/badge/license-AGPL-yellow)](https://gitee.com/mindskip/xzs-mysql/blob/master/LICENSE)
[![Gitee star](https://gitee.com/mindskip/uexam/badge/star.svg?theme=gvp)](https://gitee.com/mindskip/uexam)
[![Gitee fork](https://gitee.com/mindskip/uexam/badge/fork.svg?theme=gvp)](https://gitee.com/mindskip/uexam)
[![Github stars](https://img.shields.io/github/stars/mindskip/xzs?logo=github)](https://github.com/mindskip/xzs)
[![Github forks](https://img.shields.io/github/forks/mindskip/xzs?logo=github)](https://github.com/mindskip/xzs)
[![Github license](https://img.shields.io/badge/license-AGPL-yellow)](https://gitee.com/mindskip/uexam/blob/master/LICENSE)

</div>

# 学之思在线考试系统 - Mysql版
# 学之思在线考试系统 - Postgresql版

## 项目介绍

Expand All @@ -39,7 +39,7 @@

### 学之思仓库版本地址

* gitee - postgresql :[https://gitee.com/mindskip/xzs-mysql](https://gitee.com/mindskip/xzs-mysql)
* gitee - postgresql :[https://gitee.com/mindskip/uexam](https://gitee.com/mindskip/uexam)
* gitee - mysql :[https://gitee.com/mindskip/xzs-mysql](https://gitee.com/mindskip/xzs-mysql)
* github - postgresql :[https://github.com/mindskip/xzs](https://github.com/mindskip/xzs)
* github - mysql :[https://github.com/mindskip/xzs-mysql](https://github.com/mindskip/xzs-mysql)
Expand All @@ -52,7 +52,7 @@

### 开发部署教程

* [https://mindskip.gitee.io/xzs-mysql](https://mindskip.gitee.io/xzs-mysql)
* [https://mindskip.gitee.io/uexam/](https://mindskip.gitee.io/uexam/)

### 学生系统功能

Expand Down Expand Up @@ -82,9 +82,9 @@

* 用户登录登出功能,登录会自动绑定微信账号,登出会解绑
* 首页包含任务中心、固定试卷、时段试卷,和web端保持一致
* 试卷模块固定试卷和时段试卷的分页查询,下拉加载更多,上拉刷新当前数据
* 记录模块考试结果的分页,包含了试卷基本信息
* 我的模块包含个人资料的修改个人动态消息中心模块
* 试卷模块固定试卷和时段试卷的分页查询,下拉加载更多,上拉刷新当前数据
* 记录模块考试结果的分页,包含了试卷基本信息
* 我的模块包含个人资料的修改个人动态消息中心模块

### 系统展示

Expand Down
Binary file added doc/frame/架构图.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/frame/架构图.vsdx
Binary file not shown.
Binary file modified doc/image/frame/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/image/frame/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

## 学之思仓库地址

gitee - mysql[https://gitee.com/mindskip/xzs-mysql](https://gitee.com/mindskip/xzs-mysql)
gitee - postgresql[https://gitee.com/mindskip/uexam](https://gitee.com/mindskip/uexam)

github - mysql[https://github.com/mindskip/xzs-mysql](https://github.com/mindskip/xzs-mysql)
github - postgresql[https://github.com/mindskip/xzs](https://github.com/mindskip/xzs)

## 运行环境

Expand All @@ -23,7 +23,7 @@ github - mysql :[https://github.com/mindskip/xzs-mysql](https://github.com/min
| 操作系统 | Windows / Linux |
| Jdk | 8 |
| Redis | 6.0 |
| Mysql | 8.0 |
| PostgreSql | 12.0 |

## 技术栈列表

Expand All @@ -32,7 +32,7 @@ github - mysql :[https://github.com/mindskip/xzs-mysql](https://github.com/min
* spring-boot 2.1.6.RELEASE
* spring-boot-security 用户登录验证
* undertow web容器
* mysql 最流行的开源数据库
* postgresql 优秀的开源数据库
* redis 缓存,提升系统性能
* mybatis 数据库中间件
* hikari 速度最快的数据库连接池
Expand All @@ -52,23 +52,23 @@ github - mysql :[https://github.com/mindskip/xzs-mysql](https://github.com/min

## 架构图

![架构图](https://gitee.com/mindskip/xzs-mysql/raw/master/doc/image/frame/1.png)
![架构图](https://gitee.com/mindskip/uexam/raw/master/doc/image/frame/1.png)

## 项目开发

### 开发说明

* redis 安装
* 进群获取到数据库脚本,创建表初始化数据,数据库名称为xzs
* 代码分为 mysql版本,配合相应的数据库使用
* 安装mysql ,导入xzs-mysql.sql脚本
* 代码分为 postgresql 版本,配合相应的数据库使用
* 安装postgresql ,导入xzx-postgresql.sql脚本
* 学生端默认账号:student / 123456
* 管理端默认账号:admin / 123456

### 后端开发

* /uexam/source/xzs为后台代码,建议使用IntelliJ IDEA打开
* 打开application-dev.yml文件中,配置好postgesql/mysql、redis的服务地址
* 打开application-dev.yml文件中,配置好postgesql、redis的服务地址
* 去七牛云官网申请好云存储账号,修改application.yml中的qn相关的配置
* 启动后台程序,默认端口为8000。
* 学生系统地址:<http://ip:8000/student>
Expand Down

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions source/xzs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,25 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>
<mysql.version>8.0.17</mysql.version>
<postgresql.version>42.2.6</postgresql.version>
<spring.boot.version>2.1.6.RELEASE</spring.boot.version>
</properties>



<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>


<repositories>
<repository>
<id>nexus-aliyun</id>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</repository>
</repositories>


<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -95,9 +92,9 @@


<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -161,7 +158,6 @@
</dependencies>



<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
* 学之思应用启动
* @author 武汉思维跳跃科技有限公司
*/
@SpringBootApplication
@EnableTransactionManagement
@EnableConfigurationProperties(value = { SystemConfig.class})
@EnableCaching
public class XzsApplication {

public static void main(String[] args) {
SpringApplication.run(XzsApplication.class, args);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
import java.util.HashMap;
import java.util.Map;

/**
* 全局异常处理
*/
@RestController
public class ErrorController extends BasicErrorController {

private static final String PATH = "/error";


public ErrorController() {
super(new DefaultErrorAttributes(), new ErrorProperties());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@RequestMapping(value = "/api/admin/dashboard")
public class DashboardController extends BaseApiController {


private final ExamPaperService examPaperService;
private final QuestionService questionService;
private final ExamPaperAnswerService examPaperAnswerService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,4 @@ public RestResponse questionUploadAndReadExcel(HttpServletRequest request) {
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
import com.mindskip.xzs.utility.ExamUtil;
import com.mindskip.xzs.utility.PageInfoHelper;
import com.mindskip.xzs.viewmodel.admin.exam.ExamPaperEditRequestVM;
import com.mindskip.xzs.viewmodel.student.exam.ExamPaperReadVM;
import com.mindskip.xzs.viewmodel.student.exam.ExamPaperSubmitItemVM;
import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageResponseVM;
import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageVM;
import com.github.pagehelper.PageInfo;
import com.mindskip.xzs.viewmodel.student.exam.ExamPaperReadVM;
import com.mindskip.xzs.viewmodel.student.exam.ExamPaperSubmitItemVM;
import com.mindskip.xzs.viewmodel.student.exam.ExamPaperSubmitVM;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
@Service
public class AuthenticationServiceImpl implements AuthenticationService {


private final UserService userService;
private final SystemConfig systemConfig;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.mindskip.xzs.repository.BaseMapper;
import com.mindskip.xzs.service.BaseService;
import lombok.AllArgsConstructor;

public abstract class BaseServiceImpl<T> implements BaseService<T> {

Expand All @@ -12,6 +11,7 @@ public BaseServiceImpl(BaseMapper<T> baseMapper) {
this.baseMapper = baseMapper;
}


@Override
public int deleteById(Integer id) {
return baseMapper.deleteByPrimaryKey(id);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mindskip.xzs.service.impl;

import com.mindskip.xzs.domain.*;
import com.mindskip.xzs.domain.*;
import com.mindskip.xzs.domain.enums.ExamPaperAnswerStatusEnum;
import com.mindskip.xzs.domain.enums.ExamPaperTypeEnum;
Expand All @@ -11,7 +12,6 @@
import com.mindskip.xzs.repository.*;
import com.mindskip.xzs.repository.ExamPaperAnswerMapper;
import com.mindskip.xzs.repository.ExamPaperMapper;
import com.mindskip.xzs.repository.QuestionMapper;
import com.mindskip.xzs.repository.TaskExamCustomerAnswerMapper;
import com.mindskip.xzs.service.ExamPaperAnswerService;
import com.mindskip.xzs.service.ExamPaperQuestionCustomerAnswerService;
Expand All @@ -24,7 +24,7 @@
import com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageVM;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mindskip.xzs.domain.*;
import com.mindskip.xzs.repository.QuestionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down Expand Up @@ -181,13 +181,12 @@ public List<Integer> selectMothCount() {

/**
* 用户提交答案的转化存储对象
*
* @param question question
* @param question question
* @param customerQuestionAnswer customerQuestionAnswer
* @param examPaper examPaper
* @param itemOrder itemOrder
* @param user user
* @param now now
* @param examPaper examPaper
* @param itemOrder itemOrder
* @param user user
* @param now now
* @return ExamPaperQuestionCustomerAnswer
*/
private ExamPaperQuestionCustomerAnswer ExamPaperQuestionCustomerAnswerFromVM(Question question, ExamPaperSubmitItemVM customerQuestionAnswer, ExamPaper examPaper, Integer itemOrder, User user, Date now) {
Expand All @@ -211,10 +210,9 @@ private ExamPaperQuestionCustomerAnswer ExamPaperQuestionCustomerAnswerFromVM(Qu

/**
* 判断提交答案是否正确,保留用户提交的答案
*
* @param examPaperQuestionCustomerAnswer examPaperQuestionCustomerAnswer
* @param question question
* @param customerQuestionAnswer customerQuestionAnswer
* @param question question
* @param customerQuestionAnswer customerQuestionAnswer
*/
private void setSpecialFromVM(ExamPaperQuestionCustomerAnswer examPaperQuestionCustomerAnswer, Question question, ExamPaperSubmitItemVM customerQuestionAnswer) {
QuestionTypeEnum questionTypeEnum = QuestionTypeEnum.fromCode(examPaperQuestionCustomerAnswer.getQuestionType());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.mindskip.xzs.service.impl;

import com.mindskip.xzs.domain.*;
import com.mindskip.xzs.domain.ExamPaper;
import com.mindskip.xzs.domain.Question;
import com.mindskip.xzs.domain.TextContent;
import com.mindskip.xzs.domain.enums.ExamPaperTypeEnum;
import com.mindskip.xzs.domain.exam.ExamPaperQuestionItemObject;
Expand All @@ -26,8 +28,6 @@
import com.mindskip.xzs.viewmodel.student.exam.ExamPaperPageVM;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mindskip.xzs.domain.ExamPaper;
import com.mindskip.xzs.domain.Question;
import com.mindskip.xzs.domain.User;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.qiniu.storage.UploadManager;
import com.qiniu.storage.model.DefaultPutRet;
import com.qiniu.util.Auth;
import lombok.AllArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -24,7 +23,6 @@ public class FileUploadImpl implements FileUpload {
private final Logger logger = LoggerFactory.getLogger(FileUpload.class);
private final SystemConfig systemConfig;


@Autowired
public FileUploadImpl(SystemConfig systemConfig) {
this.systemConfig = systemConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.mindskip.xzs.viewmodel.student.user.MessageRequestVM;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;


/**
* Rsa加密解密工具类
*/
/**
* @author 武汉思维跳跃科技有限公司
*/
Expand Down
5 changes: 2 additions & 3 deletions source/xzs/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ spring:
redis:
host: 192.168.0.96
datasource:
url: jdbc:mysql://192.168.0.96:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: root
url: jdbc:postgresql://192.168.0.96:5432/xzs
username: postgres
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
5 changes: 2 additions & 3 deletions source/xzs/src/main/resources/application-pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ spring:
redis:
host: localhost
datasource:
url: jdbc:mysql://101.132.110.182:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
username: root
url: jdbc:postgresql://localhost:5432/xzs
username: postgres
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
Loading

0 comments on commit 0ceb719

Please sign in to comment.