漱壕 1 ? 0com/imooc/mvcdemo/service/impl/CourseServiceImpl java/lang/Object 'com/imooc/mvcdemo/service/CourseService <init> ()V Code
LineNumberTable LocalVariableTable this 2Lcom/imooc/mvcdemo/service/impl/CourseServiceImpl;
getCoursebyId 5(Ljava/lang/Integer;)Lcom/imooc/mvcdemo/model/Course; com/imooc/mvcdemo/model/Course
setCourseId (Ljava/lang/Integer;)V 娣卞叆娴呭嚭Java澶氱嚎绋? setTitle (Ljava/lang/String;)V resources/imgs/course-img.jpg
" #
setImgPath
% ' & java/lang/Integer ( ) valueOf (I)Ljava/lang/Integer;
+ , setLearningNum
. / setLevel 1 涓骇
3 4 setLevelDesc
package com.imooc.mvcdemo.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Service;
import com.imooc.mvcdemo.model.Chapter;
import com.imooc.mvcdemo.model.Course;
import com.imooc.mvcdemo.service.CourseService;
@Service("courseService")
public class CourseServiceImpl implements CourseService {
public Course getCoursebyId(Integer courseId) {
Course course = new Course();
course.setCourseId(courseId);
course.setTitle("深入浅出Java多线程");
course.setImgPath("resources/imgs/course-img.jpg");
course.setLearningNum(12345);
course.setLevel(2);
course.setLevelDesc("中级");
course.setDuration(7200l);
course.setDescr("多线程是日常开发中的常用知识,也是难用知识。bala bala...");
按照教程把前面文件检查一遍,和视频里面一样还有就是编码格式都改为UTF-8即可