資源簡介
完整前后端代碼:微信小程序端源代碼+后臺管理端以及小程序界面所需的接口源代碼
博客地址:https://blog.csdn.net/qq_38285537/article/details/91056177
博客地址:https://blog.csdn.net/qq_38285537/article/details/91056177
代碼片段和文件信息
package?com.system.controller;
import?com.system.exception.CustomException;
import?com.system.po.*;
import?com.system.service.*;
import?org.springframework.stereotype.Controller;
import?org.springframework.ui.Model;
import?org.springframework.web.bind.annotation.RequestMapping;
import?org.springframework.web.bind.annotation.RequestMethod;
import?javax.annotation.Resource;
import?java.util.List;
@Controller
@RequestMapping(“/admin“)
public?class?AdminController?{
????@Resource(name?=?“studentServiceImpl“)
????private?StudentService?studentService;
????@Resource(name?=?“teacherServiceImpl“)
????private?TeacherService?teacherService;
????@Resource(name?=?“courseServiceImpl“)
????private?CourseService?courseService;
????@Resource(name?=?“collegeServiceImpl“)
????private?CollegeService?collegeService;
????@Resource(name?=?“userloginServiceImpl“)
????private?UserloginService?userloginService;
????/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<學生操作>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
????@RequestMapping(“/showStudent“)
????public?String?showStudent(Model?model?Integer?page)?throws?Exception?{
????????List?list?=?null;
????????//頁碼對象
????????PagingVO?pagingVO?=?new?PagingVO();
????????//設(shè)置總頁數(shù)
????????pagingVO.setTotalCount(this.studentService.getCountStudent());
????????if?(page?==?null?||?page?==?0)?{
????????????pagingVO.setToPageNo(1);
????????????list?=?studentService.findByPaging(1);
????????}?else?{
????????????pagingVO.setToPageNo(page);
????????????list?=?studentService.findByPaging(page);
????????}
??????/*??if?(page?!=?null?&&?page.intValue()?!=?0){
????????????pagingVO.setToPageNo(page);
????????????list?=?this.studentService.findByPaging(1);
????????}else{
????????????pagingVO.setToPageNo(Integer.valueOf(1));
????????????list?=?this.studentService.findByPaging(Integer.valueOf(1));
????????}*/
????????model.addAttribute(“studentList“?list);
????????model.addAttribute(“pagingVO“?pagingVO);
????????return?“/admin/showStudent“;
????}
????//??添加學生信息頁面顯示
????@RequestMapping(value?=?“/addStudent“?method?=?{RequestMethod.GET})
????public?String?addStudentUI(Model?model)?throws?Exception?{
????????List?list?=?collegeService.finAll();
????????model.addAttribute(“collegeList“?list);
????????return?“/admin/addStudent“;
????}
?????//?添加學生信息操作
????@RequestMapping(value?=?“/addStudent“?method?=?{RequestMethod.POST})
????public?String?addStudent(StudentCustom?studentCustom?Model?model)?throws?Exception?{
????????Boolean?result?=?studentService.save(studentCustom);
????????if?(!result)?{
????????????model.addAttribute(“message“?“學號重復“);
????????????return?“error“;
????????}
????????//添加成功后,也添加到登錄表
????????Userlogin?userlogin?=?new?Userlogin();
????????userlogin.setUsername(studentCustom.getUserid().toString());
????????userlogin.setPassword(“123“);
????????userlogin.setRole(2);
????????userloginService.save(userlogin);
????????//重定向
????????return?“redirect:/admin/showStudent“;
????}
????//?修改學生信息頁面顯示
????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-12-07?13:43??Java后臺\
?????文件???????13516??2019-06-06?22:41??Java后臺\examination_system.sql
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\.idea\
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\.idea\codest
?????文件?????????153??2019-03-01?22:21??Java后臺\Examination_System\.idea\codest
?????文件?????????551??2019-04-12?14:25??Java后臺\Examination_System\.idea\compiler.xm
?????文件?????????332??2019-03-01?22:22??Java后臺\Examination_System\.idea\encodings.xm
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\.idea\inspectionProfiles\
?????文件????????3404??2019-03-07?14:13??Java后臺\Examination_System\.idea\inspectionProfiles\Project_Default.xm
?????文件?????????656??2019-03-01?22:22??Java后臺\Examination_System\.idea\misc.xm
?????文件???????53123??2019-04-12?19:34??Java后臺\Examination_System\.idea\workspace.xm
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\.settings\
?????文件?????????555??2018-04-16?18:28??Java后臺\Examination_System\.settings\.jsdtscope
?????文件?????????723??2018-04-16?18:28??Java后臺\Examination_System\.settings\org.eclipse.jdt.core.prefs
?????文件?????????591??2018-04-16?18:28??Java后臺\Examination_System\.settings\org.eclipse.wst.common.component
?????文件?????????245??2018-04-16?18:28??Java后臺\Examination_System\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件??????????49??2018-04-16?18:28??Java后臺\Examination_System\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2018-04-16?18:28??Java后臺\Examination_System\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件??????????48??2018-04-16?18:28??Java后臺\Examination_System\.settings\org.eclipse.wst.validation.prefs
?????文件????????6422??2019-05-18?15:00??Java后臺\Examination_System\pom.xm
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\src\
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\src\main\
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\src\main\java\
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\src\main\java\com\
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\src\main\java\com\system\
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\src\main\java\com\system\controller\
?????文件???????13326??2019-06-04?22:56??Java后臺\Examination_System\src\main\java\com\system\controller\AdminController.java
?????目錄???????????0??2019-12-07?13:43??Java后臺\Examination_System\src\main\java\com\system\controller\converter\
?????文件?????????798??2018-04-16?18:28??Java后臺\Examination_System\src\main\java\com\system\controller\converter\CustomDateConverter.java
?????文件????????3109??2019-06-06?09:39??Java后臺\Examination_System\src\main\java\com\system\controller\LoginController.java
............此處省略1466個文件信息
評論
共有 條評論