• 大小: 57.2MB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2023-02-19
  • 语言: 其他
  • 标签:

资源简介

MOOC网站模板,在线学习网站。MOOC网站模板,在线学习网站。MOOC网站模板,在线学习网站。

资源截图

代码片段和文件信息

package com.ssdut.demo.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.ssdut.demo.pojo.course;
import com.ssdut.demo.pojo.coursedetails;
import com.ssdut.demo.pojo.user_info;
import com.ssdut.demo.service.impl.CourseDetailServiseImpl;
import com.ssdut.demo.service.impl.CourseServiceImpl;
import com.ssdut.demo.service.impl.UserServiceImpl;

@Controller
@RequestMapping(“/course“)
public class CourseController {
@Autowired
private CourseServiceImpl courseService;
@Autowired
private UserServiceImpl userInfoService;
@Autowired
private CourseDetailServiseImpl coursedetailService;
@RequestMapping(“/addCourse“)
public ModelAndView addCourse(course recordHttpSession httpSession) {
//根据上传的piurl获得图片名
int userid = (Integer)httpSession.getAttribute(“userid“);
String picurl = record.getPicurl();
//System.out.println(“picurl:“+picurl);
picurl = userid+“_“+picurl.substring(picurl.lastIndexOf(“\\“)+1);
System.out.println(“picurl:“+picurl);
record.setPicurl(picurl);
if(record.getCourseid()!=null){
courseService.updateCourse(record);
}
else{
courseService.addCourse(record);
}
String username = (String) httpSession.getAttribute(“username“);
user_info user = userInfoService.getUserByUserName(username);
//System.out.println(user.getUserid());
List course_list = courseService.getCourseByTeacherId(user.getUserid());
ModelAndView modelAndView = new ModelAndView(“teacher/home“);
modelAndView.addobject(“usertype““教师“);
modelAndView.addobject(“user“user);
//还需要获取user所有的课程,传递给home
modelAndView.addobject(“course_list“course_list);
return modelAndView;
}
/*
 * 删除当前课程
 */
@RequestMapping(“/deleteCourse“)
public ModelAndView deleteCourse(int courseIdHttpSession httpSession) {
//根据上传的piurl获得图片名
//Integer id = (Integer) request.getAttribute(“courseId“);
//request.get
System.out.println(“id:“+courseId);
//if(courseId!=null){
courseService.deleteCourseById(courseId);
//}
String username = (String) httpSession.getAttribute(“username“);
user_info user = userInfoService.getUserByUserName(username);
//System.out.println(user.getUserid());
List course_list = courseService.getCourseByTeacherId(user.getUserid());
ModelAndView modelAndView = new ModelAndView(“teacher/home“);
modelAndView.addobject(“usertype““教师“);
modelAndView.addobject(“user“user);
//还需要获取user所有的课程,传递给home
modelAndView.addobject(“course_list“course_list);
return modelAndView;
}
/*
 * 返回我的课程界面
 * 
 */
@RequestMapping(“/toMyCourse“)
public ModelAndView toMyCourse(HttpSession httpSession) {
String username = (String) httpSession

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    .......      1859  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\.classpath

     文件       1296  2018-07-09 10:36  moocDemo-master - 复件(1)\moocDemo-master\demo\.project

    .......       626  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\.settings\.jsdtscope

    .......       137  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\.settings\org.eclipse.core.resources.prefs

    .......       422  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\.settings\org.eclipse.jdt.core.prefs

    .......        86  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\.settings\org.eclipse.m2e.core.prefs

    .......       726  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\.settings\org.eclipse.wst.common.component

    .......       245  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\.settings\org.eclipse.wst.common.project.facet.core.xml

    .......        49  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\.settings\org.eclipse.wst.jsdt.ui.superType.container

    .......         6  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\.settings\org.eclipse.wst.jsdt.ui.superType.name

    .......        48  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\.settings\org.eclipse.wst.validation.prefs

    .......       162  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\.tern-project

    .......      5766  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\pom.xml

    .......      5409  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\controller\CourseController.java

    .......      5865  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\controller\CourseDetailController.java

    .......      5665  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\controller\UploadController.java

    .......      6994  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\controller\UserInfoController.java

    .......       533  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\dao\coursedetailsMapper.java

    .......       507  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\dao\courseMapper.java

    .......       456  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\dao\courseselectMapper.java

    .......       373  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\dao\messageMapper.java

    .......       486  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\dao\user_infoMapper.java

    .......      1351  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\pojo\course.java

    .......       719  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\pojo\coursedetails.java

    .......       429  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\pojo\coursedetailsKey.java

    .......       947  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\pojo\courseselect.java

    .......       421  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\pojo\courseselectKey.java

    .......       933  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\pojo\message.java

    .......       841  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\pojo\user_info.java

    .......       319  2017-06-01 17:44  moocDemo-master - 复件(1)\moocDemo-master\demo\src\main\java\com\ssdut\demo\service\CourseDetailService.java

............此处省略413个文件信息

评论

共有 条评论

相关资源