• SSM+Vue+Element-UI实现教资考前指导系统


    文末获取源码

    开发语言:Java
    框架:ssm
    JDK版本:JDK1.8
    服务器:tomcat7
    数据库:mysql 5.7/8.0
    数据库工具:Navicat11
    开发软件:eclipse/myeclipse/idea
    Maven包:Maven3.3.9
    浏览器:谷歌浏览器

    前言介绍

    对于本教资考前指导系统的设计来说,系统开发主要是采用java语言技术,在整个系统的设计中应用MySQL数据库来完成数据存储,具体根据教资考前指导系统的现状来进行开发的,具体根据现实的需求来实现四六级在线考试系统网络化的管理,各类信息有序地进行存储,进入教资考前指导系统页面之后,方可开始操作主控界面,主要功能包括:

    (1)前台:首页、教师问题、信息教资信息、复习资料、教学视频、在线练习、个人中心、后台管理

    (2)管理员:首页、个人中心、学生管理、教师管理、学院名称管理、问题信息管理、教资信息管理、资料类型管理、复习资料管理、教学视频管理、资质面试管理、点评信息管理、系统管理。 

    (3)学生:首页、个人中心、问题信息管理、资质面试管理、点评信息管理

    (4)教师:首页、个人中心、问题信息管理、资质面试管理、点评信息管理、练习题库管理、在线练习管理、练习管理

    系统展示

    前台

    登录页面

    问题信息

    教资信息

    复习资料 

    管理员页面 

    教师管理

    复习资料管理

    教学视频管理

    学生页面

    教师页面

    部分核心代码 

    在线练习表

    1. /**
    2. * 在线练习表
    3. * 后端接口
    4. * @author
    5. * @email
    6. * @date 2022-04-23 22:53:50
    7. */
    8. @RestController
    9. @RequestMapping("/exampaper")
    10. public class ExampaperController {
    11. @Autowired
    12. private ExampaperService exampaperService;
    13. /**
    14. * 后端列表
    15. */
    16. @RequestMapping("/page")
    17. public R page(@RequestParam Map<String, Object> params,ExampaperEntity exampaper,
    18. HttpServletRequest request){
    19. EntityWrapper<ExampaperEntity> ew = new EntityWrapper<ExampaperEntity>();
    20. PageUtils page = exampaperService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, exampaper), params), params));
    21. return R.ok().put("data", page);
    22. }
    23. /**
    24. * 前端列表
    25. */
    26. @IgnoreAuth
    27. @RequestMapping("/list")
    28. public R list(@RequestParam Map<String, Object> params,ExampaperEntity exampaper,
    29. HttpServletRequest request){
    30. EntityWrapper<ExampaperEntity> ew = new EntityWrapper<ExampaperEntity>();
    31. PageUtils page = exampaperService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, exampaper), params), params));
    32. return R.ok().put("data", page);
    33. }
    34. /**
    35. * 列表
    36. */
    37. @RequestMapping("/lists")
    38. public R list( ExampaperEntity exampaper){
    39. EntityWrapper<ExampaperEntity> ew = new EntityWrapper<ExampaperEntity>();
    40. ew.allEq(MPUtil.allEQMapPre( exampaper, "exampaper"));
    41. return R.ok().put("data", exampaperService.selectListView(ew));
    42. }
    43. /**
    44. * 查询
    45. */
    46. @RequestMapping("/query")
    47. public R query(ExampaperEntity exampaper){
    48. EntityWrapper< ExampaperEntity> ew = new EntityWrapper< ExampaperEntity>();
    49. ew.allEq(MPUtil.allEQMapPre( exampaper, "exampaper"));
    50. ExampaperView exampaperView = exampaperService.selectView(ew);
    51. return R.ok("查询在线练习表成功").put("data", exampaperView);
    52. }
    53. /**
    54. * 后端详情
    55. */
    56. @RequestMapping("/info/{id}")
    57. public R info(@PathVariable("id") Long id){
    58. ExampaperEntity exampaper = exampaperService.selectById(id);
    59. return R.ok().put("data", exampaper);
    60. }
    61. /**
    62. * 前端详情
    63. */
    64. @IgnoreAuth
    65. @RequestMapping("/detail/{id}")
    66. public R detail(@PathVariable("id") Long id){
    67. ExampaperEntity exampaper = exampaperService.selectById(id);
    68. return R.ok().put("data", exampaper);
    69. }
    70. /**
    71. * 后端保存
    72. */
    73. @RequestMapping("/save")
    74. public R save(@RequestBody ExampaperEntity exampaper, HttpServletRequest request){
    75. exampaper.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    76. //ValidatorUtils.validateEntity(exampaper);
    77. exampaperService.insert(exampaper);
    78. return R.ok();
    79. }
    80. /**
    81. * 前端保存
    82. */
    83. @RequestMapping("/add")
    84. public R add(@RequestBody ExampaperEntity exampaper, HttpServletRequest request){
    85. exampaper.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    86. //ValidatorUtils.validateEntity(exampaper);
    87. exampaperService.insert(exampaper);
    88. return R.ok();
    89. }
    90. /**
    91. * 修改
    92. */
    93. @RequestMapping("/update")
    94. @Transactional
    95. public R update(@RequestBody ExampaperEntity exampaper, HttpServletRequest request){
    96. //ValidatorUtils.validateEntity(exampaper);
    97. exampaperService.updateById(exampaper);//全部更新
    98. return R.ok();
    99. }
    100. /**
    101. * 删除
    102. */
    103. @RequestMapping("/delete")
    104. public R delete(@RequestBody Long[] ids){
    105. exampaperService.deleteBatchIds(Arrays.asList(ids));
    106. return R.ok();
    107. }
    108. /**
    109. * 提醒接口
    110. */
    111. @RequestMapping("/remind/{columnName}/{type}")
    112. public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
    113. @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
    114. map.put("column", columnName);
    115. map.put("type", type);
    116. if(type.equals("2")) {
    117. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    118. Calendar c = Calendar.getInstance();
    119. Date remindStartDate = null;
    120. Date remindEndDate = null;
    121. if(map.get("remindstart")!=null) {
    122. Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
    123. c.setTime(new Date());
    124. c.add(Calendar.DAY_OF_MONTH,remindStart);
    125. remindStartDate = c.getTime();
    126. map.put("remindstart", sdf.format(remindStartDate));
    127. }
    128. if(map.get("remindend")!=null) {
    129. Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
    130. c.setTime(new Date());
    131. c.add(Calendar.DAY_OF_MONTH,remindEnd);
    132. remindEndDate = c.getTime();
    133. map.put("remindend", sdf.format(remindEndDate));
    134. }
    135. }
    136. Wrapper<ExampaperEntity> wrapper = new EntityWrapper<ExampaperEntity>();
    137. if(map.get("remindstart")!=null) {
    138. wrapper.ge(columnName, map.get("remindstart"));
    139. }
    140. if(map.get("remindend")!=null) {
    141. wrapper.le(columnName, map.get("remindend"));
    142. }
    143. int count = exampaperService.selectCount(wrapper);
    144. return R.ok().put("count", count);
    145. }
    146. }

    entity层

    1. /**
    2. * 点评信息
    3. * 数据库通用操作实体类(普通增删改查)
    4. * @author
    5. * @email
    6. * @date 2022-04-23 22:53:50
    7. */
    8. @TableName("dianpingxinxi")
    9. public class DianpingxinxiEntity<T> implements Serializable {
    10. private static final long serialVersionUID = 1L;
    11. public DianpingxinxiEntity() {
    12. }
    13. public DianpingxinxiEntity(T t) {
    14. try {
    15. BeanUtils.copyProperties(this, t);
    16. } catch (IllegalAccessException | InvocationTargetException e) {
    17. // TODO Auto-generated catch block
    18. e.printStackTrace();
    19. }
    20. }
    21. /**
    22. * 主键id
    23. */
    24. @TableId
    25. private Long id;
    26. /**
    27. * 标题
    28. */
    29. private String biaoti;
    30. /**
    31. * 学号
    32. */
    33. private String xuehao;
    34. /**
    35. * 姓名
    36. */
    37. private String xingming;
    38. /**
    39. * 点评内容
    40. */
    41. private String dianpingneirong;
    42. /**
    43. * 意见
    44. */
    45. private String yijian;
    46. /**
    47. * 点评时间
    48. */
    49. @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    50. @DateTimeFormat
    51. private Date dianpingshijian;
    52. /**
    53. * 工号
    54. */
    55. private String gonghao;
    56. /**
    57. * 教师姓名
    58. */
    59. private String jiaoshixingming;
    60. @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    61. @DateTimeFormat
    62. private Date addtime;
    63. public Date getAddtime() {
    64. return addtime;
    65. }
    66. public void setAddtime(Date addtime) {
    67. this.addtime = addtime;
    68. }
    69. public Long getId() {
    70. return id;
    71. }
    72. public void setId(Long id) {
    73. this.id = id;
    74. }
    75. /**
    76. * 设置:标题
    77. */
    78. public void setBiaoti(String biaoti) {
    79. this.biaoti = biaoti;
    80. }
    81. /**
    82. * 获取:标题
    83. */
    84. public String getBiaoti() {
    85. return biaoti;
    86. }
    87. /**
    88. * 设置:学号
    89. */
    90. public void setXuehao(String xuehao) {
    91. this.xuehao = xuehao;
    92. }
    93. /**
    94. * 获取:学号
    95. */
    96. public String getXuehao() {
    97. return xuehao;
    98. }
    99. /**
    100. * 设置:姓名
    101. */
    102. public void setXingming(String xingming) {
    103. this.xingming = xingming;
    104. }
    105. /**
    106. * 获取:姓名
    107. */
    108. public String getXingming() {
    109. return xingming;
    110. }
    111. /**
    112. * 设置:点评内容
    113. */
    114. public void setDianpingneirong(String dianpingneirong) {
    115. this.dianpingneirong = dianpingneirong;
    116. }
    117. /**
    118. * 获取:点评内容
    119. */
    120. public String getDianpingneirong() {
    121. return dianpingneirong;
    122. }
    123. /**
    124. * 设置:意见
    125. */
    126. public void setYijian(String yijian) {
    127. this.yijian = yijian;
    128. }
    129. /**
    130. * 获取:意见
    131. */
    132. public String getYijian() {
    133. return yijian;
    134. }
    135. /**
    136. * 设置:点评时间
    137. */
    138. public void setDianpingshijian(Date dianpingshijian) {
    139. this.dianpingshijian = dianpingshijian;
    140. }
    141. /**
    142. * 获取:点评时间
    143. */
    144. public Date getDianpingshijian() {
    145. return dianpingshijian;
    146. }
    147. /**
    148. * 设置:工号
    149. */
    150. public void setGonghao(String gonghao) {
    151. this.gonghao = gonghao;
    152. }
    153. /**
    154. * 获取:工号
    155. */
    156. public String getGonghao() {
    157. return gonghao;
    158. }
    159. /**
    160. * 设置:教师姓名
    161. */
    162. public void setJiaoshixingming(String jiaoshixingming) {
    163. this.jiaoshixingming = jiaoshixingming;
    164. }
    165. /**
    166. * 获取:教师姓名
    167. */
    168. public String getJiaoshixingming() {
    169. return jiaoshixingming;
    170. }
    171. }

    登陆拦截功能

    1. /**
    2. * 权限(Token)验证
    3. */
    4. @Component
    5. public class AuthorizationInterceptor implements HandlerInterceptor {
    6. public static final String LOGIN_TOKEN_KEY = "Token";
    7. @Autowired
    8. private TokenService tokenService;
    9. @Override
    10. public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
    11. //支持跨域请求
    12. response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
    13. response.setHeader("Access-Control-Max-Age", "3600");
    14. response.setHeader("Access-Control-Allow-Credentials", "true");
    15. response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization");
    16. response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin"));
    17. IgnoreAuth annotation;
    18. if (handler instanceof HandlerMethod) {
    19. annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class);
    20. } else {
    21. return true;
    22. }
    23. //从header中获取token
    24. String token = request.getHeader(LOGIN_TOKEN_KEY);
    25. /**
    26. * 不需要验证权限的方法直接放过
    27. */
    28. if(annotation!=null) {
    29. return true;
    30. }
    31. TokenEntity tokenEntity = null;
    32. if(StringUtils.isNotBlank(token)) {
    33. tokenEntity = tokenService.getTokenEntity(token);
    34. }
    35. if(tokenEntity != null) {
    36. request.getSession().setAttribute("userId", tokenEntity.getUserid());
    37. request.getSession().setAttribute("role", tokenEntity.getRole());
    38. request.getSession().setAttribute("tableName", tokenEntity.getTablename());
    39. request.getSession().setAttribute("username", tokenEntity.getUsername());
    40. return true;
    41. }
    42. PrintWriter writer = null;
    43. response.setCharacterEncoding("UTF-8");
    44. response.setContentType("application/json; charset=utf-8");
    45. try {
    46. writer = response.getWriter();
    47. writer.print(JSONObject.toJSONString(R.error(401, "请先登录")));
    48. } finally {
    49. if(writer != null){
    50. writer.close();
    51. }
    52. }
    53. // throw new EIException("请先登录", 401);
    54. return false;
    55. }
    56. }

  • 相关阅读:
    虚拟DOM,diff
    南美智利市场最全分析开发攻略,收藏一篇就够了
    【unaipp】tabBar配置/tabBar图标无法显示
    使用终端MobaXterm连接Centos
    头歌答案--爬虫实战
    [SQL开发笔记]BETWEEN操作符:选取介于两个值之间的数据范围内的值
    SpringBoot和Vue集成高德地图——基于SpringBoot和Vue的后台管理系统项目系列博客(二十一)
    Flutter 环境变量配置和flutter doctor中的错误解决
    新手一定要看的嵌入式学习方法
    【云原生 | Docker 基础篇】07、本地镜像发布到私有库
  • 原文地址:https://blog.csdn.net/m0_49113107/article/details/126520543