Commit 63a8f783 by tangyi

优化

parent fb1bdf99
## spring-microservice-exam
- 在线体验-前台:[http://www.it99.club](http://www.it99.club)
- 在线体验-后台:[http://www.it99.club:81](http://www.it99.club:81)
交流QQ群:996208878
如果您觉得有帮助,请点右上角 "Star" 或者项目底部的“捐助”支持一下,谢谢!
项目源码地址
- 前台ui:[spring-microservice-exam-web](https://gitee.com/wells2333/spring-microservice-exam-web.git)
- 后台ui:[spring-microservice-exam-ui](https://gitee.com/wells2333/spring-microservice-exam-ui.git)
- 后端:[spring-microservice-exam](https://gitee.com/wells2333/spring-microservice-exam.git)
## 简介
- 重写[spring-cloud-online-exam](https://gitee.com/wells2333/spring-cloud-online-exam)
......@@ -14,10 +24,6 @@
- 后端基于`spring boot``spring cloud``MySQL`等技术实现权限管理、考试管理等功能。
- 在线体验-前台:[http://www.it99.club](http://www.it99.club)
- 在线体验-后台:[http://www.it99.club:81](http://www.it99.club:81)
默认账号:
1. 管理员:admin/123456
......@@ -80,7 +86,7 @@
考务管理:提供课程、考试、题库、成绩等管理
- 课程管理:课程信息增删改查
- 考试管理:考试信息增删改查、题目管理、发布回收
- 考试管理:考试信息增删改查、题目管理、发布回收,题目管理支持简单文本、富文本输入、从题库添加等
- 题库管理:题目分类增删改查、题目信息增删改查
- 成绩管理:查看成绩、导出成绩
- 知识库:知识库增删改查、上传附件
......@@ -94,26 +100,43 @@
## 功能演示
### 前台
### 前台功能
1. 登录
![image](doc/images/image_web_login.png)
2. 考试
![image](doc/images/image_web_exam.png)
![image](doc/images/image_web_text_subject.png)
3. 答题卡
![image](doc/images/image_web_exam_card.png)
4. 查看成绩
![image](doc/images/image_web_exam_score.png)
5. 查看错题
![image](doc/images/image_web_incorrect_answer.png)
### 后台
### 后台功能
1. 总体功能
![image](doc/images/image_ui_menu.png)
2. 考试管理
![image](doc/images/image_ui_exam.png)
3. 题目管理
![image](doc/images/image_ui_exam_subject.png)
![image](doc/images/image_ui_subjects_rich_edit.png)
4. 题库管理
![image](doc/images/image_ui_subject.png)
5. 个人资料
![image](doc/images/image_ui_msg.png)
## 部署文档
......
......@@ -83,7 +83,7 @@ fdfs:
# 系统配置
sys:
fdfsHttpHost: ${ATTACHMENT_HOST:http://182.254.233.125}:${ATTACHMENT_PORT:80} # fastDfs的HTTP配置
fdfsHttpHost: ${ATTACHMENT_HOST:http://182.254.233.125}:${ATTACHMENT_PORT:8080} # fastDfs的HTTP配置
uploadUrl: api/user/v1/attachment/upload
defaultAvatar: https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif?imageView2/1/w/80/h/80
......
doc/images/image_web_exam.png

59 KB | W: | H:

doc/images/image_web_exam.png

49.5 KB | W: | H:

doc/images/image_web_exam.png
doc/images/image_web_exam.png
doc/images/image_web_exam.png
doc/images/image_web_exam.png
  • 2-up
  • Swipe
  • Onion skin
doc/images/image_web_exam_all.png

58.8 KB | W: | H:

doc/images/image_web_exam_all.png

90.7 KB | W: | H:

doc/images/image_web_exam_all.png
doc/images/image_web_exam_all.png
doc/images/image_web_exam_all.png
doc/images/image_web_exam_all.png
  • 2-up
  • Swipe
  • Onion skin
doc/images/image_web_exam_card.png

63.7 KB | W: | H:

doc/images/image_web_exam_card.png

68.9 KB | W: | H:

doc/images/image_web_exam_card.png
doc/images/image_web_exam_card.png
doc/images/image_web_exam_card.png
doc/images/image_web_exam_card.png
  • 2-up
  • Swipe
  • Onion skin
doc/images/image_web_exam_score.png

26.7 KB | W: | H:

doc/images/image_web_exam_score.png

55 KB | W: | H:

doc/images/image_web_exam_score.png
doc/images/image_web_exam_score.png
doc/images/image_web_exam_score.png
doc/images/image_web_exam_score.png
  • 2-up
  • Swipe
  • Onion skin
package com.github.tangyi.user.controller;
import com.github.tangyi.common.core.model.ResponseBean;
import com.github.tangyi.common.core.vo.UserVo;
import com.github.tangyi.common.core.web.BaseController;
import com.github.tangyi.exam.api.feign.ExaminationServiceClient;
import com.github.tangyi.user.api.dto.DashboardDto;
import com.github.tangyi.user.api.feign.UserServiceClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -25,6 +27,9 @@ public class DashboardController extends BaseController {
@Autowired
private ExaminationServiceClient examinationService;
@Autowired
private UserServiceClient userServiceClient;
/**
* 获取管控台首页数据
*
......@@ -35,13 +40,12 @@ public class DashboardController extends BaseController {
*/
@GetMapping
@ApiOperation(value = "后台首页数据展示", notes = "后台首页数据展示")
@SuppressWarnings("unchecked")
public ResponseBean<DashboardDto> dashboard() {
DashboardDto dashboardDto = new DashboardDto();
// TODO 从redis里获取在线用户数
dashboardDto.setOnlineUserNumber("790");
// 查询用户数量
dashboardDto.setOnlineUserNumber(userServiceClient.findUserCount(new UserVo()).getData().toString());
// 查询考试数量
dashboardDto.setExaminationNumber(examinationService.findExaminationCount().getData() + "");
dashboardDto.setExaminationNumber(examinationService.findExaminationCount().getData().toString());
return new ResponseBean<>(dashboardDto);
}
}
......@@ -461,4 +461,17 @@ public class UserController extends BaseController {
exist = userService.selectUserVoByUsername(username) != null;
return new ResponseBean<>(exist);
}
/**
* 查询用户数量
*
* @param userVo userVo
* @return ResponseBean
* @author tangyi
* @date 2019/05/09 22:09
*/
@PostMapping("userCount")
public ResponseBean<Integer> userCount(UserVo userVo) {
return new ResponseBean<>(userService.userCount(userVo));
}
}
......@@ -23,4 +23,12 @@ public interface UserMapper extends CrudMapper<User> {
* @return userVo
*/
UserVo selectUserVoByUsername(String username);
/**
* 查询用户数量
*
* @param userVo userVo
* @return Integer
*/
Integer userCount(UserVo userVo);
}
......@@ -202,4 +202,16 @@ public class UserService extends CrudService<UserMapper, User> {
userRoleMapper.deleteByUserId(user.getId());
return super.delete(user);
}
/**
* 查询用户数量
*
* @param userVo userVo
* @return int
* @author tangyi
* @date 2019/05/09 22:10
*/
public Integer userCount(UserVo userVo) {
return this.dao.userCount(userVo);
}
}
......@@ -154,6 +154,10 @@
WHERE a.id = #{id}
</select>
<select id="userCount" resultType="Integer">
SELECT COUNT(1) FROM sys_user a WHERE a.del_flag = 0
</select>
<select id="findList" resultMap="userResultMap">
SELECT
<include refid="userColumns"/>
......
......@@ -55,6 +55,17 @@ public interface UserServiceClient {
ResponseBean<List<UserVo>> findUserById(@RequestBody UserVo userVo);
/**
* 查询用户数量
*
* @param userVo userVo
* @return ResponseBean
* @author tangyi
* @date 2019/05/09 22:04
*/
@RequestMapping(value = "/v1/user/userCount", method = RequestMethod.POST)
ResponseBean<Integer> findUserCount(@RequestBody UserVo userVo);
/**
* 根据部门id获取部门
*
* @param deptVo deptVo
......
......@@ -65,6 +65,18 @@ public class UserServiceClientFallbackImpl implements UserServiceClient {
}
/**
* 查询用户数量
*
* @param userVo userVo
* @return ResponseBean
*/
@Override
public ResponseBean<Integer> findUserCount(UserVo userVo) {
logger.error("调用{}异常:{},{}", "findUserCount", userVo, throwable);
return new ResponseBean<>(0);
}
/**
* 根据部门ID批量查询部门信息
*
* @param deptVo deptVo
......
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