基于SSM的課程資源管理系統

末尾獲取源碼
開發語言:Java
Java開發工具:JDK1.8
后端框架:SSM
前端:采用JSP技術開發
數據庫:MySQL5.7和Navicat管理工具結合
服務器:Tomcat8.5
開發軟件:IDEA / Eclipse
是否Maven項目:是


目錄

一、項目簡介

二、系統部分功能

三、系統項目截圖

管理員模塊的實現

教師管理

學生管理

課程管理

作業管理

公告管理

教師模塊的實現

作業管理

學生模塊的實現

作業管理

四、核心代碼

登錄相關

文件上傳

封裝


一、項目簡介

隨著信息技術在管理上越來越深入而廣泛的應用,管理信息系統的實施在技術上已逐步成熟。本文介紹了課程資源管理系統的開發全過程。通過分析高校學生綜合素質評價管理方面的不足,創建了一個計算機管理課程資源管理系統的方案。文章介紹了課程資源管理系統的系統分析部分,包括可行性分析等,系統設計部分主要介紹了系統功能設計和數據庫設計。

本課程資源管理系統功能有個人中心,教師管理,學生管理,課程信息管理,作業信息管理,基礎數據管理,公告信息管理。因而具有一定的實用性。

本站是一個B/S模式系統,采用SSM框架,MYSQL數據庫設計開發,充分保證系統的穩定性。系統具有界面清晰、操作簡單,功能齊全的特點,使得課程資源管理系統管理工作系統化、規范化。


二、系統部分功能



三、系統項目截圖

管理員模塊的實現

教師管理

課程資源管理系統的系統管理員可以對教師信息添加修改刪除以及查詢操作。

?

學生管理

系統管理員可以查看對學生信息進行添加,修改,刪除以及查詢操作。

課程管理

系統管理員可以對課程信息進行添加,修改,刪除以及查詢操作。

?

作業管理

系統管理員可以對作業進行添加,修改,刪除以及查詢操作。

公告管理

系統管理員可以對公告進行添加,修改,刪除以及查詢操作。

?

教師模塊的實現

作業管理

教師可以對作業信息進行添加,修改,刪除以及查詢操作。

學生模塊的實現

作業管理

學生登錄可以看到自己的作業情況。?


四、核心代碼

登錄相關


package com.controller;import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;/*** 登錄相關*/
@RequestMapping("users")
@RestController
public class UserController{@Autowiredprivate UserService userService;@Autowiredprivate TokenService tokenService;/*** 登錄*/@IgnoreAuth@PostMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null || !user.getPassword().equals(password)) {return R.error("賬號或密碼不正確");}String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());return R.ok().put("token", token);}/*** 注冊*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用戶已存在");}userService.insert(user);return R.ok();}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 密碼重置*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request){UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));if(user==null) {return R.error("賬號不存在");}user.setPassword("123456");userService.update(user,null);return R.ok("密碼已重置為:123456");}/*** 列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/list")public R list( UserEntity user){EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();ew.allEq(MPUtil.allEQMapPre( user, "user")); return R.ok().put("data", userService.selectListView(ew));}/*** 信息*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") String id){UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 獲取用戶的session用戶信息*/@RequestMapping("/session")public R getCurrUser(HttpServletRequest request){Long id = (Long)request.getSession().getAttribute("userId");UserEntity user = userService.selectById(id);return R.ok().put("data", user);}/*** 保存*/@PostMapping("/save")public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {return R.error("用戶已存在");}userService.insert(user);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);userService.updateById(user);//全部更新return R.ok();}/*** 刪除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){userService.deleteBatchIds(Arrays.asList(ids));return R.ok();}
}

文件上傳

package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.UUID;import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.ConfigEntity;
import com.entity.EIException;
import com.service.ConfigService;
import com.utils.R;/*** 上傳文件映射表*/
@RestController
@RequestMapping("file")
@SuppressWarnings({"unchecked","rawtypes"})
public class FileController{@Autowiredprivate ConfigService configService;/*** 上傳文件*/@RequestMapping("/upload")public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {if (file.isEmpty()) {throw new EIException("上傳文件不能為空");}String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}String fileName = new Date().getTime()+"."+fileExt;File dest = new File(upload.getAbsolutePath()+"/"+fileName);file.transferTo(dest);FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));if(StringUtils.isNotBlank(type) && type.equals("1")) {ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "faceFile"));if(configEntity==null) {configEntity = new ConfigEntity();configEntity.setName("faceFile");configEntity.setValue(fileName);} else {configEntity.setValue(fileName);}configService.insertOrUpdate(configEntity);}return R.ok().put("file", fileName);}/*** 下載文件*/@IgnoreAuth@RequestMapping("/download")public ResponseEntity<byte[]> download(@RequestParam String fileName) {try {File path = new File(ResourceUtils.getURL("classpath:static").getPath());if(!path.exists()) {path = new File("");}File upload = new File(path.getAbsolutePath(),"/upload/");if(!upload.exists()) {upload.mkdirs();}File file = new File(upload.getAbsolutePath()+"/"+fileName);if(file.exists()){/*if(!fileService.canRead(file, SessionManager.getSessionUser())){getResponse().sendError(403);}*/HttpHeaders headers = new HttpHeaders();headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);    headers.setContentDispositionFormData("attachment", fileName);    return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);}} catch (IOException e) {e.printStackTrace();}return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);}}

封裝

package com.utils;import java.util.HashMap;
import java.util.Map;/*** 返回數據*/
public class R extends HashMap<String, Object> {private static final long serialVersionUID = 1L;public R() {put("code", 0);}public static R error() {return error(500, "未知異常,請聯系管理員");}public static R error(String msg) {return error(500, msg);}public static R error(int code, String msg) {R r = new R();r.put("code", code);r.put("msg", msg);return r;}public static R ok(String msg) {R r = new R();r.put("msg", msg);return r;}public static R ok(Map<String, Object> map) {R r = new R();r.putAll(map);return r;}public static R ok() {return new R();}public R put(String key, Object value) {super.put(key, value);return this;}
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/161144.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/161144.shtml
英文地址,請注明出處:http://en.pswp.cn/news/161144.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

電力感知邊緣計算網關產品設計方案-網關系統通信架構方案

1.邊緣協同控制模發 能針對建筑、充電樁、分布式儲能、分布式光伏等典型設備建立對應物模型、完成數據采集通信協議設計和控制指令交互設計,能針對建筑、充換電站等典型場景提出具體實施方案和人工智能控制算法和邏輯。物模型、通信協議設計和控制指令交互設計科學、先進,能…

聚類系列(一)——什么是聚類?

目前在做聚類方面的科研工作, 看了很多相關的論文, 也做了一些工作, 于是想出個聚類系列記錄一下, 主要包括聚類的概念和相關定義、現有常用聚類算法、聚類相似性度量指標、聚類評價指標、 聚類的應用場景以及共享一些聚類的開源代碼 下面正式進入該系列的第一個部分&#xff…

webpack打包三方庫直接在html里面使用

場景&#xff1a;我是小程序中使用wxmp-rsa庫進行加密&#xff0c;然后在html里面解密 我就想把wxmp-rsa庫打包到一個js里面&#xff0c;然后在html里面直接引入使用。 webpack配置 const path require("path"); const MiniCssExtractPlugin require("mini-…

【MybatisPlus】簡介與使用

MyBatisPlus 1.簡介 MyBatisPlus&#xff08;簡稱MP&#xff09;是一個MyBatis的增強工具&#xff0c;在MyBatis的基礎上只做增強不做改變&#xff0c;為簡化開發、提高效率而生 官網&#xff1a;https://baomidou.com/ MyBatis-Plus特性&#xff1a; 無侵入&#xff1a;只…

C_1練習題

一、單項選擇題(本大題共20小題,每小題2分,共40分。在每小題給出的四個備選項中,選出一個正確的答案&#xff0c;并將所選項前的字母填寫在答題紙的相應位置上。) 若 x 為int 型變量,則執行以下語句后,x的值為(&#xff09; x5; xx*x; A. 25 B.-20 C. 20 D.-25 若x、i、j、k都…

C#學習相關系列之Linq用法---group和join相關用法(三)

一、Group用法 在C#的LINQ中&#xff0c;Grou將集合中的元素按照指定的鍵進行分組。Group方法返回一個IEnumerable<IGrouping<TKey, TElement>>類型的集合&#xff0c;其中TKey表示分組的鍵類型&#xff0c;TElement表示集合中元素的類型。每個IGrouping<TKey, …

php如何實現文件上傳

php實現文件上傳需要通過全局變量&#xff08;數組&#xff09;&#xff1a;$_FILES 結合 move_uploaded_file 函數來實現。 move_uploaded_file函數&#xff08;只對POST方式生效&#xff09;&#xff1a; 其中move_uploaded_file函數語法&#xff1a;move_uploaded_file(需要…

Vue生成二維碼并進行二維碼圖片下載

1、安包 npm install vue-qr --save2、引入 // vue2.0 import VueQr from vue-qr // vue3.0 import VueQr from vue-qr/src/packages/vue-qr.vue new Vue({components: {VueQr} })<!-- 設備二維碼 對話框 270px--><el-dialog title"點位二維碼" :visible.…

超級簽名封號掉簽該怎么辦

如果超級簽名封號掉簽了&#xff0c;可以考慮以下幾種解決方法&#xff1a; 聯系簽名服務商&#xff1a;首先&#xff0c;可以聯系簽名服務商&#xff0c;了解封號的原因和解決方案。app封裝打包可能會提供技術支持或幫助恢復簽名。 檢查簽名配置&#xff1a;確認簽名配置是否…

練習題——【學習補檔】庫函數的模擬實現

各種庫函數的模擬實現 一、模擬實現strlen1.地址-地址型2.遞歸型3.計數器型 二、模擬實現strcpy三、模擬實現strcmp四、模擬實現strcat五、模擬實現strstr 一、模擬實現strlen 模擬實現strlen有三種方法 1.地址-地址型 2.遞歸型 3.計數器型1.地址-地址型 // //1.地址-地址型 …

云服務器-從零搭建前后端服務

使用須知 選擇0M帶寬不能訪問公網&#xff08;不分配公網IP&#xff09;&#xff0c;如需分配公網IP請增加帶寬值。云服務器ECS默認不開啟虛擬內存如您需要使用請登錄云服務器內部操作。Linux開啟swap&#xff08;虛擬內存&#xff09;、Windows虛擬內存的設置若您購買了數據盤…

含分布式電源的配電網可靠性評估matlab程序

微?關注“電氣仔推送”獲得資料&#xff08;專享優惠&#xff09; 參考文獻&#xff1a; 基于仿射最小路法的含分布式電源配電網可靠性分析——熊小萍 主要內容&#xff1a; 通過概率模型和時序模型分別進行建模&#xff0c;實現基于概率模型最小路法的含分布式電源配電網…

web需求記錄

需求1&#xff1a;根據后端傳過來的設備名:DESKTOP-4DQRGQB&#xff0c;以及mac:e0:be:03:74:40:0b&#xff1b;iQOO-8&#xff0c;mac:b0:33:66:38:c3:25&#xff0c;用web option 是動態增加的&#xff08;也就是那個選擇框里面的東西是根據后端傳過來的值動態增加的&#xf…

upload-labs關卡12(基于白名單的%00截斷繞過)通關思路

文章目錄 前言一、靶場需要了解的前置知識1、%00截斷2、0x00截斷3、00截斷的使用條件1、php版本小于5.3.292、magic_quotes_gpc Off 二、靶場第十二關通關思路1、看源代碼2、bp抓包%00截斷3、驗證文件是否上傳成功 總結 前言 此文章只用于學習和反思鞏固文件上傳漏洞知識&…

LL(1)語法分析程序設計與實現

制作一個簡單的C語言詞法分析程序_用c語言編寫詞法分析程序-CSDN博客文章瀏覽閱讀322次。C語言的程序中&#xff0c;有很單詞多符號和保留字。一些單詞符號還有對應的左線性文法。所以我們需要先做出一個單詞字符表&#xff0c;給出對應的識別碼&#xff0c;然后跟據對應的表格…

國民新旅游時代,OTA們如何制勝新周期?

文 | 螳螂觀察&#xff08;TanglangFin&#xff09; 作者 | 圖霖 消費全面復蘇的大背景下&#xff0c;旅游業正迎來預期中的拐點。 一個顯著表現是&#xff0c;旅游消費正在從可選消費轉化成必選消費。 國內消費者旅游需求的不降反增&#xff0c;就是最好的印證。 同程研究…

DoFaker: 一個簡單易用的換臉工具

DoFaker: 一個簡單易用的換臉工具 基于insightface開發&#xff0c;可以輕松替換視頻或圖片中的人臉。支持windows和linux系統&#xff0c;CPU和GPU推理。onnxruntime推理&#xff0c;無需pytorch。 更新 2023/9/16 更新動作遷移算法2023/9/14 更新臉部增強算法(GFPGAN)和超分…

TypeScript枚舉

1、數字枚舉 enum Direction {Up,Down,Left,Right, } var Direction; (function (Direction) {Direction[Direction["Up"] 0] "Up";Direction[Direction["Down"] 1] "Down";Direction[Direction["Left"] 2] "L…

[點云分割] 基于顏色的區域增長分割

效果&#xff1a; 代碼&#xff1a; #include <iostream> #include <thread> #include <vector>#include <pcl/point_types.h> #include <pcl/io/pcd_io.h> #include <pcl/search/search.h> #include <pcl/search/kdtree.h> #inclu…

AR道具特效制作工具

AR&#xff08;增強現實&#xff09;技術已經逐漸滲透到各個行業&#xff0c;為企業帶來了全新的營銷方式和用戶體驗。在這個背景下&#xff0c;美攝科技憑借其強大的技術實力和創新精神&#xff0c;推出了一款專為企業打造的美攝AR特效制作工具&#xff0c;旨在幫助企業輕松實…