该系统​​框架​​后端采用Springboot、Mybatis框架,前端使用templates、bootstrap、layUI、WeAdmin、css、js等,适合做类似答题系统,要求界面美观的同学。主要功能包括:答题、提问、积分商城、资料管理、意见反馈等,以及管理员管理相关功能。

系统包含技术:

后端:Springboot、Mybatis
前端:templates、bootstrap、layUI、WeAdmin、css、js
开发工具:idea
数据库:mysql 5.7
JDK版本:jdk1.8
服务器:tomcat8

**

  • 下面是首页的截图:

**

基于SpringBoot的答题系统_spring

**

  • 下面是教师查询:

**

基于SpringBoot的答题系统_java_02


**

  • 查询用户列表采用v-for

**

<div class="layui-col-md3" v-for="item in userList">
<div class="layui-card layui-anim layui-anim-scale">
<div class="layui-card-header">{{item.userType==1?item.nickName:item.userName}}</div>
<div class="layui-card-body">
<div class="head-img-box">
<img class="head-img" :src="item.userPhoto" alt="...">
</div>
<div class="caption">
<p class="text-overflow">
{{item.userSummary!=null?item.userSummary:'这家伙很懒,没留下简介!'}}</p>
<p class="text-right">
<a th:if="${session.user}!=null" :href="'/home/index/ask?invitaId='+item.id"
class="layui-btn layui-btn-sm" role="button">{{item.userType==1?'去问学霸':'去问老师'}}</a>
<a th:if="${session.user}==null"
:href="'/home/index/login?pagePath=/home/index/ask?invitaId='+item.id"
class="layui-btn layui-btn-sm" role="button">登录提问</a>
<a :href="'/home/index/userinfo/'+item.id"
class="layui-btn layui-btn-normal layui-btn-sm" role="button">查看详情</a>
</p>
</div>
</div>
</div>
</div>

</div>

**

  • 答题

**

基于SpringBoot的答题系统_spring_03


选择一个提问即可答题

@RequestMapping("/addAnswer")
@ResponseBody
public ResponseBean addAnswer(AnswersWithBLOBs answer) {
if (answer.getAnswerPhotos() == null || answer.getAnswerPhotos().trim() == "") {
answer.setAnswerPhotos(null);
} else {
answer.setAnswerPhotos(answer.getAnswerPhotos().substring(1));
}


userService.updateIntegralById(5, answer.getUserId());

int affectedLine = qaService.addAnswer(answer);
if (affectedLine >= 1) {
QuestionsWithBLOBs question = qaService.findById(answer.getQuestionId());

if (question.getQuestionState()) {
User solveUser = userService.findById(answer.getUserId());
User questionUser = userService.findById(question.getUserId());
Map<String, Object> infoMap = new HashMap<>();
infoMap.put("solveUserId", solveUser.getId());
infoMap.put("solveNickName", solveUser.getNickName());
infoMap.put("userName", questionUser.getUserName());
infoMap.put("questionId", answer.getQuestionId());
infoMap.put("questionSummary", question.getQuestionSummary());
infoMap.put("answerSummary", answer.getAnswerSummary());
infoMap.put("gradeName", gradeService.findById(question.getGradeId()).getGradeName());
infoMap.put("subjectName", subjectService.findById(question.getSubjectId()).getSubjectName());
emailUtil.sendTemplateMailAsync(questionUser.getEmail(), "【答题吧-解答提醒】", infoMap, "email/new_answer");
}
return new ResponseBean(true, CommonErrorEnum.SUCCESS_OPTION);
} else {
return new ResponseBean(false, CommonErrorEnum.FAILED_QUESTION);
}
}

**

  • 积分兑换

**

基于SpringBoot的答题系统_java_04


**

  • 资料下载

**

基于SpringBoot的答题系统_spring_05


**

  • 后端部分实现:

**

基于SpringBoot的答题系统_javaweb_06

好了,上面就是部分的实现,如果大家有什么问题,可以私信交流学习。